Class DiscoveryClient


  • public class DiscoveryClient
    extends Object
    The class DiscoveryClient provides methods to send Discovery Service query and modify. Note: Current implementation uses JAXB objects and no wrapper classes are used.
    • Constructor Detail

      • DiscoveryClient

        public DiscoveryClient​(String soapURI,
                               String providerID)
        Constructor, connects to Discovery Service without web service security token.
        Parameters:
        soapURI - URI of the SOAP end point for this discovery service instance
        providerID - ID of the web service client.
      • DiscoveryClient

        public DiscoveryClient​(SecurityAssertion assertion,
                               String soapURI,
                               String providerID)
        Constructor, connects to Discovery Service using WSS SAML Token.
        Parameters:
        assertion - WSS SAML Token
        soapURI - URI of the SOAP end point for this discovery service instance
        providerID - ID of the web service client.
      • DiscoveryClient

        public DiscoveryClient​(BinarySecurityToken token,
                               String soapURI,
                               String providerID)
        Constructor, connects to Discovery Service using WSS X509 Token.
        Parameters:
        token - WSS X.509 Certificate Token
        soapURI - URI of the SOAP end point for this discovery service instance.
        providerID - ID of the web service client.
      • DiscoveryClient

        public DiscoveryClient​(ResourceOffering resourceOffering,
                               Object session,
                               String providerID)
        Constructor, connects to Discovery Service specified by the resource offering, security mechanism/SOAP endpoint defined in the ResourceOffering will be used.
        Parameters:
        resourceOffering - resource offering for this discovery service instance
        session - session of the WSC
        providerID - ID of the web service client.
      • DiscoveryClient

        public DiscoveryClient​(ResourceOffering resourceOffering,
                               Object session,
                               String providerID,
                               List assertions)
        Constructor, connects to Discovery Service specified by the resource offering, security mechanism/SOAP endpoint defined in the ResourceOffering will be used.
        Parameters:
        resourceOffering - resource offering for this discovery service instance
        session - session of the WSC
        providerID - ID of the web service client.
        assertions - List of assertions.
    • Method Detail

      • setClientCert

        public void setClientCert​(String certAlias)
        Sets the alias for the client certificate. If none is set, a default client certificate will be used.
        Parameters:
        certAlias - certificate alias name
      • setClientAuthentication

        public void setClientAuthentication​(boolean value)
        Sets flag to indicate whether the connection is SSL/TLS with client authentication. When this flag is set to true, the message will not be signed according to the spec. If you want to sign the message always, do not set this flag to true, even when the connection is SSL/TLS with client authentication.
        Parameters:
        value - The flag value to be set
      • setResourceID

        public void setResourceID​(String resourceID)
        Sets the resource ID to be accessed.
        Parameters:
        resourceID - resource ID
      • setResourceID

        public void setResourceID​(EncryptedResourceID resourceID)
        Sets the encrypted resource ID to be accessed.
        Parameters:
        resourceID - encrypted resource ID.
      • setProviderID

        public void setProviderID​(String providerID)
        Sets the provider ID.
        Parameters:
        providerID - ID of the web service client.
      • getResourceOffering

        public QueryResponse getResourceOffering​(List serviceTypes)
                                          throws DiscoveryException
        Queries discovery service for ResourceOffering given list of service types.
        Parameters:
        serviceTypes - List of serviceTypes as java.lang.String to be queried
        Returns:
        Query response Element corresponding to the query
        Throws:
        DiscoveryException - if error occurs
      • getResourceOffering

        public QueryResponse getResourceOffering​(Query query)
                                          throws DiscoveryException
        Queries discovery service for resource offering.
        Parameters:
        query - discovery query object
        Returns:
        Query response Element corresponding to the query
        Throws:
        DiscoveryException - if error occurs
      • setWSFVersion

        public void setWSFVersion​(String wsfVersion)
        Sets the web services version.
        Parameters:
        wsfVersion - the web services version that should be used.