Package org.imixs.melman
Class AbstractClient
java.lang.Object
org.imixs.melman.AbstractClient
- Direct Known Subclasses:
DocumentClient,EventLogClient,ModelClient
This AbstractClient provides core functionality of a JAX Rest Client and the
feature to register authentication filters.
- Author:
- Ralph Soika
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected List<jakarta.ws.rs.client.ClientRequestFilter>protected SSLContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.imixs.workflow.ItemCollection>getCustomResource(String uri) Returns the custom data list by uri GETorg.imixs.workflow.xml.XMLDataCollectionReturns the custom data list by uri GET as a collection of XMLDocument elements.List<jakarta.ws.rs.client.ClientRequestFilter>jakarta.ws.rs.client.WebTargetgetWebTarget(String uri) Returns a WebTarget object for a given uri.voidlogout()Calls the /logout/ target of the rest api endpointjakarta.ws.rs.client.ClientThis method creates a new javax.ws.rs.client.Client instance using the default client builder implementation class provided by the JAX-RS implementation provider.voidregisterClientRequestFilter(jakarta.ws.rs.client.ClientRequestFilter filter) Register a ClientRequestFilter instance.voidsetBaseURI(String baseURI) voidsetSslContext(SSLContext sslContext)
-
Field Details
-
baseURI
-
sslContext
-
requestFilterList
-
-
Constructor Details
-
AbstractClient
Initialize the client by a BASE_URL.- Parameters:
base_uri-
-
-
Method Details
-
getSslContext
-
setSslContext
-
registerClientRequestFilter
public void registerClientRequestFilter(jakarta.ws.rs.client.ClientRequestFilter filter) Register a ClientRequestFilter instance.- Parameters:
filter- - request filter instance.
-
getRequestFilterList
-
getBaseURI
-
setBaseURI
-
newClient
public jakarta.ws.rs.client.Client newClient()This method creates a new javax.ws.rs.client.Client instance using the default client builder implementation class provided by the JAX-RS implementation provider.The method registers all known filter instances.
The client instance should be closed after the request if finished.
The method verifies if a sslContext exists. In this case a client this context will be generated
- Returns:
- javax.ws.rs.client.Client instance
-
logout
public void logout()Calls the /logout/ target of the rest api endpoint- Parameters:
client-- Throws:
RestAPIException
-
getCustomResource
public List<org.imixs.workflow.ItemCollection> getCustomResource(String uri) throws RestAPIException Returns the custom data list by uri GET- Parameters:
userid-items-- Returns:
- result list
- Throws:
RestAPIException
-
getCustomResourceXML
public org.imixs.workflow.xml.XMLDataCollection getCustomResourceXML(String uri) throws RestAPIException Returns the custom data list by uri GET as a collection of XMLDocument elements.- Parameters:
userid-items-- Returns:
- result list of XMLDocument elements
- Throws:
RestAPIException
-
getWebTarget
Returns a WebTarget object for a given uri.- Parameters:
uri-- Returns:
- WebTarget
- Throws:
RestAPIException
-