public class OslcClient extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
OslcClient.OAuthHttpPool |
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.impl.client.DefaultHttpClient |
httpClient |
| Constructor and Description |
|---|
OslcClient()
Initialize a new OslcClient using an Apache Http Components 4 Http client and configuration.
|
OslcClient(TrustManager[] trustManagers,
org.apache.http.conn.ssl.X509HostnameVerifier hostnameVerifier)
Initialize a new OslcClient using an Apache Http Components 4 Http client and configuration.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.wink.client.ClientResponse |
createResource(String url,
Object artifact,
String mediaType)
Create (POST) an artifact to a URL - usually an OSLC Creation Factory
|
org.apache.wink.client.ClientResponse |
createResource(String url,
Object artifact,
String mediaType,
String acceptType)
Create (POST) an artifact to a URL - usually an OSLC Creation Factory
|
org.apache.wink.client.ClientResponse |
deleteResource(String url)
Delete an OSLC resource and return a Wink ClientResponse
|
protected org.apache.wink.client.ClientConfig |
getClientConfig() |
protected net.oauth.client.httpclient4.HttpClientPool |
getClientPool() |
String |
getConfiguredSecureSocketProtocol()
Sets the Secure Socket Protocol to be used, valid values "TLS","SSL","SSL_TLS".
|
org.apache.http.client.HttpClient |
getHttpClient()
Returns the HTTP client associated with this OSLC Client
|
org.apache.wink.client.Resource |
getQueryResource(OslcQuery query)
Create a Wink Resource for the given OslcQuery object
|
org.apache.wink.client.ClientResponse |
getResource(String url)
Gets an OSLC resource using
application/rdf+xml. |
org.apache.wink.client.ClientResponse |
getResource(String url,
Map<String,String> requestHeaders)
Gets an OSLC resource.
|
protected org.apache.wink.client.ClientResponse |
getResource(String url,
Map<String,String> requestHeaders,
String defaultMediaType) |
org.apache.wink.client.ClientResponse |
getResource(String url,
String mediaType)
Gets an OSLC resource.
|
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
|
void |
setConfiguredSecureSocketProtocol(String configuredSecureSocketProtocol)
Returns theSecure Sockect Protocol associated with this OSLC Client
|
org.apache.wink.client.ClientResponse |
updateResource(String url,
Object artifact,
String mediaType)
Update (PUT) an artifact to a URL - usually the URL for an existing OSLC artifact
|
org.apache.wink.client.ClientResponse |
updateResource(String url,
Object artifact,
String mediaType,
String acceptType)
Update (PUT) an artifact to a URL - usually the URL for an existing OSLC artifact
|
org.apache.wink.client.ClientResponse |
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
|
public OslcClient()
public OslcClient(TrustManager[] trustManagers, org.apache.http.conn.ssl.X509HostnameVerifier hostnameVerifier)
public String getConfiguredSecureSocketProtocol()
public void setConfiguredSecureSocketProtocol(String configuredSecureSocketProtocol)
public org.apache.http.client.HttpClient getHttpClient()
protected net.oauth.client.httpclient4.HttpClientPool getClientPool()
protected org.apache.wink.client.ClientConfig getClientConfig()
public org.apache.wink.client.ClientResponse getResource(String url) throws IOException, net.oauth.OAuthException, URISyntaxException
application/rdf+xml. Use
getResource(String, String) to specify the media type or
getResource(String, Map) to add other request headers. Call
ClientResponse.getEntity(Class) on the response to get the
OSLC4J-annotated Java object.url - the resource URLIOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionpublic org.apache.wink.client.ClientResponse getResource(String url, String mediaType) throws IOException, net.oauth.OAuthException, URISyntaxException
getResource(String, Map) instead to
add other request headers. Call ClientResponse.getEntity(Class)
on the response to get the OSLC4J-annotated Java object.url - the resource URLmediaType - the requested media type to use in the HTTP Accept request
headerIOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionpublic org.apache.wink.client.ClientResponse getResource(String url, Map<String,String> requestHeaders)
ClientResponse.getEntity(Class) on
the response to get the OSLC4J-annotated Java object.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.IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionprotected org.apache.wink.client.ClientResponse getResource(String url, Map<String,String> requestHeaders, String defaultMediaType)
public org.apache.wink.client.ClientResponse deleteResource(String url) throws IOException, net.oauth.OAuthException, URISyntaxException
url - IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionpublic org.apache.wink.client.ClientResponse createResource(String url, Object artifact, String mediaType) throws IOException, net.oauth.OAuthException, URISyntaxException
url - artifact - mediaType - URISyntaxExceptionnet.oauth.OAuthExceptionIOExceptionpublic org.apache.wink.client.ClientResponse createResource(String url, Object artifact, String mediaType, String acceptType) throws IOException, net.oauth.OAuthException, URISyntaxException
url - artifact - mediaType - acceptType - URISyntaxExceptionnet.oauth.OAuthExceptionIOExceptionpublic org.apache.wink.client.ClientResponse updateResource(String url, Object artifact, String mediaType)
url - artifact - mediaType - public org.apache.wink.client.ClientResponse updateResource(String url, Object artifact, String mediaType, String acceptType)
url - artifact - mediaType - acceptType - public org.apache.wink.client.ClientResponse updateResource(String url, Object artifact, String mediaType, String acceptType, String ifMatch) throws IOException, net.oauth.OAuthException, URISyntaxException
url - artifact - mediaType - acceptType - URISyntaxExceptionnet.oauth.OAuthExceptionIOExceptionpublic org.apache.wink.client.Resource getQueryResource(OslcQuery query)
query - public String lookupServiceProviderUrl(String catalogUrl, String serviceProviderTitle) throws IOException, net.oauth.OAuthException, URISyntaxException, ResourceNotFoundException
catalogUrl - serviceProviderTitle - IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionResourceNotFoundExceptionpublic String lookupQueryCapability(String serviceProviderUrl, String oslcDomain, String oslcResourceType) throws IOException, net.oauth.OAuthException, URISyntaxException, ResourceNotFoundException
serviceProviderUrl - oslcDomain - oslcResourceType - - the resource type of the desired query capability. This may differ from the OSLC artifact type.IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionResourceNotFoundExceptionpublic org.eclipse.lyo.oslc4j.core.model.CreationFactory lookupCreationFactoryResource(String serviceProviderUrl, String oslcDomain, String oslcResourceType) throws IOException, net.oauth.OAuthException, URISyntaxException, ResourceNotFoundException
IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionResourceNotFoundExceptionpublic org.eclipse.lyo.oslc4j.core.model.CreationFactory lookupCreationFactoryResource(String serviceProviderUrl, String oslcDomain, String oslcResourceType, String oslcUsage) throws IOException, net.oauth.OAuthException, URISyntaxException, ResourceNotFoundException
IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionResourceNotFoundExceptionpublic String lookupCreationFactory(String serviceProviderUrl, String oslcDomain, String oslcResourceType) throws IOException, net.oauth.OAuthException, URISyntaxException, ResourceNotFoundException
serviceProviderUrl - oslcDomain - oslcResourceType - - the resource type of the desired query capability. This may differ from the OSLC artifact type.IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionResourceNotFoundExceptionpublic String lookupCreationFactory(String serviceProviderUrl, String oslcDomain, String oslcResourceType, String oslcUsage) throws IOException, net.oauth.OAuthException, URISyntaxException, ResourceNotFoundException
serviceProviderUrl - oslcDomain - oslcResourceType - - the resource type of the desired query capability. This may differ from the OSLC artifact type.IOExceptionnet.oauth.OAuthExceptionURISyntaxExceptionResourceNotFoundExceptionCopyright © 2016. All Rights Reserved.