webfunds.sox
Class BasicAgent

java.lang.Object
  |
  +--webfunds.utils.Debug
        |
        +--webfunds.sox.BasicAgent

public class BasicAgent
extends Debug

Instances of this class are used to perform basic requests. BasicAgent provides a technology-independant interface.


Field Summary
protected  CommsAgent comms
          The comms agent that actually sends the requests.
 
Fields inherited from class webfunds.utils.Debug
bug, debugAll, logfix
 
Constructor Summary
BasicAgent(CommsAgent comms)
          Create a new BasicAgent object.
BasicAgent(CommsAgent comms, java.io.PrintWriter bug)
          Create a new BasicAgent object (with debug)
 
Method Summary
 EncryptedReply encryptedRequest(EncryptedRequest request)
          Issue an encrypted request.
 java.security.cert.Certificate getCommsKey()
          Get the current communications certificate for this issuer.
 java.security.cert.Certificate getServerKey()
           
 byte[] request(BasicRequest request)
          Issue a request at the "basic" layer.
 java.lang.String toString()
          Convert this object to a string
 
Methods inherited from class webfunds.utils.Debug
debug, debug, debug, debug, err, getDebug, logend, logmsg, logstart, logword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

comms

protected CommsAgent comms
The comms agent that actually sends the requests. This is an agent that knows how to send a particular form of message such as HTTP or email.
Constructor Detail

BasicAgent

public BasicAgent(CommsAgent comms)
Create a new BasicAgent object.
Parameters:
comms - the comms agent that sends the requests

BasicAgent

public BasicAgent(CommsAgent comms,
                  java.io.PrintWriter bug)
Create a new BasicAgent object (with debug)
Parameters:
comms - the comms agent that sends the requests
Method Detail

request

public byte[] request(BasicRequest request)
               throws SOXPacketException,
                      SOXKeyException,
                      SOXLaterException,
                      SOXIssuerException
Issue a request at the "basic" layer.
Returns:
a valid reply packet

getServerKey

public java.security.cert.Certificate getServerKey()
                                            throws SOXPacketException,
                                                   SOXLaterException,
                                                   SOXIssuerException

getCommsKey

public java.security.cert.Certificate getCommsKey()
                                           throws SOXPacketException,
                                                  SOXLaterException,
                                                  SOXIssuerException
Get the current communications certificate for this issuer.

encryptedRequest

public EncryptedReply encryptedRequest(EncryptedRequest request)
                                throws SOXPacketException,
                                       SOXKeyException,
                                       SOXLaterException,
                                       SOXIssuerException
Issue an encrypted request.

toString

public java.lang.String toString()
Convert this object to a string
Overrides:
toString in class java.lang.Object