public class OslcClient extends Object implements IOslcClient
Constructor and Description |
---|
OslcClient()
A simple OslcClient that provides http access to unprotected resources
|
OslcClient(javax.ws.rs.client.ClientBuilder clientBuilder)
An OslcClient that allows client applications to provide a configured (but not built)
ClientBuilder typically used for supporting https, and various kinds of authentication.
|
OslcClient(javax.ws.rs.client.ClientBuilder clientBuilder,
String version)
An OslcClient that allows client applications to provide a configured (but not built)
ClientBuilder typically used for supporting https, and various kinds of authentication.
|
OslcClient(String version) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createResource(String url,
Object artifact,
String mediaType)
Create (POST) an artifact to a URL - usually an OSLC Creation Factory
|
javax.ws.rs.core.Response |
createResource(String url,
Object artifact,
String mediaType,
String acceptType)
Create (POST) an artifact to a URL - usually an OSLC Creation Factory
|
javax.ws.rs.core.Response |
createResource(String url,
Object artifact,
String mediaType,
String acceptType,
String configurationContext) |
javax.ws.rs.core.Response |
deleteResource(String url)
Delete an OSLC resource and return a Wink ClientResponse
|
javax.ws.rs.core.Response |
deleteResource(String url,
String configurationContext) |
javax.ws.rs.client.Client |
getClient()
Returns the JAX-RS client for this OslcClient.
|
<T> T |
getResource(org.eclipse.lyo.oslc4j.core.model.Link link,
Class<T> clazz)
Gets an OSLC resource from a URI in a given Link and unwraps a corresponding entity.
|
javax.ws.rs.core.Response |
getResource(String url)
Gets an OSLC resource using
application/rdf+xml . |
<T> T |
getResource(String link,
Class<T> clazz)
Gets an OSLC resource from a given URI string and unwraps a corresponding entity.
|
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders)
Gets an OSLC resource.
|
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders,
String defaultMediaType) |
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders,
String defaultMediaType,
boolean handleRedirects) |
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders,
String defaultMediaType,
String configurationContext) |
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders,
String defaultMediaType,
String configurationContext,
boolean handleRedirects) |
javax.ws.rs.core.Response |
getResource(String url,
String mediaType)
Gets an OSLC resource.
|
<T> T |
getResource(URI link,
Class<T> clazz)
Gets an OSLC resource from a given URI and unwraps a corresponding entity.
|
<T> List<T> |
getResources(Collection<URI> links,
Class<T> clazz)
Gets OSLC resources in parallel from a collection of URIs and unwraps their corresponding entities.
|
<T> List<T> |
getResources(URI[] links,
Class<T> clazz)
Gets OSLC resources in parallel from an array of URIs and unwraps their corresponding entities.
|
<T> List<T> |
getResourcesFromLinks(Collection<org.eclipse.lyo.oslc4j.core.model.Link> links,
Class<T> clazz)
Gets OSLC resources in parallel from a set of Links and unwraps their corresponding entities.
|
javax.ws.rs.client.WebTarget |
getWebResource(String capabilityUri)
Create a Wink Resource for the given OslcQuery object
|
String |
lookupCreationFactory(String serviceProviderUrl,
String oslcDomain,
String oslcResourceType)
Find the OSLC Creation Factory URL for a given OSLC resource type.
|
String |
lookupCreationFactory(String serviceProviderUrl,
String oslcDomain,
String oslcResourceType,
String oslcUsage)
Find the OSLC Creation Factory URL for a given OSLC resource type and OSLC usage.
|
org.eclipse.lyo.oslc4j.core.model.CreationFactory |
lookupCreationFactoryResource(String serviceProviderUrl,
String oslcDomain,
String oslcResourceType) |
org.eclipse.lyo.oslc4j.core.model.CreationFactory |
lookupCreationFactoryResource(String serviceProviderUrl,
String oslcDomain,
String oslcResourceType,
String oslcUsage) |
String |
lookupQueryCapability(String serviceProviderUrl,
String oslcDomain,
String oslcResourceType)
Find the OSLC Query Capability URL for a given OSLC resource type.
|
String |
lookupServiceProviderUrl(String catalogUrl,
String serviceProviderTitle)
Lookup the URL of a specific OSLC Service Provider in an OSLC Catalog using the service provider's title
|
javax.ws.rs.core.Response |
updateResource(String url,
Object artifact,
String mediaType)
Update (PUT) an artifact to a URL - usually the URL for an existing OSLC artifact
|
javax.ws.rs.core.Response |
updateResource(String url,
Object artifact,
String mediaType,
String acceptType)
Update (PUT) an artifact to a URL - usually the URL for an existing OSLC artifact
|
javax.ws.rs.core.Response |
updateResource(String url,
Object artifact,
String mediaType,
String acceptType,
String ifMatch)
Update (PUT) an artifact to a URL - usually the URL for an existing OSLC artifact
|
javax.ws.rs.core.Response |
updateResource(String url,
Object artifact,
String mediaType,
String acceptType,
String ifMatch,
String configurationContext) |
public OslcClient()
public OslcClient(String version)
version
- OSLC version, see OSLCConstants
public OslcClient(javax.ws.rs.client.ClientBuilder clientBuilder)
clientBuilder
- HTTP client configurationpublic OslcClient(javax.ws.rs.client.ClientBuilder clientBuilder, String version)
clientBuilder
- HTTP client configurationversion
- OSLC version, see OSLCConstants
public javax.ws.rs.client.Client getClient()
getClient
in interface IOslcClient
public <T> T getResource(String link, Class<T> clazz)
public <T> T getResource(URI link, Class<T> clazz)
public <T> T getResource(org.eclipse.lyo.oslc4j.core.model.Link link, Class<T> clazz)
public <T> List<T> getResources(URI[] links, Class<T> clazz)
public <T> List<T> getResources(Collection<URI> links, Class<T> clazz)
public <T> List<T> getResourcesFromLinks(Collection<org.eclipse.lyo.oslc4j.core.model.Link> links, Class<T> clazz)
Method renamed due to type erasure in Java
public javax.ws.rs.core.Response getResource(String url)
application/rdf+xml
. Use
getResource(String, String)
to specify the media type or
getResource(String, Map)
to add other request headers.getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, String mediaType)
getResource(String, Map)
instead to
add other request headers.getResource
in interface IOslcClient
url
- the resource URLmediaType
- the requested media type to use in the HTTP Accept request
headerpublic javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders)
getResource
in interface IOslcClient
url
- the resource URLrequestHeaders
- the HTTP request headers to use. If the Accept
header is not in the map, it defaults to
application/rdf+xml
. If
OSLC-Core-Version
is not in the map, it defaults
to 2.0
.public javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders, String defaultMediaType)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders, String defaultMediaType, String configurationContext)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders, String defaultMediaType, boolean handleRedirects)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders, String defaultMediaType, String configurationContext, boolean handleRedirects)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response deleteResource(String url)
deleteResource
in interface IOslcClient
url
- public javax.ws.rs.core.Response deleteResource(String url, String configurationContext)
deleteResource
in interface IOslcClient
public javax.ws.rs.core.Response createResource(String url, Object artifact, String mediaType)
createResource
in interface IOslcClient
public javax.ws.rs.core.Response createResource(String url, Object artifact, String mediaType, String acceptType)
createResource
in interface IOslcClient
public javax.ws.rs.core.Response createResource(String url, Object artifact, String mediaType, String acceptType, String configurationContext)
createResource
in interface IOslcClient
public javax.ws.rs.core.Response updateResource(String url, Object artifact, String mediaType)
updateResource
in interface IOslcClient
public javax.ws.rs.core.Response updateResource(String url, Object artifact, String mediaType, String acceptType)
updateResource
in interface IOslcClient
public javax.ws.rs.core.Response updateResource(String url, Object artifact, String mediaType, String acceptType, String ifMatch)
updateResource
in interface IOslcClient
public javax.ws.rs.core.Response updateResource(String url, Object artifact, String mediaType, String acceptType, String ifMatch, String configurationContext)
updateResource
in interface IOslcClient
public javax.ws.rs.client.WebTarget getWebResource(String capabilityUri)
public String lookupServiceProviderUrl(String catalogUrl, String serviceProviderTitle) throws IOException, URISyntaxException, org.eclipse.lyo.client.exception.ResourceNotFoundException
IOException
URISyntaxException
org.eclipse.lyo.client.exception.ResourceNotFoundException
public String lookupQueryCapability(String serviceProviderUrl, String oslcDomain, String oslcResourceType) throws IOException, URISyntaxException, org.eclipse.lyo.client.exception.ResourceNotFoundException
oslcResourceType
- - the resource type of the desired query capability. This may differ from the OSLC artifact type.IOException
URISyntaxException
org.eclipse.lyo.client.exception.ResourceNotFoundException
public org.eclipse.lyo.oslc4j.core.model.CreationFactory lookupCreationFactoryResource(String serviceProviderUrl, String oslcDomain, String oslcResourceType) throws IOException, URISyntaxException, org.eclipse.lyo.client.exception.ResourceNotFoundException
IOException
URISyntaxException
org.eclipse.lyo.client.exception.ResourceNotFoundException
public org.eclipse.lyo.oslc4j.core.model.CreationFactory lookupCreationFactoryResource(String serviceProviderUrl, String oslcDomain, String oslcResourceType, String oslcUsage) throws IOException, URISyntaxException, org.eclipse.lyo.client.exception.ResourceNotFoundException
IOException
URISyntaxException
org.eclipse.lyo.client.exception.ResourceNotFoundException
public String lookupCreationFactory(String serviceProviderUrl, String oslcDomain, String oslcResourceType) throws IOException, URISyntaxException, org.eclipse.lyo.client.exception.ResourceNotFoundException
oslcResourceType
- - the resource type of the desired query capability. This may differ from the OSLC artifact type.IOException
URISyntaxException
org.eclipse.lyo.client.exception.ResourceNotFoundException
public String lookupCreationFactory(String serviceProviderUrl, String oslcDomain, String oslcResourceType, String oslcUsage) throws IOException, URISyntaxException, org.eclipse.lyo.client.exception.ResourceNotFoundException
oslcResourceType
- - the resource type of the desired query capability. This may differ from the OSLC artifact type.IOException
URISyntaxException
org.eclipse.lyo.client.exception.ResourceNotFoundException
Copyright © 2020. All rights reserved.