|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jp.protection.pub.pro.network.NetworkCheckPacket
public class NetworkCheckPacket
Defines network check packet that holds all the data required to identify host and license
Field Summary | |
---|---|
protected java.lang.String |
fHostID
|
protected long |
fHostTimestamp
|
protected java.lang.String |
fLicenseNumber
|
protected java.lang.String |
fProductID
|
protected java.lang.String |
fSignature
|
protected byte |
fType
|
static byte |
TYPE_REQUEST
Defines request type of the packet |
static byte |
TYPE_RESPONSE
Defines response type of the packet |
Constructor Summary | |
---|---|
NetworkCheckPacket()
|
Method Summary | |
---|---|
static NetworkCheckPacket |
createRequest(java.lang.String aProductID,
java.lang.String aLicenseNumber,
java.lang.String aSignature,
java.lang.String aHostID,
long aHostTimestamp)
Creates request |
static NetworkCheckPacket |
createResponse(java.lang.String aProductID,
java.lang.String aLicenseNumber,
java.lang.String aSignature,
java.lang.String aHostID,
long aHostTimestamp)
Creates response packet |
void |
fromByteArray(byte[] aBytes,
int offset,
int length)
Reads packet from array of bytes |
java.lang.String |
getHostID()
Returns host identifier |
long |
getHostTimestamp()
Returns host timestamp |
java.lang.String |
getLicenseNumber()
Return license number |
java.lang.String |
getProductID()
Return product identifier |
java.lang.String |
getSignature()
Returns signature |
byte |
getType()
Return packet type |
void |
readExternal(java.io.ObjectInput in)
|
protected static java.lang.String |
readString(java.io.ObjectInput in)
|
byte[] |
toByteArray()
Writes packet to array of bytes |
void |
writeExternal(java.io.ObjectOutput out)
|
protected static void |
writeString(java.io.ObjectOutput out,
java.lang.String str)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String fProductID
protected java.lang.String fLicenseNumber
protected java.lang.String fHostID
protected long fHostTimestamp
protected byte fType
public static final byte TYPE_REQUEST
public static final byte TYPE_RESPONSE
protected java.lang.String fSignature
Constructor Detail |
---|
public NetworkCheckPacket()
Method Detail |
---|
public java.lang.String getHostID()
public long getHostTimestamp()
public java.lang.String getSignature()
public byte getType()
TYPE_
constantspublic java.lang.String getLicenseNumber()
public java.lang.String getProductID()
public static NetworkCheckPacket createRequest(java.lang.String aProductID, java.lang.String aLicenseNumber, java.lang.String aSignature, java.lang.String aHostID, long aHostTimestamp)
aProductID
- product identifieraLicenseNumber
- license numberaSignature
- signatureaHostID
- host identifieraHostTimestamp
- host timestamp
public static NetworkCheckPacket createResponse(java.lang.String aProductID, java.lang.String aLicenseNumber, java.lang.String aSignature, java.lang.String aHostID, long aHostTimestamp)
aProductID
- product identifieraLicenseNumber
- license numberaSignature
- signatureaHostID
- host identifieraHostTimestamp
- host timestamp
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
protected static void writeString(java.io.ObjectOutput out, java.lang.String str) throws java.io.IOException
java.io.IOException
protected static java.lang.String readString(java.io.ObjectInput in) throws java.io.IOException
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public byte[] toByteArray() throws java.io.IOException
java.io.IOException
- for errors occured during writingpublic void fromByteArray(byte[] aBytes, int offset, int length) throws java.lang.ClassNotFoundException, java.io.IOException
aBytes
- array of bytes to read packet fromoffset
- offset in the array to start reading fromlength
- length to read
java.lang.ClassNotFoundException
- if NetworkCheckPacket class is not found
java.io.IOException
- form errors occured during reading
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |