|
IAIK TSP version 2.32 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object demo.tsp.connections.tcpip.TspTcpIpClient
public class TspTcpIpClient
This class implements the TSP TCP/IP client connection. For details please
refer to:
RFC 3161.
Field Summary | |
---|---|
protected static int |
DEFAULT_PORT
The default port |
protected static java.lang.String |
DEFAULT_URL
The url of the default tsa server |
protected static org.apache.commons.logging.Log |
log
The logger for this class. |
protected static java.lang.String |
MESSAGE
Message to be time stamped |
Constructor Summary | |
---|---|
TspTcpIpClient(java.lang.String url,
int port)
Initializes a client socket with the given URL and port number. |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
Creates a time stamp request and sends it to the specified server. |
TspTcpIpResponse |
sendAndReceiveData(TimeStampReq request)
This method sends a TimeStampReq to the specified time
stamping server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected static final java.lang.String DEFAULT_URL
protected static final int DEFAULT_PORT
protected static final java.lang.String MESSAGE
Constructor Detail |
---|
public TspTcpIpClient(java.lang.String url, int port)
URL
and port number.
url
- URL to connect.port
- Port to connect.Method Detail |
---|
public TspTcpIpResponse sendAndReceiveData(TimeStampReq request) throws java.lang.NullPointerException, java.io.IOException, TspTcpIpFormatException, CodingException
TimeStampReq
to the specified time
stamping server. The method waits until the server sends a TspHttpResponse
back.
request
- The TimeStampReq
.
TspHttpResponse
java.lang.NullPointerException
- Thrown if the given argument is null
.
java.io.IOException
- Thrown if a time out or any other IO exception occurs.
TspTcpIpFormatException
- Thrown if the received data is a not supported response format.
CodingException
- Thrown if the received data could not be parsed.public static void main(java.lang.String[] args)
args
- The first argument is the server and the second is the port
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |