- java.lang.Object
-
- cool.pandora.ldpclient.LdpClientImpl
-
-
Constructor Summary
Constructors Constructor Description LdpClientImpl()LdpClientImpl(SSLContext sslContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asyncGetBytesWithQuery(String query, String contentType)StringasyncGetQuery(String query, String contentType)voidasyncPut(IRI identifier, InputStream stream)voiddelete(IRI identifier)Map<String,List<String>>getAcceptDatetime(IRI identifier, String timestamp)StringgetAcl(IRI identifier, String contentType)byte[]getBinary(IRI identifier)PathgetBinary(IRI identifier, Path file)StringgetBinaryDigest(IRI identifier, String algorithm)byte[]getBinaryVersion(IRI identifier, String timestamp)PathgetBinaryVersion(IRI identifier, Path file, String timestamp)byte[]getBytesWithMetadata(IRI identifier, Map<String,String> metadata)byte[]getBytesWithQuery(String query, String contentType)Map<String,List<String>>getCORS(IRI identifier, IRI origin)Map<String,List<String>>getCORSSimple(IRI identifier, IRI origin)StringgetDefaultType(IRI identifier)StringgetJson(IRI identifier)StringgetJsonLDF(IRI identifier, String subject, String predicate, String object)StringgetJsonProfile(IRI identifier, String profile)StringgetJsonProfileLDF(IRI identifier, String profile, String subject, String predicate, String object)StringgetPrefer(IRI identifier, String prefer)StringgetPreferMinimal(IRI identifier)StringgetPreferServerManaged(IRI identifier)StringgetQuery(String query, String contentType)byte[]getRange(IRI identifier, String byterange)Map<String,Map<String,List<String>>>getResponse(IRI identifier, Map<String,String> metadata)StringgetTimeMapJsonProfile(IRI identifier, String profile)StringgetTimeMapLinkDefaultFormat(IRI identifier)StringgetVersionJson(IRI identifier, String profile, String timestamp)StringgetWithContentType(IRI identifier, String contentType)StringgetWithMetadata(IRI identifier, Map<String,String> metadata)Map<String,List<String>>head(IRI identifier)voidmultipartDelete(IRI identifier, String sessionId)voidmultipartGet(IRI identifier, String sessionId)voidmultipartOptions(IRI identifier)voidmultipartPost(IRI identifier, InputStream stream, String sessionId)voidmultipartPut(IRI identifier, InputStream stream, String sessionId)voidmultipartStart(IRI identifier, InputStream stream)voidnewLdpDc(IRI identifier, String slug, IRI membershipObj)voidnewLdpDcWithAuth(IRI identifier, String slug, IRI membershipObj, String authorization)Map<String,List<String>>options(IRI identifier)voidpatch(IRI identifier, InputStream stream)voidpost(IRI identifier, InputStream stream, String contentType)voidpostBinaryWithDigest(IRI identifier, InputStream stream, String contentType, String digest)voidpostSlug(IRI identifier, String slug, InputStream stream, String contentType)voidpostWithAuth(IRI identifier, InputStream stream, String contentType, String authorization)voidpostWithMetadata(IRI identifier, InputStream stream, Map<String,String> metadata)voidput(IRI identifier, InputStream stream, String contentType)voidputBinaryWithDigest(IRI identifier, InputStream stream, String contentType, String digest)voidputIfMatch(IRI identifier, InputStream stream, String contentType, String etag)voidputIfUnmodified(IRI identifier, InputStream stream, String contentType, String time)voidputWithAuth(IRI identifier, InputStream stream, String contentType, String authorization)voidputWithMetadata(IRI identifier, InputStream stream, Map<String,String> metadata)StringsyncUpdate(IRI identifier, String query)
-
-
-
Constructor Detail
-
LdpClientImpl
public LdpClientImpl()
-
LdpClientImpl
public LdpClientImpl(SSLContext sslContext)
- Parameters:
sslContext- anSSLContext
-
-
Method Detail
-
head
public Map<String,List<String>> head(IRI identifier) throws LdpClientException
- Specified by:
headin interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- Map of headers
- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getJson
public String getJson(IRI identifier) throws LdpClientException
- Specified by:
getJsonin interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getDefaultType
public String getDefaultType(IRI identifier) throws LdpClientException
- Specified by:
getDefaultTypein interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getWithContentType
public String getWithContentType(IRI identifier, String contentType) throws LdpClientException
- Specified by:
getWithContentTypein interfaceLdpClient- Parameters:
identifier- a resource identifiercontentType- a content type (text/turtle, application/n-triples or application/ld+json)- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getAcceptDatetime
public Map<String,List<String>> getAcceptDatetime(IRI identifier, String timestamp) throws LdpClientException
- Specified by:
getAcceptDatetimein interfaceLdpClient- Parameters:
identifier- a resource identifiertimestamp- an epoch millisecond- Returns:
- headers as a
Map - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getTimeMapLinkDefaultFormat
public String getTimeMapLinkDefaultFormat(IRI identifier) throws LdpClientException
- Specified by:
getTimeMapLinkDefaultFormatin interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getTimeMapJsonProfile
public String getTimeMapJsonProfile(IRI identifier, String profile) throws LdpClientException
- Specified by:
getTimeMapJsonProfilein interfaceLdpClient- Parameters:
identifier- a resource identifierprofile- a JSON-LD profile- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException- See Also:
- The JSON-LD Vocabulary
-
getVersionJson
public String getVersionJson(IRI identifier, String profile, String timestamp) throws LdpClientException
- Specified by:
getVersionJsonin interfaceLdpClient- Parameters:
identifier- a resource identifierprofile- a JSON-LD profiletimestamp- an epoch millisecond- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException- See Also:
- The JSON-LD Vocabulary
-
getBinary
public Path getBinary(IRI identifier, Path file) throws LdpClientException
- Specified by:
getBinaryin interfaceLdpClient- Parameters:
identifier- a resource identifierfile- an output file as anPath- Returns:
- body as a
Path - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getBinary
public byte[] getBinary(IRI identifier) throws LdpClientException
- Specified by:
getBinaryin interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- body as a byte[]
- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getBinaryDigest
public String getBinaryDigest(IRI identifier, String algorithm) throws LdpClientException
- Specified by:
getBinaryDigestin interfaceLdpClient- Parameters:
identifier- a resource identifieralgorithm- a digest algorithm (md5, sha, sha-256 or sha-512)- Returns:
- digest as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getBinaryVersion
public Path getBinaryVersion(IRI identifier, Path file, String timestamp) throws LdpClientException
- Specified by:
getBinaryVersionin interfaceLdpClient- Parameters:
identifier- a resource identifierfile- an output file as anPathtimestamp- an epoch millisecond- Returns:
- body as a
Path - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getBinaryVersion
public byte[] getBinaryVersion(IRI identifier, String timestamp) throws LdpClientException
- Specified by:
getBinaryVersionin interfaceLdpClient- Parameters:
identifier- a resource identifiertimestamp- an epoch millisecond- Returns:
- body as a byte[]
- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getRange
public byte[] getRange(IRI identifier, String byterange) throws LdpClientException
- Specified by:
getRangein interfaceLdpClient- Parameters:
identifier- a resource identifierbyterange- a byterange- Returns:
- body as a byte[]
- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getPrefer
public String getPrefer(IRI identifier, String prefer) throws LdpClientException
- Specified by:
getPreferin interfaceLdpClient- Parameters:
identifier- a resource identifierprefer- an LDP preference- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException- See Also:
- 7.2 Preferences on the Prefer Request Header
-
getPreferServerManaged
public String getPreferServerManaged(IRI identifier) throws LdpClientException
- Specified by:
getPreferServerManagedin interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getPreferMinimal
public String getPreferMinimal(IRI identifier) throws LdpClientException
- Specified by:
getPreferMinimalin interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getJsonProfile
public String getJsonProfile(IRI identifier, String profile) throws LdpClientException
- Specified by:
getJsonProfilein interfaceLdpClient- Parameters:
identifier- a resource identifierprofile- a JSON-LD profile- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException- See Also:
- The JSON-LD Vocabulary
-
getJsonProfileLDF
public String getJsonProfileLDF(IRI identifier, String profile, String subject, String predicate, String object) throws LdpClientException
- Specified by:
getJsonProfileLDFin interfaceLdpClient- Parameters:
identifier- a resource identifierprofile- a JSON-LD profilesubject- RdfTerm as aStringpredicate- RdfTerm as aStringobject- RdfTerm as aString- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException- See Also:
- The JSON-LD Vocabulary
-
getJsonLDF
public String getJsonLDF(IRI identifier, String subject, String predicate, String object) throws LdpClientException
- Specified by:
getJsonLDFin interfaceLdpClient- Parameters:
identifier- a resource identifiersubject- RdfTerm as aStringpredicate- RdfTerm as aStringobject- RdfTerm as aString- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getAcl
public String getAcl(IRI identifier, String contentType) throws LdpClientException
- Specified by:
getAclin interfaceLdpClient- Parameters:
identifier- a resource identifiercontentType- a content type asString- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getCORS
public Map<String,List<String>> getCORS(IRI identifier, IRI origin) throws LdpClientException
- Specified by:
getCORSin interfaceLdpClient- Parameters:
identifier- a resource identifierorigin- a root resource identifier- Returns:
- headers as a
Map - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getCORSSimple
public Map<String,List<String>> getCORSSimple(IRI identifier, IRI origin) throws LdpClientException
- Specified by:
getCORSSimplein interfaceLdpClient- Parameters:
identifier- a resource identifierorigin- a root resource identifier- Returns:
- headers as a
Map - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getWithMetadata
public String getWithMetadata(IRI identifier, Map<String,String> metadata) throws LdpClientException
- Specified by:
getWithMetadatain interfaceLdpClient- Parameters:
identifier- a resource identifiermetadata- aMapof headers- Returns:
- body as a
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getBytesWithMetadata
public byte[] getBytesWithMetadata(IRI identifier, Map<String,String> metadata) throws LdpClientException
- Specified by:
getBytesWithMetadatain interfaceLdpClient- Parameters:
identifier- a resource identifiermetadata- aMapof headers- Returns:
- body as a byte[]
- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getResponse
public Map<String,Map<String,List<String>>> getResponse(IRI identifier, Map<String,String> metadata) throws LdpClientException
- Specified by:
getResponsein interfaceLdpClient- Parameters:
identifier- a resource identifiermetadata- aMapof headers- Returns:
- body and headers as a
Map - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
options
public Map<String,List<String>> options(IRI identifier) throws LdpClientException
- Specified by:
optionsin interfaceLdpClient- Parameters:
identifier- a resource identifier- Returns:
- headers as a
Map - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
post
public void post(IRI identifier, InputStream stream, String contentType) throws LdpClientException
- Specified by:
postin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content type- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
postWithMetadata
public void postWithMetadata(IRI identifier, InputStream stream, Map<String,String> metadata) throws LdpClientException
- Specified by:
postWithMetadatain interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreammetadata- aMapof headers- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
postWithAuth
public void postWithAuth(IRI identifier, InputStream stream, String contentType, String authorization) throws LdpClientException
- Specified by:
postWithAuthin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content typeauthorization- an authorization token- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
postSlug
public void postSlug(IRI identifier, String slug, InputStream stream, String contentType) throws LdpClientException
- Specified by:
postSlugin interfaceLdpClient- Parameters:
identifier- a resource identifierslug- a resource name as aStringstream- anInputStreamcontentType- a content type- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
postBinaryWithDigest
public void postBinaryWithDigest(IRI identifier, InputStream stream, String contentType, String digest) throws LdpClientException
- Specified by:
postBinaryWithDigestin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content typedigest- a digest as aString- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException- See Also:
- rfc3230 4.3.2 Digest
-
newLdpDc
public void newLdpDc(IRI identifier, String slug, IRI membershipObj) throws LdpClientException
- Specified by:
newLdpDcin interfaceLdpClient- Parameters:
identifier- a resource identifierslug- a resource name as aStringmembershipObj- a membership Object identifier- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
newLdpDcWithAuth
public void newLdpDcWithAuth(IRI identifier, String slug, IRI membershipObj, String authorization) throws LdpClientException
- Specified by:
newLdpDcWithAuthin interfaceLdpClient- Parameters:
identifier- a resource identifierslug- a resource name as aStringmembershipObj- a membership Object identifierauthorization- an authorization token- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
put
public void put(IRI identifier, InputStream stream, String contentType) throws LdpClientException
- Specified by:
putin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content type- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
putWithMetadata
public void putWithMetadata(IRI identifier, InputStream stream, Map<String,String> metadata) throws LdpClientException
- Specified by:
putWithMetadatain interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreammetadata- aMapof headers- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
putWithAuth
public void putWithAuth(IRI identifier, InputStream stream, String contentType, String authorization) throws LdpClientException
- Specified by:
putWithAuthin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content Type as aStringauthorization- an authorization token- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
putIfMatch
public void putIfMatch(IRI identifier, InputStream stream, String contentType, String etag) throws LdpClientException
- Specified by:
putIfMatchin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content typeetag- a strong Etag as aString- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
putBinaryWithDigest
public void putBinaryWithDigest(IRI identifier, InputStream stream, String contentType, String digest) throws LdpClientException
- Specified by:
putBinaryWithDigestin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content typedigest- a digest as aString- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException- See Also:
- rfc3230 4.3.2 Digest
-
putIfUnmodified
public void putIfUnmodified(IRI identifier, InputStream stream, String contentType, String time) throws LdpClientException
- Specified by:
putIfUnmodifiedin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamcontentType- a content typetime- an RFC_1123_DATE_TIME as anString- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
delete
public void delete(IRI identifier) throws LdpClientException
- Specified by:
deletein interfaceLdpClient- Parameters:
identifier- a resource identifier- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
patch
public void patch(IRI identifier, InputStream stream) throws LdpClientException
- Specified by:
patchin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStream- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
multipartOptions
public void multipartOptions(IRI identifier)
- Specified by:
multipartOptionsin interfaceLdpClient- Parameters:
identifier- a resource identifier
-
multipartStart
public void multipartStart(IRI identifier, InputStream stream)
- Specified by:
multipartStartin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStream
-
multipartGet
public void multipartGet(IRI identifier, String sessionId)
- Specified by:
multipartGetin interfaceLdpClient- Parameters:
identifier- a resource identifiersessionId- a session identifier
-
multipartPut
public void multipartPut(IRI identifier, InputStream stream, String sessionId)
- Specified by:
multipartPutin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamsessionId- a session identifier
-
multipartPost
public void multipartPost(IRI identifier, InputStream stream, String sessionId)
- Specified by:
multipartPostin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStreamsessionId- a session identifier
-
multipartDelete
public void multipartDelete(IRI identifier, String sessionId)
- Specified by:
multipartDeletein interfaceLdpClient- Parameters:
identifier- a resource identifiersessionId- a session identifier
-
asyncPut
public void asyncPut(IRI identifier, InputStream stream) throws LdpClientException
- Specified by:
asyncPutin interfaceLdpClient- Parameters:
identifier- a resource identifierstream- anInputStream- Throws:
LdpClientException- an URISyntaxException
-
getBytesWithQuery
public byte[] getBytesWithQuery(String query, String contentType) throws LdpClientException
- Parameters:
query- a complete formatted URI stringcontentType- content Type as aString- Returns:
- body as byte[]
- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
getQuery
public String getQuery(String query, String contentType) throws LdpClientException
- Parameters:
query- a complete formatted URI stringcontentType- content Type as aString- Returns:
- body as
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
asyncGetBytesWithQuery
public byte[] asyncGetBytesWithQuery(String query, String contentType) throws LdpClientException
- Parameters:
query- a complete formatted URI stringcontentType- content Type as aString- Returns:
- body as byte[]
- Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
asyncGetQuery
public String asyncGetQuery(String query, String contentType) throws LdpClientException
- Parameters:
query- a complete formatted URI stringcontentType- content Type as aString- Returns:
- body as
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
syncUpdate
public String syncUpdate(IRI identifier, String query) throws LdpClientException
- Parameters:
identifier- a sparql interfacequery- a sparql query body- Returns:
- body as
String - Throws:
LdpClientException- an URISyntaxException, IOException or InterruptedException
-
-