public class RelationService extends DefaultComponent implements RelationManager
It handles a registry of graph instances through extension points.
| Modifier and Type | Field and Description |
|---|---|
Map<String,GraphFactory> |
graphFactories
Graph name -> factory.
|
Map<String,Graph> |
graphRegistry
Graph name -> graph instance.
|
static ComponentName |
NAME |
| Constructor and Description |
|---|
RelationService() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String graphName,
List<Statement> statements)
Deprecated.
|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo
bundles.
|
void |
clear(String graphName)
Deprecated.
|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class
associated with this object.
|
Set<Resource> |
getAllResources(Serializable object,
Map<String,Serializable> context)
Computes all resources corresponding to the given object.
|
Graph |
getGraph(String name,
CoreSession session)
Gets a registered graph by name.
|
Graph |
getGraphByName(String name)
Gets a registered graph by name.
|
List<String> |
getGraphNames()
Gets the list containing the graph names.
|
List<String> |
getGraphTypes() |
List<Node> |
getObjects(String graphName,
Node subject,
Node predicate)
Deprecated.
|
List<Node> |
getPredicates(String graphName,
Node subject,
Node object)
Deprecated.
|
Resource |
getResource(String namespace,
Serializable object,
Map<String,Serializable> context)
Gets a resource given a namespace and a serializable object.
|
Serializable |
getResourceRepresentation(String namespace,
Resource resource,
Map<String,Serializable> context)
Gets an object representing this resource given a namespace.
|
List<Statement> |
getStatements(String graphName)
Deprecated.
|
List<Statement> |
getStatements(String graphName,
Statement statement)
Deprecated.
|
List<Node> |
getSubjects(String graphName,
Node predicate,
Node object)
Deprecated.
|
Graph |
getTransientGraph(String type)
Gets a transient graph.
|
boolean |
hasResource(String graphName,
Resource resource)
Deprecated.
|
boolean |
hasStatement(String graphName,
Statement statement)
Deprecated.
|
QueryResult |
query(String graphName,
String queryString,
String language,
String baseURI)
Deprecated.
|
boolean |
read(String graphName,
InputStream in,
String lang,
String base)
Deprecated.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
remove(String graphName,
List<Statement> statements)
Deprecated.
|
Long |
size(String graphName)
Deprecated.
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
boolean |
write(String graphName,
OutputStream out,
String lang,
String base)
Deprecated.
|
activate, deactivate, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtensionpublic static final ComponentName NAME
public final Map<String,GraphFactory> graphFactories
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution in class DefaultComponentpublic <T> T getAdapter(Class<T> adapter)
Adaptablenull if
no such object can be found.getAdapter in interface AdaptablegetAdapter in class DefaultComponentadapter - the adapter class to look upnull if this object does not
have an adapter for the given classpublic Graph getGraphByName(String name) throws ClientException
RelationManagergetGraphByName in interface RelationManagername - string name of the graph used at registrationClientExceptionpublic Graph getGraph(String name, CoreSession session)
RelationManager
A CoreSession should be passed to provide a context in which to
store relations when using a "core" graph.
getGraph in interface RelationManagername - string name of the graph used at registrationsession - the core sessionpublic Graph getTransientGraph(String type) throws ClientException
RelationManagergetTransientGraph in interface RelationManagertype - The graph type.ClientExceptionpublic Resource getResource(String namespace, Serializable object, Map<String,Serializable> context) throws ClientException
RelationManagerThere can be several resources with different namespaces associated to an incoming object. A document can for instance be used to refer to itself as a precise version as well as to the set of all versions.
Context can hold any object useful for the adapters, like a
CoreSession.
getResource in interface RelationManagerClientExceptionpublic Set<Resource> getAllResources(Serializable object, Map<String,Serializable> context) throws ClientException
RelationManager
Context can hold any object useful for the adapters, like a
CoreSession.
getAllResources in interface RelationManagerClientExceptionpublic Serializable getResourceRepresentation(String namespace, Resource resource, Map<String,Serializable> context) throws ClientException
RelationManager
Context can hold any object useful for the adapters, like a
CoreSession.
getResourceRepresentation in interface RelationManagerClientException@Deprecated public void add(String graphName, List<Statement> statements) throws ClientException
add in interface RelationManagerClientExceptionGraph.add(org.nuxeo.ecm.platform.relations.api.Statement)@Deprecated public void clear(String graphName) throws ClientException
clear in interface RelationManagerClientExceptionGraph.clear()@Deprecated public List<Node> getObjects(String graphName, Node subject, Node predicate) throws ClientException
getObjects in interface RelationManagerClientExceptionGraph.getObjects(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)@Deprecated public List<Node> getPredicates(String graphName, Node subject, Node object) throws ClientException
getPredicates in interface RelationManagerClientExceptionGraph.getPredicates(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)@Deprecated public List<Statement> getStatements(String graphName, Statement statement) throws ClientException
getStatements in interface RelationManagerClientExceptionGraph.getStatements()@Deprecated public List<Statement> getStatements(String graphName) throws ClientException
getStatements in interface RelationManagerClientExceptionGraph.getStatements()@Deprecated public List<Node> getSubjects(String graphName, Node predicate, Node object) throws ClientException
getSubjects in interface RelationManagerClientExceptionGraph.getSubjects(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)@Deprecated public boolean hasResource(String graphName, Resource resource) throws ClientException
hasResource in interface RelationManagerClientExceptionGraph.hasResource(org.nuxeo.ecm.platform.relations.api.Resource)@Deprecated public boolean hasStatement(String graphName, Statement statement) throws ClientException
hasStatement in interface RelationManagerClientExceptionGraph.hasStatement(org.nuxeo.ecm.platform.relations.api.Statement)@Deprecated public QueryResult query(String graphName, String queryString, String language, String baseURI) throws ClientException
query in interface RelationManagerClientExceptionGraph.query(java.lang.String, java.lang.String, java.lang.String)@Deprecated public boolean read(String graphName, InputStream in, String lang, String base) throws ClientException
read in interface RelationManagerClientExceptionGraph.read(java.lang.String, java.lang.String, java.lang.String)@Deprecated public void remove(String graphName, List<Statement> statements) throws ClientException
remove in interface RelationManagerClientExceptionGraph.remove(org.nuxeo.ecm.platform.relations.api.Statement)@Deprecated public Long size(String graphName) throws ClientException
size in interface RelationManagerClientExceptionGraph.size()@Deprecated public boolean write(String graphName, OutputStream out, String lang, String base) throws ClientException
write in interface RelationManagerClientExceptionGraph.write(java.lang.String, java.lang.String, java.lang.String)public List<String> getGraphNames() throws ClientException
RelationManagergetGraphNames in interface RelationManagerClientExceptionpublic void applicationStarted(ComponentContext context) throws Exception
ComponentapplicationStarted in interface ComponentapplicationStarted in class DefaultComponentExceptionCopyright © 2013 Nuxeo SA. All Rights Reserved.