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, unregisterExtension
public static final ComponentName NAME
public final Map<String,GraphFactory> graphFactories
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if
no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classpublic Graph getGraphByName(String name) throws ClientException
RelationManager
getGraphByName
in interface RelationManager
name
- string name of the graph used at registrationClientException
public 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 RelationManager
name
- string name of the graph used at registrationsession
- the core sessionpublic Graph getTransientGraph(String type) throws ClientException
RelationManager
getTransientGraph
in interface RelationManager
type
- The graph type.ClientException
public Resource getResource(String namespace, Serializable object, Map<String,Serializable> context) throws ClientException
RelationManager
There 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 RelationManager
ClientException
public 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 RelationManager
ClientException
public 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 RelationManager
ClientException
@Deprecated public void add(String graphName, List<Statement> statements) throws ClientException
add
in interface RelationManager
ClientException
Graph.add(org.nuxeo.ecm.platform.relations.api.Statement)
@Deprecated public void clear(String graphName) throws ClientException
clear
in interface RelationManager
ClientException
Graph.clear()
@Deprecated public List<Node> getObjects(String graphName, Node subject, Node predicate) throws ClientException
getObjects
in interface RelationManager
ClientException
Graph.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 RelationManager
ClientException
Graph.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 RelationManager
ClientException
Graph.getStatements()
@Deprecated public List<Statement> getStatements(String graphName) throws ClientException
getStatements
in interface RelationManager
ClientException
Graph.getStatements()
@Deprecated public List<Node> getSubjects(String graphName, Node predicate, Node object) throws ClientException
getSubjects
in interface RelationManager
ClientException
Graph.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 RelationManager
ClientException
Graph.hasResource(org.nuxeo.ecm.platform.relations.api.Resource)
@Deprecated public boolean hasStatement(String graphName, Statement statement) throws ClientException
hasStatement
in interface RelationManager
ClientException
Graph.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 RelationManager
ClientException
Graph.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 RelationManager
ClientException
Graph.read(java.lang.String, java.lang.String, java.lang.String)
@Deprecated public void remove(String graphName, List<Statement> statements) throws ClientException
remove
in interface RelationManager
ClientException
Graph.remove(org.nuxeo.ecm.platform.relations.api.Statement)
@Deprecated public Long size(String graphName) throws ClientException
size
in interface RelationManager
ClientException
Graph.size()
@Deprecated public boolean write(String graphName, OutputStream out, String lang, String base) throws ClientException
write
in interface RelationManager
ClientException
Graph.write(java.lang.String, java.lang.String, java.lang.String)
public List<String> getGraphNames() throws ClientException
RelationManager
getGraphNames
in interface RelationManager
ClientException
public void applicationStarted(ComponentContext context) throws Exception
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
Exception
Copyright © 2013 Nuxeo SA. All Rights Reserved.