com.sun.identity.liberty.ws.dst
Class DSTClient

java.lang.Object
  |
  +--com.sun.identity.liberty.ws.dst.DSTClient

public class DSTClient
extends java.lang.Object

The class DSTClient provides methods for Liberty Data Service Template.


Constructor Summary
DSTClient(BinarySecurityToken token, java.lang.String soapURI, java.lang.String providerID)
          Constructor, connects to the data Service using WSS X509 Token
DSTClient(BinarySecurityToken token, java.lang.String soapURI, java.lang.String providerID, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
          Constructor, connects to Data Service with WSS SAML token, the HttpServletRequest and HttpServletResponse object of the current request agent will be used for resource owner interactions if needed.
DSTClient(ResourceOffering resourceOffering, java.lang.String providerID, SSOToken ssoToken)
          Creates a data service template client instance.
DSTClient(SecurityAssertion assertion, java.lang.String soapURI, java.lang.String providerID)
          Constructor, connects to Data Service using WSS SAML Token
DSTClient(SecurityAssertion assertion, java.lang.String soapURI, java.lang.String providerID, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
          Constructor, connects to Data Service with WSS SAML token, the HttpServletRequest and HttpServletResponse object of the current request agent will be used for resource owner interactions if needed.
DSTClient(java.lang.String soapURI, java.lang.String providerID)
          Constructor, connects to Data Service without WSS token
DSTClient(java.lang.String soapURI, java.lang.String providerID, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
          Constructor, connects to Data Service without WSS token, the HttpServletRequest and HttpServletResponse object of the current request agent will be used for resource owner interactions if needed.
 
Method Summary
 java.util.List getData(java.util.List items)
          Gets data for the specified query items.
 java.util.List getModifyResponse(java.util.List modifies)
          Performs a list of modifications specified by a list of DSTModify objects (possible on different resource ID).
 java.util.List getQueryResponse(java.util.List queries)
          Gets query responses for a list of DST queries
 DSTModifyResponse modify(DSTModify modify)
          Get modify response for the specified modify.
 DSTModifyResponse modify(java.util.List items)
          Gets response for a list of DST Modifications.
 DSTQueryResponse query(DSTQuery query)
          Gets QueryResponse for the specified query.
 void setClientAuth(boolean value)
          Sets the client authentication.
 void setClientCert(java.lang.String certAlias)
          Sets the alias for the client certificate if the connection is TLS/SSL with client authentication.
 void setProviderID(java.lang.String providerID)
          Sets the provider ID.
 void setResourceID(EncryptedResourceID encResourceID)
          Sets the encrypted resource ID to be accessed
 void setResourceID(java.lang.String resourceID)
          Sets the resource ID to be accessed
 void setSOAPAction(java.lang.String action)
          Sets SOAP Action such as query or modify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSTClient

public DSTClient(java.lang.String soapURI,
                 java.lang.String providerID)
Constructor, connects to Data Service without WSS token
Parameters:
soapURI - URI of the SOAP end point for this Data service instance
providerID - ID of service provider.

DSTClient

public DSTClient(SecurityAssertion assertion,
                 java.lang.String soapURI,
                 java.lang.String providerID)
Constructor, connects to Data Service using WSS SAML Token
Parameters:
assertion - WSS SAML Token
soapURI - URI of the SOAP end point for this data service instance
providerID - ID of service provider.

DSTClient

public DSTClient(BinarySecurityToken token,
                 java.lang.String soapURI,
                 java.lang.String providerID)
Constructor, connects to the data Service using WSS X509 Token
Parameters:
token - WSS X.509 Certificate Token
soapURI - URI of the SOAP end point for this Data service instance
providerID - ID of service provider.

DSTClient

public DSTClient(java.lang.String soapURI,
                 java.lang.String providerID,
                 javax.servlet.http.HttpServletRequest httpRequest,
                 javax.servlet.http.HttpServletResponse httpResponse)
Constructor, connects to Data Service without WSS token, the HttpServletRequest and HttpServletResponse object of the current request agent will be used for resource owner interactions if needed.
Parameters:
soapURI - URI of the SOAP end point for this Data service instance
providerID - ID of service provider.
httpRequest - HttpServletRequest object of current user agent request.
httpResponse - HttpServletResponse object of current user agent request.

DSTClient

public DSTClient(SecurityAssertion assertion,
                 java.lang.String soapURI,
                 java.lang.String providerID,
                 javax.servlet.http.HttpServletRequest httpRequest,
                 javax.servlet.http.HttpServletResponse httpResponse)
Constructor, connects to Data Service with WSS SAML token, the HttpServletRequest and HttpServletResponse object of the current request agent will be used for resource owner interactions if needed.
Parameters:
assertion - WSS SAML Token.
soapURI - URI of the SOAP end point for this Data service instance.
providerID - ID of service provider.
httpRequest - HttpServletRequest object of current user agent request.
httpResponse - HttpServletResponse object of current user agent request.

DSTClient

public DSTClient(BinarySecurityToken token,
                 java.lang.String soapURI,
                 java.lang.String providerID,
                 javax.servlet.http.HttpServletRequest httpRequest,
                 javax.servlet.http.HttpServletResponse httpResponse)
Constructor, connects to Data Service with WSS SAML token, the HttpServletRequest and HttpServletResponse object of the current request agent will be used for resource owner interactions if needed.
Parameters:
token - WSS X.509 Certificate Token
soapURI - URI of the SOAP end point for this Data service instance
providerID - ID of service provider.
httpRequest - HttpServletRequest object of current user agent request.
httpResponse - HttpServletResponse object of current user agent.

DSTClient

public DSTClient(ResourceOffering resourceOffering,
                 java.lang.String providerID,
                 SSOToken ssoToken)
          throws DSTException
Creates a data service template client instance. Connects to data Service specified by the resource offering. resourceID, security mechanism and SOAP endpoint defined in the ResourceOffering will be used.
Parameters:
resourceOffering - resource offering for this discovery service instance
providerID - ID of this service provider.
ssoToken - Credential of WSC
Throws:
DSTException - if the resourceOffering is not valid
Method Detail

setResourceID

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

setResourceID

public void setResourceID(EncryptedResourceID encResourceID)
Sets the encrypted resource ID to be accessed
Parameters:
encResourceID - encrypted resource ID

setProviderID

public void setProviderID(java.lang.String providerID)
Sets the provider ID.
Parameters:
providerID - Provider ID.

setClientCert

public void setClientCert(java.lang.String certAlias)
Sets the alias for the client certificate if the connection is TLS/SSL with client authentication.
Parameters:
certAlias - certificate alias name

setSOAPAction

public void setSOAPAction(java.lang.String action)
Sets SOAP Action such as query or modify
Parameters:
action - action for this soap request

setClientAuth

public void setClientAuth(boolean value)
Sets the client authentication.
Parameters:
value - true value to enable client authentication.

getData

public java.util.List getData(java.util.List items)
                       throws DSTException,
                              InteractionRedirectException
Gets data for the specified query items.
Parameters:
items - list of DSTQueryItem object
Returns:
List of DSTData objects which have one-to-one correspondence to the list of query items. If no response for one of the query item, the corresponding return DSTData object will be null.
Throws:
DSTException - if error occurs when trying to get data
InteractionRedirectException - if user agent is redirected to Web Service Provider (WSP) for resource owner interactions

query

public DSTQueryResponse query(DSTQuery query)
                       throws DSTException,
                              InteractionRedirectException
Gets QueryResponse for the specified query.
Parameters:
query - DSTQuery object.
Returns:
DSTDQueryResponse Object.
Throws:
DSTException - if error occurs when trying to get data
InteractionRedirectException - if user agent is redirected to Web Service Provider (WSP) for resource owner interactions

modify

public DSTModifyResponse modify(java.util.List items)
                         throws DSTException,
                                InteractionRedirectException
Gets response for a list of DST Modifications.
Parameters:
items - List of DSTModification objects.
Returns:
DSTModifyResponse.
Throws:
DSTException - if error occurs when trying to modify data
InteractionRedirectException - if user agent is redirected to Web Service Provider (WSP) for resource owner interactions.

modify

public DSTModifyResponse modify(DSTModify modify)
                         throws DSTException,
                                InteractionRedirectException
Get modify response for the specified modify.
Parameters:
modify - DSTModify object.
Returns:
DSTModifyResponse object.
Throws:
DSTException - if error occurs when trying to modify data
InteractionRedirectException - if user agent is redirected to Web Service Provider (WSP) for resource owner interactions

getQueryResponse

public java.util.List getQueryResponse(java.util.List queries)
                                throws DSTException,
                                       InteractionRedirectException
Gets query responses for a list of DST queries
Parameters:
queries - list of DSTQuery objects
Returns:
List of DSTQueryResponse objects, corresponding to each DSTQuery object.
Throws:
DSTException - if error occurs when trying to get data
InteractionRedirectException - if interaction is required.

getModifyResponse

public java.util.List getModifyResponse(java.util.List modifies)
                                 throws DSTException,
                                        InteractionRedirectException
Performs a list of modifications specified by a list of DSTModify objects (possible on different resource ID).
Parameters:
modifies - list of DSTModify objects specifying resource and modifications to be made.
Returns:
List of DSTModifyResponse object corresponding to each DSTModify.
Throws:
DSTException - if error occurs when trying to modify data
InteractionRedirectException - if interaction is required.