Class NetPackage

    • Constructor Detail

      • NetPackage

        public NetPackage()
    • Method Detail

      • getId

        public final java.util.UUID getId()
        Return the package id.
        Returns:
        Package id.
      • getSession

        public abstract NetSession getSession()
        Return the net session of the package.
        Returns:
        Net session.
      • setSession

        public abstract void setSession​(NetSession session)
        Set the session over the package was created.
        Parameters:
        session - Net session
      • getPayload

        public abstract byte[] getPayload()
        Return the payload of the package.
        Returns:
        Payload of the package.
      • getRemoteAddress

        public abstract java.lang.String getRemoteAddress()
        Return the remote ip address.
        Returns:
        Remote ip address.
      • getRemoteHost

        public abstract java.lang.String getRemoteHost()
        Return the address of the remote host.
        Returns:
        Address of the remote host.
      • getRemotePort

        public abstract int getRemotePort()
        Return the port of the remote host.
        Returns:
        Port of the remote host.
      • getLocalPort

        public abstract int getLocalPort()
        Return the local port on the connections was stablished
        Returns:
        Local port.
      • getDate

        public abstract java.util.Date getDate()
        Return the creation date of the package.
        Returns:
        Creation date of the package.
      • getActionEvent

        public abstract NetPackage.ActionEvent getActionEvent()
        Return the action event.
        Returns:
        Action event.
      • getPackageStatus

        public abstract NetPackage.PackageStatus getPackageStatus()
        Return the status of the package.
        Returns:
        Package's status.
      • setPackageStatus

        public abstract void setPackageStatus​(NetPackage.PackageStatus packageStatus)
        Set a new package status.
        Parameters:
        packageStatus - Package's status
      • wrap

        public static final NetPackage wrap​(NetPackage netPackage,
                                            byte[] newPayLoad)
        Create a wrapper of the net package using other pay load.
        Parameters:
        netPackage - Package to wrap.
        newPayLoad - New pay load.
        Returns:
        Net package wrapper.