DLESE Tools
v1.6.0

org.dlese.dpc.ndr.connection
Class NDRConnection

java.lang.Object
  extended by org.dlese.dpc.ndr.connection.NDRConnection

public class NDRConnection
extends Object


Constructor Summary
protected NDRConnection()
           
  NDRConnection(String _serviceURI)
           
  NDRConnection(String _serviceURI, boolean _sslFlag)
           
 
Method Summary
 NDRAPIProxy connect()
          Connect via this NDR connection.
 String getAgentHandle()
          Get the NDR agentHandle for this connection object.
 String getCanonicalHeader()
          Get the canonical header for this connection object.
 String getConnection()
          Retrieve the URL for this connection.
 String getContent()
           
 String getHeaderValue(String key)
          Get a header value for the given key.
 File getKeyFile()
           
 Exception getLastError()
           
 PrivateKey getPrivateKeyObject()
          Get the private key for this connection.
 String getServer()
          Get the server for this object.
 String getSignedHeader()
          Get the signed header ( canonical + x-nsdl-auth ).
 boolean isConnectionOK()
          Determine if the server for this connection is responding and operational.
 String request()
           
 String request(String _content)
           
 String requestGET(String _content)
           
 String requestGET(String _content, boolean _withParameters)
           
 void setAgentHandle(String _handle)
          Set the NDR connection agentHandle for this object.
 void setCanonicalHeader(boolean signed)
          Set the NDR specified canonical header for this connection.
 void setConnection(String _url)
          Set the connection for this object give a url.
 void setContent(String _requestContent)
           
 void setKeyFile(File f)
           
 void setServer(String _server)
          Set the server for this object.
 void setTimeout(int millisecs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NDRConnection

protected NDRConnection()
                 throws Exception
Throws:
Exception

NDRConnection

public NDRConnection(String _serviceURI)
              throws Exception
Throws:
Exception

NDRConnection

public NDRConnection(String _serviceURI,
                     boolean _sslFlag)
              throws Exception
Throws:
Exception
Method Detail

getKeyFile

public File getKeyFile()

setKeyFile

public void setKeyFile(File f)

getServer

public String getServer()
Get the server for this object.

Returns:
- the server for this object

setServer

public void setServer(String _server)
Set the server for this object.

Parameters:
_server - - the server

getAgentHandle

public String getAgentHandle()
Get the NDR agentHandle for this connection object.

Returns:
- the agent handle for this object.=

setAgentHandle

public void setAgentHandle(String _handle)
Set the NDR connection agentHandle for this object.

Parameters:
_handle -

getLastError

public Exception 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

public PrivateKey getPrivateKeyObject()
Get the private key for this connection.

Returns:
- the PrivateKey object for this connection.

getConnection

public String getConnection()
Retrieve the URL for this connection.

Returns:
- the URL string for this connection

setConnection

public void setConnection(String _url)
Set the connection for this object give a url.

Parameters:
url -

setTimeout

public void setTimeout(int millisecs)

connect

public NDRAPIProxy 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 http://ndr.comm.nsdl.com.

Parameters:
signed - - set the canonical x-ndsl-auth property or not

getCanonicalHeader

public String getCanonicalHeader()
Get the canonical header for this connection object.

Returns:
- the canonical header

getSignedHeader

public String getSignedHeader()
Get the signed header ( canonical + x-nsdl-auth ).

Returns:
- the signed header

getHeaderValue

public String getHeaderValue(String key)
Get a header value for the given key.

Parameters:
key - - the key of interest
Returns:
- the value for that key

setContent

public void setContent(String _requestContent)

getContent

public String getContent()

requestGET

public String requestGET(String _content)

requestGET

public String requestGET(String _content,
                         boolean _withParameters)

request

public String request()
               throws Exception
Throws:
Exception

request

public String request(String _content)
               throws Exception
Throws:
Exception

DLESE Tools
v1.6.0