public class OslcOAuthClient extends Object implements IOslcClient
Constructor and Description |
---|
OslcOAuthClient(net.oauth.OAuthAccessor accessor,
String realm,
javax.ws.rs.client.ClientBuilder clientBuilder,
UnderlyingHttpClient underlyingHttpClient)
Initialize an OAuthClient with the required OAuth URLs
|
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.
|
OslcClient |
getOslcClient() |
javax.ws.rs.core.Response |
getResource(String url)
Gets an OSLC resource using
application/rdf+xml . |
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 mediaType) |
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders,
String mediaType,
boolean handleRedirects) |
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders,
String mediaType,
String configurationContext) |
javax.ws.rs.core.Response |
getResource(String url,
Map<String,String> requestHeaders,
String mediaType,
String configurationContext,
boolean handleRedirects) |
javax.ws.rs.core.Response |
getResource(String url,
String mediaType)
Gets an OSLC resource.
|
Optional<String> |
performOAuthNegotiation(String callbackURL)
Performs necessary OAuth negotiation.
|
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 OslcOAuthClient(net.oauth.OAuthAccessor accessor, String realm, javax.ws.rs.client.ClientBuilder clientBuilder, UnderlyingHttpClient underlyingHttpClient)
requestTokenURL
- authorizationTokenURL
- accessTokenURL
- consumerKey
- consumerSecret
- public OslcClient getOslcClient()
public Optional<String> performOAuthNegotiation(String callbackURL) throws IOException, net.oauth.OAuthException, URISyntaxException
callbackURL
- IOException
net.oauth.OAuthException
URISyntaxException
public javax.ws.rs.client.Client getClient()
IOslcClient
getClient
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url)
IOslcClient
application/rdf+xml
. Use
IOslcClient.getResource(String, String)
to specify the media type or
IOslcClient.getResource(String, Map)
to add other request headers.getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, String mediaType)
IOslcClient
IOslcClient.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)
IOslcClient
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 mediaType)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders, String mediaType, String configurationContext)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders, String mediaType, boolean handleRedirects)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response getResource(String url, Map<String,String> requestHeaders, String mediaType, String configurationContext, boolean handleRedirects)
getResource
in interface IOslcClient
public javax.ws.rs.core.Response deleteResource(String url)
IOslcClient
deleteResource
in interface IOslcClient
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)
IOslcClient
createResource
in interface IOslcClient
public javax.ws.rs.core.Response createResource(String url, Object artifact, String mediaType, String acceptType)
IOslcClient
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)
IOslcClient
updateResource
in interface IOslcClient
public javax.ws.rs.core.Response updateResource(String url, Object artifact, String mediaType, String acceptType)
IOslcClient
updateResource
in interface IOslcClient
public javax.ws.rs.core.Response updateResource(String url, Object artifact, String mediaType, String acceptType, String ifMatch)
IOslcClient
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
Copyright © 2020. All rights reserved.