|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infoservice.japforwarding.ServerVerifier
public final class ServerVerifier
This class is used for verifying a JAP forwarding server (whether it is accessable from the outside world).
Field Summary | |
---|---|
private java.net.InetAddress |
m_serverAddress
Stores the internet address of a JAP forwarding server. |
private int |
m_serverPort
Stores the port of a JAP forwarding server. |
private static int |
MAXIMUM_PROTOCOLMESSAGE_SIZE
This is the maximum net size of a protocol message in bytes. |
private static byte[] |
MESSAGE_END_SIGNATURE
This is the end signature of every protocol message. |
private static byte[] |
MESSAGE_START_SIGNATURE
This is the start signature of every protocol message. |
private static long |
ms_lastServerVerifierThreadID
Stores the thread number of the ServerVerifiy-Thread...* |
Constructor Summary | |
---|---|
ServerVerifier(java.net.InetAddress a_serverAddress,
int a_serverPort)
Creates a new ServerVerifier. |
Method Summary | |
---|---|
private boolean |
checkSignature(byte[] a_signature1,
byte[] a_signature2)
This method checks, whether to byte arrays have identical content or not. |
private byte[] |
createProtocolPacket(byte[] a_data)
Creates a protocol packet from byte array with data. |
private org.w3c.dom.Document |
generateConnectionVerify()
Creates an verify request message for the verifying the JAP forwarding server. |
private org.w3c.dom.Document |
parseXmlData(byte[] a_xmlData)
Parses a byte-array with XML data. |
private byte[] |
readProtocolMessage(java.net.Socket a_connection)
Reads a message from the associated network connection. |
private void |
sendProtocolMessage(byte[] a_message,
java.net.Socket a_connection)
Sends a message to the associated network connection. |
boolean |
verifyServer()
Verifies the connection to the JAP forwarding server. |
private byte[] |
xmlToProtocolPacket(org.w3c.dom.Document a_doc)
Creates a protocol packet from an XML structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final byte[] MESSAGE_START_SIGNATURE
private static final byte[] MESSAGE_END_SIGNATURE
private static final int MAXIMUM_PROTOCOLMESSAGE_SIZE
private java.net.InetAddress m_serverAddress
private int m_serverPort
private static long ms_lastServerVerifierThreadID
Constructor Detail |
---|
public ServerVerifier(java.net.InetAddress a_serverAddress, int a_serverPort)
a_serverAddress
- The internet address of the JAP forwarding server.a_serverPort
- The port of the JAP forwarding server.Method Detail |
---|
public boolean verifyServer()
private boolean checkSignature(byte[] a_signature1, byte[] a_signature2)
a_signature1
- The first byte array.a_signature2
- The second byte array.
private byte[] readProtocolMessage(java.net.Socket a_connection) throws java.lang.Exception
a_connection
- The connection to read from;
java.lang.Exception
private void sendProtocolMessage(byte[] a_message, java.net.Socket a_connection) throws java.io.IOException
a_message
- The message to send.a_connection
- The connection for writing the message.
java.io.IOException
private org.w3c.dom.Document generateConnectionVerify() throws java.lang.Exception
java.lang.Exception
private byte[] xmlToProtocolPacket(org.w3c.dom.Document a_doc) throws java.lang.Exception
doc
- The XML structure which shall be transformed in a protocol packet.
java.lang.Exception
private byte[] createProtocolPacket(byte[] a_data)
a_data
- The bytes to put in the protocol packet.
private org.w3c.dom.Document parseXmlData(byte[] a_xmlData) throws java.lang.Exception
a_xmlData
- A byte-array with XML data.
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |