Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.relations.api
Interface RelationManager

All Superinterfaces:
Serializable
All Known Subinterfaces:
RelationManagerLocal, RelationManagerRemote
All Known Implementing Classes:
RelationService

public interface RelationManager
extends Serializable

RelationService common interface.

Author:
Anahide Tchertchian

Method Summary
 void add(String graphName, List<Statement> statements)
           
 void clear(String graphName)
           
 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.
 List<String> getGraphNames()
          Gets the list containing the graph names.
 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 remove(String graphName, List<Statement> statements)
           
 Long size(String graphName)
           
 boolean write(String graphName, OutputStream out, String lang, String base)
           
 

Method Detail

getGraphByName

Graph getGraphByName(String name)
                     throws ClientException
Gets a registered graph by name.

Parameters:
name - string name of the graph used at registration
Returns:
the graph
Throws:
RuntimeException - if the graph is not found
ClientException

getTransientGraph

Graph getTransientGraph(String type)
                        throws ClientException
Gets a transient graph.

Parameters:
type - The graph type.
Returns:
the graph.
Throws:
ClientException

getResource

Resource getResource(String namespace,
                     Serializable object,
                     Map<String,Serializable> context)
                     throws ClientException
Gets a resource given a namespace and a serializable object.

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.

Throws:
ClientException
Since:
5.2-M1

getAllResources

Set<Resource> getAllResources(Serializable object,
                              Map<String,Serializable> context)
                              throws ClientException
Computes all resources corresponding to the given object.

Context can hold any object useful for the adapters, like a CoreSession.

Returns:
the resources as a set
Throws:
ClientException
Since:
5.2-M1

getResourceRepresentation

Serializable getResourceRepresentation(String namespace,
                                       Resource resource,
                                       Map<String,Serializable> context)
                                       throws ClientException
Gets an object representing this resource given a namespace.

Context can hold any object useful for the adapters, like a CoreSession.

Throws:
ClientException
Since:
5.2-M1

getGraphNames

List<String> getGraphNames()
                           throws ClientException
Gets the list containing the graph names.

Throws:
ClientException
Since:
5.2-GA

add

void add(String graphName,
         List<Statement> statements)
         throws ClientException
Throws:
ClientException
See Also:
Graph.add(java.util.List)

remove

void remove(String graphName,
            List<Statement> statements)
            throws ClientException
Throws:
ClientException
See Also:
Graph.remove(java.util.List)

getStatements

List<Statement> getStatements(String graphName)
                              throws ClientException
Throws:
ClientException
See Also:
Graph.getStatements()

getStatements

List<Statement> getStatements(String graphName,
                              Statement statement)
                              throws ClientException
Throws:
ClientException
See Also:
Graph.getStatements()

getSubjects

List<Node> getSubjects(String graphName,
                       Node predicate,
                       Node object)
                       throws ClientException
Throws:
ClientException
See Also:
Graph.getSubjects(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)

getPredicates

List<Node> getPredicates(String graphName,
                         Node subject,
                         Node object)
                         throws ClientException
Throws:
ClientException
See Also:
Graph.getPredicates(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)

getObjects

List<Node> getObjects(String graphName,
                      Node subject,
                      Node predicate)
                      throws ClientException
Throws:
ClientException
See Also:
Graph.getObjects(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)

hasStatement

boolean hasStatement(String graphName,
                     Statement statement)
                     throws ClientException
Throws:
ClientException
See Also:
Graph.hasStatement(org.nuxeo.ecm.platform.relations.api.Statement)

hasResource

boolean hasResource(String graphName,
                    Resource resource)
                    throws ClientException
Throws:
ClientException
See Also:
Graph.hasResource(org.nuxeo.ecm.platform.relations.api.Resource)

size

Long size(String graphName)
          throws ClientException
Throws:
ClientException
See Also:
Graph.size()

clear

void clear(String graphName)
           throws ClientException
Throws:
ClientException
See Also:
Graph.clear()

query

QueryResult query(String graphName,
                  String queryString,
                  String language,
                  String baseURI)
                  throws ClientException
Throws:
ClientException
See Also:
Graph.query(java.lang.String, java.lang.String, java.lang.String)

read

boolean read(String graphName,
             InputStream in,
             String lang,
             String base)
             throws ClientException
Throws:
ClientException
See Also:
Graph.read(java.lang.String, java.lang.String, java.lang.String)

write

boolean write(String graphName,
              OutputStream out,
              String lang,
              String base)
              throws ClientException
Throws:
ClientException
See Also:
Graph.write(java.lang.String, java.lang.String, java.lang.String)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.