public abstract class AbstractSession extends Object implements Session
Modifier | Constructor and Description |
---|---|
protected |
AbstractSession(Map<String,String> namespaces,
String username,
String password) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNotClosed() |
void |
close()
Closes the
Session instance, releasing any resource possibly
allocated. |
Operation.Count |
count(org.openrdf.model.URI type)
Creates a new
Count operation object for counting records of the type specified. |
Operation.Create |
create(org.openrdf.model.URI type)
Creates a new
Create operation object for storing new records of the type
specified. |
Operation.Delete |
delete(org.openrdf.model.URI type)
Creates a new
Delete operation object for deleting records of the type specified. |
protected void |
doClose() |
protected abstract long |
doCount(Long timeout,
org.openrdf.model.URI type,
XPath condition,
Set<org.openrdf.model.URI> ids) |
protected abstract void |
doCreate(Long timeout,
org.openrdf.model.URI type,
Stream<? extends Record> records,
Handler<? super Outcome> handler) |
protected abstract void |
doDelete(Long timeout,
org.openrdf.model.URI type,
XPath condition,
Set<org.openrdf.model.URI> ids,
Handler<? super Outcome> handler) |
protected abstract Representation |
doDownload(Long timeout,
org.openrdf.model.URI id,
Set<String> mimeTypes,
boolean useCaches) |
protected Outcome.Status |
doFail(Throwable ex,
AtomicReference<String> message) |
protected abstract Stream<Record> |
doMatch(Long timeout,
Map<org.openrdf.model.URI,XPath> conditions,
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> ids,
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> properties) |
protected abstract void |
doMerge(Long timeout,
org.openrdf.model.URI type,
Stream<? extends Record> records,
Criteria criteria,
Handler<? super Outcome> handler) |
protected abstract Stream<Record> |
doRetrieve(Long timeout,
org.openrdf.model.URI type,
XPath condition,
Set<org.openrdf.model.URI> ids,
Set<org.openrdf.model.URI> properties,
Long offset,
Long limit) |
protected abstract <T> Stream<T> |
doSparql(Long timeout,
Class<T> type,
String expression,
Set<org.openrdf.model.URI> defaultGraphs,
Set<org.openrdf.model.URI> namedGraphs) |
protected abstract Outcome |
doSparqlDelete(Long timeout,
Stream<? extends org.openrdf.model.Statement> statements) |
protected abstract Outcome |
doSparqlUpdate(Long timeout,
Stream<? extends org.openrdf.model.Statement> statements) |
protected abstract void |
doUpdate(Long timeout,
org.openrdf.model.URI type,
XPath condition,
Set<org.openrdf.model.URI> ids,
Record record,
Criteria criteria,
Handler<? super Outcome> handler) |
protected abstract Outcome |
doUpload(Long timeout,
org.openrdf.model.URI resourceID,
Representation representation) |
Operation.Download |
download(org.openrdf.model.URI resourceID)
Creates a new
Download operation object. |
protected org.openrdf.model.URI |
getInvocationID() |
Map<String,String> |
getNamespaces()
Returns the modifiable namespace map of this
Session . |
String |
getPassword()
Returns the user password, if any.
|
String |
getUsername()
Returns the username associated to this
Session , if any. |
boolean |
isClosed()
Tests whether this
Session instance has been closed. |
Operation.Match |
match()
Creates a new
Match operation object for matching <resource, mention, entity,
axioms> 4-tuples matching specific conditions. |
Operation.Merge |
merge(org.openrdf.model.URI type)
Creates a new
Merge operation object for merging local record description of the
type specified with descriptions stored in the KnowledgeStore. |
Operation.Retrieve |
retrieve(org.openrdf.model.URI type)
Creates a new
Retrieve operation object for retrieving records of the type
specified. |
protected void |
setInvocationID(org.openrdf.model.URI invocationID) |
Operation.Sparql |
sparql(String expression,
Object... arguments)
Creates a new
Sparql operation object for evaluating a SPARQL query on crystallized
axiom data. |
Operation.SparqlDelete |
sparqldelete() |
Operation.SparqlUpdate |
sparqlupdate() |
String |
toString() |
Operation.Update |
update(org.openrdf.model.URI type)
Creates a new
Update operation object for updating one or more properties of
records of the type specified. |
Operation.Upload |
upload(org.openrdf.model.URI resourceID)
Creates a new
Upload operation object. |
@Nullable public final String getUsername() throws IllegalStateException
Session
Session
, if any.getUsername
in interface Session
Session
is anonymousIllegalStateException
- if the Session
has been closedpublic final String getPassword() throws IllegalStateException
Session
getPassword
in interface Session
IllegalStateException
- if the Session
has been closedpublic final Map<String,String> getNamespaces() throws IllegalStateException
Session
Session
. The map is backed by the
default mappings of Data#getNamespaceMap()
. New mappings are stored in the
Session
map and may override the default mappings. Removal of mappings is performed
on the Session
map, and may reactivate the default mapping as a consequence.getNamespaces
in interface Session
Session
IllegalStateException
- if the Session
has been closedpublic final Operation.Download download(org.openrdf.model.URI resourceID) throws IllegalStateException
Session
Download
operation object.download
in interface Session
resourceID
- the ID of the resource whose representation should be downloadedDownload
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Upload upload(org.openrdf.model.URI resourceID) throws IllegalStateException
Session
Upload
operation object.upload
in interface Session
resourceID
- the ID of the resource whose representation should be updatedUpload
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Count count(org.openrdf.model.URI type) throws IllegalStateException
Session
Count
operation object for counting records of the type specified.count
in interface Session
type
- the URI of the type of record to count, either KS.RESOURCE
,
KS.MENTION
, KS.ENTITY
or KS.AXIOM
Count
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Retrieve retrieve(org.openrdf.model.URI type) throws IllegalStateException
Session
Retrieve
operation object for retrieving records of the type
specified.retrieve
in interface Session
type
- the URI of the type of record to retrieve, either KS.RESOURCE
,
KS.MENTION
, KS.ENTITY
or KS.AXIOM
Retrieve
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Create create(org.openrdf.model.URI type) throws IllegalStateException
Session
Create
operation object for storing new records of the type
specified.create
in interface Session
type
- the URI of the type of record to create, either KS.RESOURCE
,
KS.MENTION
, KS.ENTITY
or KS.AXIOM
Create
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Merge merge(org.openrdf.model.URI type) throws IllegalStateException
Session
Merge
operation object for merging local record description of the
type specified with descriptions stored in the KnowledgeStore.merge
in interface Session
type
- the URI of the type of record to merge, either KS.RESOURCE
,
KS.MENTION
, KS.ENTITY
or KS.AXIOM
Merge
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Update update(org.openrdf.model.URI type) throws IllegalStateException
Session
Update
operation object for updating one or more properties of
records of the type specified.update
in interface Session
type
- the URI of the type of record to update, either KS.RESOURCE
,
KS.MENTION
, KS.ENTITY
or KS.AXIOM
Update
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Delete delete(org.openrdf.model.URI type) throws IllegalStateException
Session
Delete
operation object for deleting records of the type specified.delete
in interface Session
type
- the URI of the type of record to delete, either KS.RESOURCE
,
KS.MENTION
, KS.ENTITY
or KS.AXIOM
Delete
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Match match() throws IllegalStateException
Session
Match
operation object for matching <resource, mention, entity,
axioms> 4-tuples matching specific conditions.match
in interface Session
Match
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.Sparql sparql(String expression, Object... arguments) throws IllegalStateException
Session
Sparql
operation object for evaluating a SPARQL query on crystallized
axiom data.sparql
in interface Session
expression
- the SPARQL query expression, not nullarguments
- arguments to be injected in $$
placeholders in the query expression; can
be URI
s, Literal
s or scalar values that can be converted to
Literal
s (e.g., strings, integers)Sparql
operation objectIllegalStateException
- if the Session
has been closedpublic final Operation.SparqlUpdate sparqlupdate() throws IllegalStateException
sparqlupdate
in interface Session
IllegalStateException
public final Operation.SparqlDelete sparqldelete() throws IllegalStateException
sparqldelete
in interface Session
IllegalStateException
public final boolean isClosed()
Session
Session
instance has been closed.public final void close()
Session
Session
instance, releasing any resource possibly
allocated. Calling this method additional times has no effect. After this method is called,
calls to other method of the Session
interface will result in
IllegalStateException
s to be thrown.protected final void checkNotClosed()
protected final org.openrdf.model.URI getInvocationID()
protected final void setInvocationID(org.openrdf.model.URI invocationID)
protected Outcome.Status doFail(Throwable ex, AtomicReference<String> message) throws Throwable
Throwable
protected abstract Representation doDownload(@Nullable Long timeout, org.openrdf.model.URI id, @Nullable Set<String> mimeTypes, boolean useCaches) throws Throwable
Throwable
protected abstract Outcome doUpload(@Nullable Long timeout, org.openrdf.model.URI resourceID, @Nullable Representation representation) throws Throwable
Throwable
protected abstract long doCount(@Nullable Long timeout, org.openrdf.model.URI type, @Nullable XPath condition, @Nullable Set<org.openrdf.model.URI> ids) throws Throwable
Throwable
protected abstract Stream<Record> doRetrieve(@Nullable Long timeout, org.openrdf.model.URI type, @Nullable XPath condition, @Nullable Set<org.openrdf.model.URI> ids, @Nullable Set<org.openrdf.model.URI> properties, @Nullable Long offset, @Nullable Long limit) throws Throwable
Throwable
protected abstract void doCreate(@Nullable Long timeout, org.openrdf.model.URI type, @Nullable Stream<? extends Record> records, Handler<? super Outcome> handler) throws Throwable
Throwable
protected abstract void doMerge(@Nullable Long timeout, org.openrdf.model.URI type, @Nullable Stream<? extends Record> records, @Nullable Criteria criteria, Handler<? super Outcome> handler) throws Throwable
Throwable
protected abstract void doUpdate(@Nullable Long timeout, org.openrdf.model.URI type, @Nullable XPath condition, @Nullable Set<org.openrdf.model.URI> ids, @Nullable Record record, @Nullable Criteria criteria, Handler<? super Outcome> handler) throws Throwable
Throwable
protected abstract void doDelete(@Nullable Long timeout, org.openrdf.model.URI type, @Nullable XPath condition, @Nullable Set<org.openrdf.model.URI> ids, Handler<? super Outcome> handler) throws Throwable
Throwable
protected abstract Stream<Record> doMatch(@Nullable Long timeout, Map<org.openrdf.model.URI,XPath> conditions, Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> ids, Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> properties) throws Throwable
Throwable
protected abstract <T> Stream<T> doSparql(@Nullable Long timeout, Class<T> type, String expression, @Nullable Set<org.openrdf.model.URI> defaultGraphs, @Nullable Set<org.openrdf.model.URI> namedGraphs) throws Throwable
Throwable
protected abstract Outcome doSparqlUpdate(@Nullable Long timeout, @Nullable Stream<? extends org.openrdf.model.Statement> statements) throws Throwable
Throwable
protected abstract Outcome doSparqlDelete(@Nullable Long timeout, @Nullable Stream<? extends org.openrdf.model.Statement> statements) throws Throwable
Throwable
protected void doClose()
Copyright © 2015–2016 FBK-irst. All rights reserved.