Package org.dlese.dpc.ndr.connection
Class NDRConnection
java.lang.Object
org.dlese.dpc.ndr.connection.NDRConnection
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNDRConnection(String _serviceURI) NDRConnection(String _serviceURI, boolean _sslFlag) -
Method Summary
Modifier and TypeMethodDescriptionconnect()Connect via this NDR connection.Get the NDR agentHandle for this connection object.Get the canonical header for this connection object.Retrieve the URL for this connection.getHeaderValue(String key) Get a header value for the given key.Get the private key for this connection.Get the server for this object.Get the signed header ( canonical + x-nsdl-auth ).booleanDetermine if the server for this connection is responding and operational.request()requestGET(String _content) requestGET(String _content, boolean _withParameters) voidsetAgentHandle(String _handle) Set the NDR connection agentHandle for this object.voidsetCanonicalHeader(boolean signed) Set the NDR specified canonical header for this connection.voidsetConnection(String _url) Set the connection for this object give a url.voidsetContent(String _requestContent) voidsetKeyFile(File f) voidSet the server for this object.voidsetTimeout(int millisecs)
-
Constructor Details
-
Method Details
-
getKeyFile
-
setKeyFile
-
getServer
Get the server for this object.- Returns:
- - the server for this object
-
setServer
Set the server for this object.- Parameters:
_server- - the server
-
getAgentHandle
Get the NDR agentHandle for this connection object.- Returns:
- - the agent handle for this object.=
-
setAgentHandle
Set the NDR connection agentHandle for this object.- Parameters:
_handle-
-
getLastError
- Returns:
-
isConnectionOK
public boolean isConnectionOK()Determine if the server for this connection is responding and operational.- Returns:
- - true if the connection is OK
-
getPrivateKeyObject
Get the private key for this connection.- Returns:
- - the
PrivateKeyobject for this connection.
-
getConnection
Retrieve the URL for this connection.- Returns:
- - the URL string for this connection
-
setConnection
Set the connection for this object give a url.- Parameters:
url-
-
setTimeout
public void setTimeout(int millisecs) -
connect
Connect via this NDR connection. -
setCanonicalHeader
public void setCanonicalHeader(boolean signed) Set the NDR specified canonical header for this connection. This will sign the object with the appropriate x-nsdl-auth property as required by the NDR API specification}.invalid @link
{@link http://ndr.comm.nsdl.com- Parameters:
signed- - set the canonical x-ndsl-auth property or not
-
getCanonicalHeader
Get the canonical header for this connection object.- Returns:
- - the canonical header
-
getSignedHeader
Get the signed header ( canonical + x-nsdl-auth ).- Returns:
- - the signed header
-
getHeaderValue
Get a header value for the given key.- Parameters:
key- - the key of interest- Returns:
- - the value for that key
-
setContent
-
getContent
-
requestGET
-
requestGET
-
request
- Throws:
Exception
-
request
- Throws:
Exception
-