Class 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 from ConnectorContext.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, the ConnectorCache.isValid() method should be overloaded in a fashion similar to the ExpiringConnectorCache utility class.

    • Constructor Detail

    • 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 to readWsdl(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 to readWsdl(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 by getDefinition() 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
      • 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 from getDefinition()).
      • getTargetNamespace

        public String getTargetNamespace()
        Returns the target namespace of the WSDL.