uk.ac.soton.ecs.iam.grid.comms.client
Class AbstractTransport

java.lang.Object
  extended by uk.ac.soton.ecs.iam.grid.comms.client.AbstractTransport
All Implemented Interfaces:
Transport
Direct Known Subclasses:
AxisTransport

public abstract class AbstractTransport
extends Object
implements Transport

Abstract base class for local and SOAP-based Transport implementations.


Field Summary
protected  CertificateTrustValidator certificateTrustValidator
           
protected  IdentityProvider idp
           
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
AbstractTransport()
           
AbstractTransport(IdentityProvider idp)
           
 
Method Summary
 void addInvocationListener(InvocationListener invocationListener)
          Add a listener to be notified of all remote operations.
 Document fetchWSDL(URL url, X509Certificate expectedCertificate)
          Download and parse a WSDL file.
 CertificateTrustValidator getCertificateTrustValidator()
          Decides whether to trust a server's certificate.
 IdentityProvider getIdentityProvider()
          Returns the configured identity provider.
 X509Certificate getIssuerCert()
          Deprecated. 
 KeyStore getKeyStore()
          Deprecated. 
protected  String getKeystoreLocation()
          Deprecated. 
 Key getPrivateKey()
          Deprecated. 
 X509Certificate getSubjectCert()
          Deprecated. 
 org.apache.commons.httpclient.methods.GetMethod getURL(URL url, org.apache.commons.httpclient.Header[] extraHeaders)
          Read a remote HTTP resource.
 Object invokeService(RemoteBoundMethod method, String serviceProviderRef, SOAPHeaderElement[] extraHeaders, Object[] argValues)
           
 InputStream openURL(URL url)
          Deprecated. 
 void putURL(URL url, org.apache.commons.httpclient.methods.RequestEntity entity, org.apache.commons.httpclient.Header[] extraHeaders)
          Upload some data using an HTTP PUT.
 void removeInvocationListener(InvocationListener invocationListener)
          Remove a listener added with Transport.addInvocationListener(uk.ac.soton.ecs.iam.grid.comms.client.helpers.InvocationListener).
 void setCertificateTrustValidator(CertificateTrustValidator certificateTrustValidator)
           
 void setIdentityProvider(IdentityProvider idp)
          Set the configured identity provider.
protected  void setUserAgent(String userAgent)
          Sets the User-Agent header.
protected  Runnable startInvocation(Invocation invocation, X509Certificate expectedCertificate)
          Called before invoking any remote operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.soton.itinnovation.grid.utils.Transport
invoke
 

Field Detail

idp

protected IdentityProvider idp

certificateTrustValidator

protected CertificateTrustValidator certificateTrustValidator

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

AbstractTransport

public AbstractTransport()

AbstractTransport

public AbstractTransport(IdentityProvider idp)
Method Detail

addInvocationListener

public void addInvocationListener(InvocationListener invocationListener)
Description copied from interface: Transport
Add a listener to be notified of all remote operations.

Specified by:
addInvocationListener in interface Transport

removeInvocationListener

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

Specified by:
removeInvocationListener in interface Transport

setUserAgent

protected void setUserAgent(String userAgent)
Sets the User-Agent header. This is used in fetchWSDL(java.net.URL, java.security.cert.X509Certificate) and openURL(java.net.URL).


getKeystoreLocation

@Deprecated
protected String getKeystoreLocation()
Deprecated. 


getSubjectCert

@Deprecated
public X509Certificate getSubjectCert()
Deprecated. 

Description copied from interface: Transport
Return the certificate we use for signing messages.

Specified by:
getSubjectCert in interface Transport

getIssuerCert

@Deprecated
public X509Certificate getIssuerCert()
Deprecated. 

Description copied from interface: Transport
Return the certificate of the issuer of the certificate we use for signing messages.

Specified by:
getIssuerCert in interface Transport

getPrivateKey

@Deprecated
public Key getPrivateKey()
Deprecated. 

Description copied from interface: Transport
Get the private key from the keystore.

Specified by:
getPrivateKey in interface Transport

setIdentityProvider

public void setIdentityProvider(IdentityProvider idp)
Description copied from interface: Transport
Set the configured identity provider.

Specified by:
setIdentityProvider in interface Transport

getIdentityProvider

public IdentityProvider getIdentityProvider()
Description copied from interface: Transport
Returns the configured identity provider.

Specified by:
getIdentityProvider in interface Transport

invokeService

public Object invokeService(RemoteBoundMethod method,
                            String serviceProviderRef,
                            SOAPHeaderElement[] extraHeaders,
                            Object[] argValues)
                     throws RemoteException
Throws:
RemoteException

getKeyStore

@Deprecated
public KeyStore getKeyStore()
Deprecated. 

Description copied from interface: Transport
Get the keystore, which contains a single private key.

Specified by:
getKeyStore in interface Transport
Returns:
the keystore

putURL

public void putURL(URL url,
                   org.apache.commons.httpclient.methods.RequestEntity entity,
                   org.apache.commons.httpclient.Header[] extraHeaders)
            throws IOException
Description copied from interface: Transport
Upload some data using an HTTP PUT.

Specified by:
putURL in interface Transport
Parameters:
url - the URL of the resource to overwrite
entity - the data to be uploaded
extraHeaders - extra HTTP headers to include (can be null for the empty list)
Throws:
IOException

startInvocation

protected Runnable startInvocation(Invocation invocation,
                                   X509Certificate expectedCertificate)
Called before invoking any remote operation. Sets identity and trust validator thread-locals and notify listeners.

Returns:
a callback to be invoked when the invocation is complete

getURL

public org.apache.commons.httpclient.methods.GetMethod getURL(URL url,
                                                              org.apache.commons.httpclient.Header[] extraHeaders)
                                                       throws IOException
Description copied from interface: Transport
Read a remote HTTP resource. You should call HttpMethodBase.getResponseBodyAsStream() to get a stream with the data. Make sure you call HttpMethodBase.releaseConnection() when done.

Specified by:
getURL in interface Transport
Parameters:
url - the URL of the resource
extraHeaders - extra HTTP headers to include (can be null for the empty list)
Returns:
an open GetMethod which has returned successfully
Throws:
IOException

openURL

@Deprecated
public InputStream openURL(URL url)
                    throws IOException
Deprecated. 

Description copied from interface: Transport
Fetch 'url' using the Apache commons httpclient, using our configured keystore and proxy settings. Warning: this method downloads the entire result into memory before returning, since it needs to close the connection.

Specified by:
openURL in interface Transport
Parameters:
url - the URL of the HTTP or HTTPS resource
Returns:
InputStream the response data stream (excuding headers)
Throws:
IOException

fetchWSDL

public Document fetchWSDL(URL url,
                          X509Certificate expectedCertificate)
                   throws IOException,
                          SAXException,
                          javax.wsdl.WSDLException
Description copied from interface: Transport
Download and parse a WSDL file.

Specified by:
fetchWSDL in interface Transport
Parameters:
url - the URL of the WSDL file
expectedCertificate - for https connections, the SSL certificate of the server (if known)
Returns:
a WSDL document
Throws:
IOException
SAXException
javax.wsdl.WSDLException

setCertificateTrustValidator

public void setCertificateTrustValidator(CertificateTrustValidator certificateTrustValidator)

getCertificateTrustValidator

public CertificateTrustValidator getCertificateTrustValidator()
Description copied from interface: Transport
Decides whether to trust a server's certificate. When using https, this is called to check the SSL certificate.

Specified by:
getCertificateTrustValidator in interface Transport


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