public class CstaHttpConnection
extends java.lang.Object
This class is an implementation of an HTTP connection with OSV. It uses the HttpURLConnection for the HTTP client interaction. A CstaHttpConnection is either autonomous i.e. you get a connection send a request and close it (closing the underlying TCP connection) or it is part of a pool.In this case connection must be return to the pool by calling the appropriate method to ensure that the underline TCP connection is cached and can be reused in the next request. Both approaches have an upper limit on the number of active POSTs to the OSV server.
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
logger |
static int |
SOAP_MSG_SIZE |
Constructor and Description |
---|
CstaHttpConnection(java.net.HttpURLConnection connection,
CstaHttpConnectionsPool pool)
An HTTP connection from the HTTP pool.
|
CstaHttpConnection(java.net.URL url)
An autonomous HTTP point to point connection
This creates an HTTP connection to the OSV and a POST request can be send
Once the POST is send the underlying TCP socket is closed
|
Modifier and Type | Method and Description |
---|---|
void |
cache()
This method places the connection back to the cache.
|
javax.xml.soap.SOAPMessage |
sendPOST(javax.xml.soap.SOAPMessage message)
This method sends an HTTP Post request to OSV and returns the response
|
public static final int SOAP_MSG_SIZE
public static org.apache.log4j.Logger logger
public CstaHttpConnection(java.net.URL url)
url
- the osv url
public CstaHttpConnection(java.net.HttpURLConnection connection, CstaHttpConnectionsPool pool)
connection
- It is initialized by the Poolpool
- Reference to the pool the connection belongspublic void cache()
public javax.xml.soap.SOAPMessage sendPOST(javax.xml.soap.SOAPMessage message) throws java.io.IOException, javax.xml.soap.SOAPException, CstaException
message
- java.io.IOException
javax.xml.soap.SOAPException
CstaException