Package org.hcjf.io.net
Class NetPackage
- java.lang.Object
-
- org.hcjf.io.net.NetPackage
-
- Direct Known Subclasses:
DefaultNetPackage,NetPackage.NetPackageWrapper
public abstract class NetPackage extends java.lang.ObjectThis class represents a package of information over IP protocol.- Author:
- javaito
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNetPackage.ActionEventActioln events.static classNetPackage.NetPackageWrapperNet package wrapper.static classNetPackage.PackageStatusTransaction's status.
-
Constructor Summary
Constructors Constructor Description NetPackage()
-
Method Summary
Modifier and Type Method Description abstract NetPackage.ActionEventgetActionEvent()Return the action event.abstract java.util.DategetDate()Return the creation date of the package.java.util.UUIDgetId()Return the package id.abstract intgetLocalPort()Return the local port on the connections was stablishedabstract NetPackage.PackageStatusgetPackageStatus()Return the status of the package.abstract byte[]getPayload()Return the payload of the package.abstract java.lang.StringgetRemoteAddress()Return the remote ip address.abstract java.lang.StringgetRemoteHost()Return the address of the remote host.abstract intgetRemotePort()Return the port of the remote host.abstract NetSessiongetSession()Return the net session of the package.abstract voidsetPackageStatus(NetPackage.PackageStatus packageStatus)Set a new package status.abstract voidsetSession(NetSession session)Set the session over the package was created.static NetPackagewrap(NetPackage netPackage, byte[] newPayLoad)Create a wrapper of the net package using other pay load.
-
-
-
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.
-
-