Class WSCache
- java.lang.Object
-
- com.boomi.connector.util.ConnectorCache<WSCache.Key>
-
- com.boomi.connector.ws.WSCache
-
public class WSCache extends ConnectorCache<WSCache.Key>
The WSCache is used to store expensive web service information across web service connections. The cache must not store any per-connection information (information relevant to a specific operation context). Unlike most of the other classes (except for the Connector), the cache implementation must be thread-safe as it may be used concurrently by multiple connections.Using this cache and the
WSConnection.getCache()
method simplifies the cache management logic. Under the hood, this cache instance is ultimately being stored using the map returned fromConnectorContext.getConnectorCache()
. By default, this cache will live as long as the Connector instance. In order to have cache information "expire" after a certain amount of time, theConnectorCache.isValid()
method should be overloaded in a fashion similar to theExpiringConnectorCache
utility class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WSCache.Key
Key used for WSCache instances.
-
Constructor Summary
Constructors Constructor Description WSCache(WSCache.Key key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
getAuthType()
Returns the authentication type for the webservice.javax.wsdl.Definition
getDefinition()
Returns the currently parsed WSDL Definition, creating if necessary.WebServiceOperation
getOperation(String operationName, com.boomi.webservices.ProtocolHandler protocolHandler)
Returns the currently parsed WebServiceOperation for the given operation name and protocol version, loading it if necessary from the currently loaded WSDL definition (retrieved fromgetDefinition()
).protected Object
getPassword()
Returns the password for the webservice.com.boomi.webservices.SchemaMap
getSchemaMap()
Loads the schema map of the currently parsed WSDL Definition, creating if necessary.String
getTargetNamespace()
Returns the target namespace of the WSDL.protected Object
getUsername()
Returns the username for the webservice.protected String
getWsdlUrl()
Returns the wsdl url for the webservice.protected javax.wsdl.Definition
readBasicAuthWsdl(javax.wsdl.xml.WSDLReader reader)
Reads a wsdl possibly protected by http basic auth using the given WSDLReader and the available credentials.protected javax.wsdl.Definition
readWsdl(javax.wsdl.xml.WSDLReader reader)
Reads a wsdl using the given WSDLReader.-
Methods inherited from class com.boomi.connector.util.ConnectorCache
clearCache, getCache, getKey, isValid
-
-
-
-
Constructor Detail
-
WSCache
public WSCache(WSCache.Key key)
-
-
Method Detail
-
getWsdlUrl
protected String getWsdlUrl()
Returns the wsdl url for the webservice.Default implementation returns the url used as the cache key.
-
getUsername
protected Object getUsername()
Returns the username for the webservice.Default implementation returns the username used as the cache key.
-
getPassword
protected Object getPassword()
Returns the password for the webservice.Default implementation returns the password used as the cache key.
-
getAuthType
protected Object getAuthType()
Returns the authentication type for the webservice.Default implementation returns the authentication type used as the cache key.
-
getDefinition
public javax.wsdl.Definition getDefinition()
Returns the currently parsed WSDL Definition, creating if necessary. If the Definition has not yet been created, if it create via a call toreadWsdl(javax.wsdl.xml.WSDLReader)
.
-
getSchemaMap
public com.boomi.webservices.SchemaMap getSchemaMap() throws com.boomi.webservices.SchemaModelException
Loads the schema map of the currently parsed WSDL Definition, creating if necessary. If the Definition has not yet been created, if it create via a call toreadWsdl(javax.wsdl.xml.WSDLReader)
.- Throws:
com.boomi.webservices.SchemaModelException
-
readWsdl
protected javax.wsdl.Definition readWsdl(javax.wsdl.xml.WSDLReader reader) throws javax.wsdl.WSDLException, IOException
Reads a wsdl using the given WSDLReader. Called bygetDefinition()
to create a Definition when necessary.Default implementation reads the wsdl from the url returned by
getWsdlUrl()
, optionally attempting http basic auth if appropriate for the currently configured authentication type. Subclasses may need to override this method if the wsdl is available locally (packaged in the connector jar) or is behind some other sort of security barrier.- Throws:
javax.wsdl.WSDLException
IOException
-
readBasicAuthWsdl
protected javax.wsdl.Definition readBasicAuthWsdl(javax.wsdl.xml.WSDLReader reader) throws javax.wsdl.WSDLException, IOException
Reads a wsdl possibly protected by http basic auth using the given WSDLReader and the available credentials.This is called from
readWsdl(WSDLReader)
ifgetAuthType()
returnsWebServiceAuthenticationType.BASIC
.- Throws:
javax.wsdl.WSDLException
IOException
-
getOperation
public WebServiceOperation getOperation(String operationName, com.boomi.webservices.ProtocolHandler protocolHandler)
Returns the currently parsed WebServiceOperation for the given operation name and protocol version, loading it if necessary from the currently loaded WSDL definition (retrieved fromgetDefinition()
).
-
getTargetNamespace
public String getTargetNamespace()
Returns the target namespace of the WSDL.
-
-