uk.ac.soton.itinnovation.grid.client.helpers
Class ServiceInputHandler

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.client.helpers.ServiceInputHandler
All Implemented Interfaces:
InvocationListener, UserInputHandler
Direct Known Subclasses:
SwingInputHandler

public class ServiceInputHandler
extends Object
implements UserInputHandler

A non-interactive UserInputHandler for services.


Constructor Summary
ServiceInputHandler()
           
 
Method Summary
 SOAPHeaderElement[] addHeadersForCall(StateRepository repos, StorableInStateRepository proxy, Method method)
           
 void addInvocationListener(InvocationListener listener)
          Add a new listener to the chain of handlers called when invoking SOAP operations.
 SOAPHeaderElement[] getBillingHeaders(StateRepository repository, StorableInStateRepository service, org.apache.axis.message.addressing.EndpointReferenceType[] policy)
           
 void invocationDone(StorableInStateRepository object, Method method)
          SOAP call ended.
 void invocationStarted(StorableInStateRepository object, Method method)
          SOAP call starting.
 UnknownCertificateResponse queryUnknownCertificate(X509Certificate[] chain)
          Handles unknown certificates.
 void removeInvocationListener(InvocationListener listener)
          Remove a listener previously added with UserInputHandler.addInvocationListener(uk.ac.soton.ecs.iam.grid.comms.client.helpers.InvocationListener).
 void reportError(Exception ex)
          Convenience wrapper for reportError(Exception, Object), where the object is null.
 void reportError(Exception ex, Object object)
          Logs an error using log4j.
 void setCurrentThreadEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
          Set the EPR for this thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceInputHandler

public ServiceInputHandler()
Method Detail

setCurrentThreadEPR

public void setCurrentThreadEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Description copied from interface: UserInputHandler
Set the EPR for this thread. When contacting a remote service with an unknown certificate, this EPR checked for a ConversationID.ENDPOINT_KEYINFO containing the certificate. This allows per-call roots of trust.

Specified by:
setCurrentThreadEPR in interface UserInputHandler

reportError

public void reportError(Exception ex,
                        Object object)
Logs an error using log4j.

Specified by:
reportError in interface UserInputHandler
Parameters:
ex - The exception to report
object - An object (usually a string) which the exception is about.

reportError

public void reportError(Exception ex)
Description copied from interface: UserInputHandler
Convenience wrapper for reportError(Exception, Object), where the object is null.

Specified by:
reportError in interface UserInputHandler

queryUnknownCertificate

public UnknownCertificateResponse queryUnknownCertificate(X509Certificate[] chain)
Handles unknown certificates.

Specified by:
queryUnknownCertificate in interface UserInputHandler
Parameters:
chain - the certificate chain presented by the service (may only contain a single certificate if that is all we have available)
Returns:
ACCEPT_THIS_MESSAGE if the current EPR trusts this certificate, or null otherwise

getBillingHeaders

public SOAPHeaderElement[] getBillingHeaders(StateRepository repository,
                                             StorableInStateRepository service,
                                             org.apache.axis.message.addressing.EndpointReferenceType[] policy)
                                      throws RemoteException,
                                             UserAbort
Throws:
RemoteException
UserAbort

addInvocationListener

public void addInvocationListener(InvocationListener listener)
Description copied from interface: UserInputHandler
Add a new listener to the chain of handlers called when invoking SOAP operations.

Specified by:
addInvocationListener in interface UserInputHandler

removeInvocationListener

public void removeInvocationListener(InvocationListener listener)
Description copied from interface: UserInputHandler
Remove a listener previously added with UserInputHandler.addInvocationListener(uk.ac.soton.ecs.iam.grid.comms.client.helpers.InvocationListener).

Specified by:
removeInvocationListener in interface UserInputHandler

invocationStarted

public void invocationStarted(StorableInStateRepository object,
                              Method method)
Description copied from interface: InvocationListener
SOAP call starting. Called by RemoteResourceProxy to indicate that a SOAP invocation is about to start. This can be used to display a 'busy' indicator.

Specified by:
invocationStarted in interface InvocationListener

invocationDone

public void invocationDone(StorableInStateRepository object,
                           Method method)
Description copied from interface: InvocationListener
SOAP call ended. Called by RemoteResourceProxy to indicate that a SOAP invocation has finished. This can be used to hide the 'busy' indicator set by InvocationListener.invocationStarted(uk.ac.soton.ecs.iam.grid.comms.client.StorableInStateRepository, java.lang.reflect.Method).

Specified by:
invocationDone in interface InvocationListener

addHeadersForCall

public SOAPHeaderElement[] addHeadersForCall(StateRepository repos,
                                             StorableInStateRepository proxy,
                                             Method method)
Specified by:
addHeadersForCall in interface InvocationListener


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.