Package com.sun.identity.liberty.ws.dst
Class DSTClient
- java.lang.Object
-
- com.sun.identity.liberty.ws.dst.DSTClient
-
public class DSTClient extends Object
The classDSTClientprovides methods for Liberty Data Service Template.
-
-
Constructor Summary
Constructors Constructor Description DSTClient(BinarySecurityToken token, String soapURI, String providerID)Constructor The constructor connects to the data Service usingWSS X509Token.DSTClient(BinarySecurityToken token, String soapURI, String providerID, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)Constructor The constructor connects to Data Service withWSSSAML token, theHttpServletRequestandHttpServletResponseobject of the current request agent will be used for resource owner interactions if needed.DSTClient(ResourceOffering resourceOffering, String providerID, Object credential)Constructor Creates a data service template client instance.DSTClient(ResourceOffering resourceOffering, String providerID, Object credential, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)Contructor Creates a data service template client instance.DSTClient(SecurityAssertion assertion, String soapURI, String providerID)Constructor The constructor connects to Data Service usingWSSSAML TokenDSTClient(SecurityAssertion assertion, String soapURI, String providerID, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)Constructor The constructor connects to Data Service withWSSSAML token, theHttpServletRequestandHttpServletResponseobject of the current request agent will be used for resource owner interactions if needed.DSTClient(String soapURI, String providerID)Constructor The constructor connects to Data Service withoutWSStokenDSTClient(String soapURI, String providerID, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)Constructor The constructor connects to Data Service withoutWSStoken, theHttpServletRequestandHttpServletResponseobject of the current request agent will be used for resource owner interactions if needed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListgetData(List items)Gets data for the specified query items.ListgetModifyResponse(List modifies)Performs a list of modifications specified by a list ofDSTModifyobjects (possible on different resource ID).ListgetQueryResponse(List queries)Gets query responses for a list ofDSTqueriesServiceInstanceUpdateHeadergetServiceInstanceUpdateHeader()Gets theserviceInstanceUpdateheader from the SOAP response message.DSTModifyResponsemodify(DSTModify modify)Gets modify response for the specified modify.DSTModifyResponsemodify(List items)Gets response for a list ofDSTModifications.DSTQueryResponsequery(DSTQuery query)GetsQueryResponsefor the specified query.voidsetBinarySecurityToken(BinarySecurityToken binaryToken)Sets the binary security token.voidsetClientAuth(boolean value)Sets the client authentication.voidsetClientCert(String certAlias)Sets the alias for the client certificate if the connection is TLS/SSL with client authentication.voidsetProviderID(String providerID)Sets the provider ID.voidsetResourceID(EncryptedResourceID encResourceID)Sets the encrypted resource ID to be accessedvoidsetResourceID(String resourceID)Sets the resource ID to be accessedvoidsetSecurityAssertion(SecurityAssertion secAssertion)Sets the Security Assertion.voidsetSecurityMech(String secMech)Sets the security mechanism.voidsetSOAPAction(String action)Sets SOAP Action such as query or modifyvoidsetSOAPEndPoint(String endpoint)Sets the SOAP Endpoint.voidsetWSFVersion(String wsfVersion)Sets the web services version.
-
-
-
Constructor Detail
-
DSTClient
public DSTClient(String soapURI, String providerID)
Constructor The constructor connects to Data Service withoutWSStoken- Parameters:
soapURI- URI of the SOAP end point for this Data service instanceproviderID- ID of service provider.
-
DSTClient
public DSTClient(SecurityAssertion assertion, String soapURI, String providerID)
Constructor The constructor connects to Data Service usingWSSSAML Token- Parameters:
assertion-WSSSAML TokensoapURI- URI of the SOAP end point for this data service instanceproviderID- ID of service provider.
-
DSTClient
public DSTClient(BinarySecurityToken token, String soapURI, String providerID)
Constructor The constructor connects to the data Service usingWSS X509Token.- Parameters:
token-WSS X.509Certificate TokensoapURI- URI of the SOAP end point for this Data service instanceproviderID- ID of service provider.
-
DSTClient
public DSTClient(String soapURI, String providerID, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)
Constructor The constructor connects to Data Service withoutWSStoken, theHttpServletRequestandHttpServletResponseobject 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 instanceproviderID- ID of service provider.httpRequest-HttpServletRequestobject of current user agent request.httpResponse-HttpServletResponseobject of current user agent request.
-
DSTClient
public DSTClient(SecurityAssertion assertion, String soapURI, String providerID, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)
Constructor The constructor connects to Data Service withWSSSAML token, theHttpServletRequestandHttpServletResponseobject of the current request agent will be used for resource owner interactions if needed.- Parameters:
assertion-WSSSAML Token.soapURI- URI of the SOAP end point for this Data service instance.providerID- ID of service provider.httpRequest-HttpServletRequestobject of current user agent request.httpResponse-HttpServletResponseobject of current user agent request.
-
DSTClient
public DSTClient(BinarySecurityToken token, String soapURI, String providerID, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)
Constructor The constructor connects to Data Service withWSSSAML token, theHttpServletRequestandHttpServletResponseobject of the current request agent will be used for resource owner interactions if needed.- Parameters:
token-WSS X.509Certificate TokensoapURI- URI of the SOAP end point for this Data service instanceproviderID- ID of service provider.httpRequest-HttpServletRequestobject of current user agent request.httpResponse-HttpServletResponseobject of current user agent.
-
DSTClient
public DSTClient(ResourceOffering resourceOffering, String providerID, Object credential, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws DSTException
Contructor Creates a data service template client instance. Connects to data Service specified by the resource offering.resourceID, security mechanism and SOAP endpoint defined in theResourceOfferingwill be used.- Parameters:
resourceOffering- resource offering for this discovery service instanceproviderID- ID of this service provider.credential- Credential ofWSChttpRequest-HttpServletRequestobject of current user agent request.httpResponse-HttpServletResponseobject of current user agent.- Throws:
DSTException- if theresourceOfferingis not valid
-
DSTClient
public DSTClient(ResourceOffering resourceOffering, String providerID, Object credential) throws DSTException
Constructor Creates a data service template client instance. Connects to data Service specified by the resource offering.resourceID, security mechanism and SOAP endpoint defined in theResourceOfferingwill be used.- Parameters:
resourceOffering- resource offering for this discovery service instanceproviderID- ID of this service provider.credential- Credential ofWSC- Throws:
DSTException- if theresourceOfferingis not valid
-
-
Method Detail
-
setResourceID
public void setResourceID(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(String providerID)
Sets the provider ID.- Parameters:
providerID- Provider ID.
-
setClientCert
public void setClientCert(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(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.
-
setSOAPEndPoint
public void setSOAPEndPoint(String endpoint)
Sets the SOAP Endpoint.- Parameters:
endpoint- SOAP Endpoint.
-
setSecurityAssertion
public void setSecurityAssertion(SecurityAssertion secAssertion)
Sets the Security Assertion.- Parameters:
secAssertion- Security Assertion.
-
setBinarySecurityToken
public void setBinarySecurityToken(BinarySecurityToken binaryToken)
Sets the binary security token.- Parameters:
binaryToken- Binary Security Token.
-
setSecurityMech
public void setSecurityMech(String secMech)
Sets the security mechanism.- Parameters:
secMech- security mechanism.
-
getData
public List getData(List items) throws DSTException, InteractionRedirectException
Gets data for the specified query items.- Parameters:
items- list ofDSTQueryItemobject- Returns:
- List of
DSTDataobjects which have one-to-one correspondence to the list of query items. If no response for one of the query item, the corresponding returnDSTDataobject will be null. - Throws:
DSTException- if error occurs when trying to get dataInteractionRedirectException- if user agent is redirected to Web Service Provider (WSP) for resource owner interactions
-
query
public DSTQueryResponse query(DSTQuery query) throws DSTException, InteractionRedirectException
GetsQueryResponsefor the specified query.- Parameters:
query-DSTQueryobject.- Returns:
DSTDQueryResponseObject.- Throws:
DSTException- if error occurs when trying to get dataInteractionRedirectException- if user agent is redirected to Web Service Provider (WSP) for resource owner interactions
-
modify
public DSTModifyResponse modify(List items) throws DSTException, InteractionRedirectException
Gets response for a list ofDSTModifications.- Parameters:
items- List ofDSTModificationobjects.- Returns:
DSTModifyResponse.- Throws:
DSTException- if error occurs when trying to modify dataInteractionRedirectException- if user agent is redirected to Web Service Provider (WSP) for resource owner interactions.
-
modify
public DSTModifyResponse modify(DSTModify modify) throws DSTException, InteractionRedirectException
Gets modify response for the specified modify.- Parameters:
modify-DSTModifyobject.- Returns:
DSTModifyResponseobject.- Throws:
DSTException- if error occurs when trying to modify dataInteractionRedirectException- if user agent is redirected to Web Service Provider (WSP) for resource owner interactions
-
getQueryResponse
public List getQueryResponse(List queries) throws DSTException, InteractionRedirectException
Gets query responses for a list ofDSTqueries- Parameters:
queries- list ofDSTQueryobjects- Returns:
- List of
DSTQueryResponseobjects, corresponding to eachDSTQueryobject. - Throws:
DSTException- if error occurs when trying to get dataInteractionRedirectException- if interaction is required.
-
getModifyResponse
public List getModifyResponse(List modifies) throws DSTException, InteractionRedirectException
Performs a list of modifications specified by a list ofDSTModifyobjects (possible on different resource ID).- Parameters:
modifies- list ofDSTModifyobjects specifying resource and modifications to be made.- Returns:
- List of
DSTModifyResponseobject corresponding to eachDSTModify. - Throws:
DSTException- if error occurs when trying to modify dataInteractionRedirectException- if interaction is required.
-
getServiceInstanceUpdateHeader
public ServiceInstanceUpdateHeader getServiceInstanceUpdateHeader()
Gets theserviceInstanceUpdateheader from the SOAP response message. Applications can make use of this method to check if there is an alternate endpoint or credential available for the service requests.- Returns:
ServiceInstanceUpdateHeaderfrom the response message.
-
setWSFVersion
public void setWSFVersion(String wsfVersion)
Sets the web services version.- Parameters:
wsfVersion- the web services version that needs to be set.
-
-