Class DiscoveryClient
- java.lang.Object
-
- com.sun.identity.liberty.ws.disco.DiscoveryClient
-
public class DiscoveryClient extends Object
The classDiscoveryClientprovides methods to send Discovery Service query and modify. Note: Current implementation usesJAXBobjects and no wrapper classes are used.
-
-
Constructor Summary
Constructors Constructor Description DiscoveryClient(BinarySecurityToken token, String soapURI, String providerID)Constructor, connects to Discovery Service usingWSS X509Token.DiscoveryClient(ResourceOffering resourceOffering, Object session, String providerID)Constructor, connects to Discovery Service specified by the resource offering, security mechanism/SOAP endpoint defined in theResourceOfferingwill be used.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 theResourceOfferingwill be used.DiscoveryClient(SecurityAssertion assertion, String soapURI, String providerID)Constructor, connects to Discovery Service usingWSSSAML Token.DiscoveryClient(String soapURI, String providerID)Constructor, connects to Discovery Service without web service security token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryResponsegetResourceOffering(Query query)Queries discovery service for resource offering.QueryResponsegetResourceOffering(List serviceTypes)Queries discovery service forResourceOfferinggiven list of service types.ModifyResponsemodify(Modify modify)Modifies discovery resource offering.voidsetClientAuthentication(boolean value)Sets flag to indicate whether the connection is SSL/TLS with client authentication.voidsetClientCert(String certAlias)Sets the alias for the client certificate.voidsetProviderID(String providerID)Sets the provider ID.voidsetResourceID(EncryptedResourceID resourceID)Sets the encrypted resource ID to be accessed.voidsetResourceID(String resourceID)Sets the resource ID to be accessed.voidsetWSFVersion(String wsfVersion)Sets the web services version.
-
-
-
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 instanceproviderID- ID of the web service client.
-
DiscoveryClient
public DiscoveryClient(SecurityAssertion assertion, String soapURI, String providerID)
Constructor, connects to Discovery Service usingWSSSAML Token.- Parameters:
assertion-WSSSAML TokensoapURI- URI of the SOAP end point for this discovery service instanceproviderID- ID of the web service client.
-
DiscoveryClient
public DiscoveryClient(BinarySecurityToken token, String soapURI, String providerID)
Constructor, connects to Discovery Service usingWSS X509Token.- Parameters:
token-WSS X.509Certificate TokensoapURI- 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 theResourceOfferingwill be used.- Parameters:
resourceOffering- resource offering for this discovery service instancesession- session of theWSCproviderID- 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 theResourceOfferingwill be used.- Parameters:
resourceOffering- resource offering for this discovery service instancesession- session of theWSCproviderID- 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 forResourceOfferinggiven list of service types.- Parameters:
serviceTypes- List ofserviceTypesasjava.lang.Stringto 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
-
modify
public ModifyResponse modify(Modify modify) throws DiscoveryException
Modifies discovery resource offering.- Parameters:
modify- List of Modify object- Returns:
- List of
ModifyResponseobject - 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.
-
-