|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.runtime.model.DefaultComponent org.nuxeo.ecm.platform.relations.services.RelationService
public class RelationService
Relation service.
It handles a registry of graph instances through extension points.
Field Summary | |
---|---|
static ComponentName |
NAME
|
Constructor Summary | |
---|---|
RelationService()
|
Method Summary | ||
---|---|---|
void |
add(String graphName,
List<Statement> statements)
|
|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo bundles. |
|
void |
clear(String graphName)
|
|
|
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 |
getGraphByName(String name)
Gets a registered graph by name. |
|
Graph |
getGraphByType(String graphType)
Gets a graph given a name. |
|
List<String> |
getGraphNames()
Gets the list containing the graph names. |
|
List<String> |
getGraphTypes()
|
|
List<Node> |
getObjects(String graphName,
Node subject,
Node predicate)
|
|
List<Node> |
getPredicates(String graphName,
Node subject,
Node object)
|
|
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)
|
|
List<Statement> |
getStatements(String graphName,
Statement statement)
|
|
List<Node> |
getSubjects(String graphName,
Node predicate,
Node object)
|
|
Graph |
getTransientGraph(String type)
Gets a transient graph. |
|
boolean |
hasResource(String graphName,
Resource resource)
|
|
boolean |
hasStatement(String graphName,
Statement statement)
|
|
QueryResult |
query(String graphName,
String queryString,
String language,
String baseURI)
|
|
boolean |
read(String graphName,
InputStream in,
String lang,
String base)
|
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
|
|
void |
remove(String graphName,
List<Statement> statements)
|
|
Long |
size(String graphName)
|
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
|
|
boolean |
write(String graphName,
OutputStream out,
String lang,
String base)
|
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent |
---|
activate, deactivate, registerExtension, unregisterExtension |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ComponentName NAME
Constructor Detail |
---|
public RelationService()
Method Detail |
---|
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 up
null
if this object does not
have an adapter for the given classpublic Graph getGraphByType(String graphType)
This is used to instantiate graphs with a given name
graphType
-
public List<String> getGraphTypes()
public Graph getTransientGraph(String type) throws ClientException
RelationManager
getTransientGraph
in interface RelationManager
type
- The graph type.
ClientException
public Graph getGraphByName(String name) throws ClientException
RelationManager
getGraphByName
in interface RelationManager
name
- string name of the graph used at registration
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
public void add(String graphName, List<Statement> statements) throws ClientException
add
in interface RelationManager
ClientException
Graph.add(java.util.List)
public void clear(String graphName) throws ClientException
clear
in interface RelationManager
ClientException
Graph.clear()
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)
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)
public List<Statement> getStatements(String graphName, Statement statement) throws ClientException
getStatements
in interface RelationManager
ClientException
Graph.getStatements()
public List<Statement> getStatements(String graphName) throws ClientException
getStatements
in interface RelationManager
ClientException
Graph.getStatements()
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)
public boolean hasResource(String graphName, Resource resource) throws ClientException
hasResource
in interface RelationManager
ClientException
Graph.hasResource(org.nuxeo.ecm.platform.relations.api.Resource)
public boolean hasStatement(String graphName, Statement statement) throws ClientException
hasStatement
in interface RelationManager
ClientException
Graph.hasStatement(org.nuxeo.ecm.platform.relations.api.Statement)
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)
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)
public void remove(String graphName, List<Statement> statements) throws ClientException
remove
in interface RelationManager
ClientException
Graph.remove(java.util.List)
public Long size(String graphName) throws ClientException
size
in interface RelationManager
ClientException
Graph.size()
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
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |