Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.relation.ejb
Class RelationManagerBean

java.lang.Object
  extended by org.nuxeo.ecm.platform.relation.ejb.RelationManagerBean
All Implemented Interfaces:
java.io.Serializable, RelationManager

public class RelationManagerBean
extends java.lang.Object
implements RelationManager

Relations bean

Author:
Anahide Tchertchian
See Also:
Serialized Form

Constructor Summary
RelationManagerBean()
           
 
Method Summary
 void add(java.lang.String graphName, java.util.List<Statement> statements)
           
 void clear(java.lang.String graphName)
           
 java.util.Set<Resource> getAllResources(java.io.Serializable object, java.util.Map<java.lang.String,java.io.Serializable> context)
          Computes all resources corresponding to the given object.
 Graph getGraphByName(java.lang.String name)
          Gets a registered graph by name.
 java.util.List<java.lang.String> getGraphNames()
          Gets the list containing the graph names.
 java.util.List<Node> getObjects(java.lang.String graphName, Node subject, Node predicate)
           
 java.util.List<Node> getPredicates(java.lang.String graphName, Node subject, Node object)
           
 Resource getResource(java.lang.String namespace, java.io.Serializable object, java.util.Map<java.lang.String,java.io.Serializable> context)
          Gets a resource given a namespace and a serializable object.
 java.io.Serializable getResourceRepresentation(java.lang.String namespace, Resource resource, java.util.Map<java.lang.String,java.io.Serializable> context)
          Gets an object representing this resource given a namespace.
 java.util.List<Statement> getStatements(java.lang.String graphName)
           
 java.util.List<Statement> getStatements(java.lang.String graphName, Statement statement)
           
 java.util.List<Node> getSubjects(java.lang.String graphName, Node predicate, Node object)
           
 Graph getTransientGraph(java.lang.String type)
          Gets a transient graph.
 boolean hasResource(java.lang.String graphName, Resource resource)
           
 boolean hasStatement(java.lang.String graphName, Statement statement)
           
 void initialize()
           
 QueryResult query(java.lang.String graphName, java.lang.String queryString, java.lang.String language, java.lang.String baseURI)
           
 boolean read(java.lang.String graphName, java.io.InputStream in, java.lang.String lang, java.lang.String base)
           
 void remove()
           
 void remove(java.lang.String graphName, java.util.List<Statement> statements)
           
 java.lang.Long size(java.lang.String graphName)
           
 boolean write(java.lang.String graphName, java.io.OutputStream out, java.lang.String lang, java.lang.String base)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationManagerBean

public RelationManagerBean()
Method Detail

initialize

@PostConstruct
public void initialize()

remove

public void remove()

getGraphByName

public Graph getGraphByName(java.lang.String name)
                     throws ClientException
Description copied from interface: RelationManager
Gets a registered graph by name.

Specified by:
getGraphByName in interface RelationManager
Parameters:
name - string name of the graph used at registration
Returns:
the graph
Throws:
ClientException

getResourceRepresentation

public java.io.Serializable getResourceRepresentation(java.lang.String namespace,
                                                      Resource resource,
                                                      java.util.Map<java.lang.String,java.io.Serializable> context)
                                               throws ClientException
Description copied from interface: RelationManager
Gets an object representing this resource given a namespace.

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

Specified by:
getResourceRepresentation in interface RelationManager
Throws:
ClientException

getResource

public Resource getResource(java.lang.String namespace,
                            java.io.Serializable object,
                            java.util.Map<java.lang.String,java.io.Serializable> context)
                     throws ClientException
Description copied from interface: RelationManager
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.

Specified by:
getResource in interface RelationManager
Throws:
ClientException

getAllResources

public java.util.Set<Resource> getAllResources(java.io.Serializable object,
                                               java.util.Map<java.lang.String,java.io.Serializable> context)
                                        throws ClientException
Description copied from interface: RelationManager
Computes all resources corresponding to the given object.

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

Specified by:
getAllResources in interface RelationManager
Returns:
the resources as a set
Throws:
ClientException

getGraphNames

public java.util.List<java.lang.String> getGraphNames()
                                               throws ClientException
Description copied from interface: RelationManager
Gets the list containing the graph names.

Specified by:
getGraphNames in interface RelationManager
Throws:
ClientException

add

public void add(java.lang.String graphName,
                java.util.List<Statement> statements)
         throws ClientException
Specified by:
add in interface RelationManager
Throws:
ClientException
See Also:
Graph.add(java.util.List)

clear

public void clear(java.lang.String graphName)
           throws ClientException
Specified by:
clear in interface RelationManager
Throws:
ClientException
See Also:
Graph.clear()

getObjects

public java.util.List<Node> getObjects(java.lang.String graphName,
                                       Node subject,
                                       Node predicate)
                                throws ClientException
Specified by:
getObjects in interface RelationManager
Throws:
ClientException
See Also:
Graph.getObjects(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)

getPredicates

public java.util.List<Node> getPredicates(java.lang.String graphName,
                                          Node subject,
                                          Node object)
                                   throws ClientException
Specified by:
getPredicates in interface RelationManager
Throws:
ClientException
See Also:
Graph.getPredicates(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)

getStatements

public java.util.List<Statement> getStatements(java.lang.String graphName,
                                               Statement statement)
                                        throws ClientException
Specified by:
getStatements in interface RelationManager
Throws:
ClientException
See Also:
Graph.getStatements()

getStatements

public java.util.List<Statement> getStatements(java.lang.String graphName)
                                        throws ClientException
Specified by:
getStatements in interface RelationManager
Throws:
ClientException
See Also:
Graph.getStatements()

getSubjects

public java.util.List<Node> getSubjects(java.lang.String graphName,
                                        Node predicate,
                                        Node object)
                                 throws ClientException
Specified by:
getSubjects in interface RelationManager
Throws:
ClientException
See Also:
Graph.getSubjects(org.nuxeo.ecm.platform.relations.api.Node, org.nuxeo.ecm.platform.relations.api.Node)

hasResource

public boolean hasResource(java.lang.String graphName,
                           Resource resource)
                    throws ClientException
Specified by:
hasResource in interface RelationManager
Throws:
ClientException
See Also:
Graph.hasResource(org.nuxeo.ecm.platform.relations.api.Resource)

hasStatement

public boolean hasStatement(java.lang.String graphName,
                            Statement statement)
                     throws ClientException
Specified by:
hasStatement in interface RelationManager
Throws:
ClientException
See Also:
Graph.hasStatement(org.nuxeo.ecm.platform.relations.api.Statement)

query

public QueryResult query(java.lang.String graphName,
                         java.lang.String queryString,
                         java.lang.String language,
                         java.lang.String baseURI)
                  throws ClientException
Specified by:
query in interface RelationManager
Throws:
ClientException
See Also:
Graph.query(java.lang.String, java.lang.String, java.lang.String)

read

public boolean read(java.lang.String graphName,
                    java.io.InputStream in,
                    java.lang.String lang,
                    java.lang.String base)
             throws ClientException
Specified by:
read in interface RelationManager
Throws:
ClientException
See Also:
Graph.read(java.lang.String, java.lang.String, java.lang.String)

remove

public void remove(java.lang.String graphName,
                   java.util.List<Statement> statements)
            throws ClientException
Specified by:
remove in interface RelationManager
Throws:
ClientException
See Also:
Graph.remove(java.util.List)

size

public java.lang.Long size(java.lang.String graphName)
                    throws ClientException
Specified by:
size in interface RelationManager
Throws:
ClientException
See Also:
Graph.size()

write

public boolean write(java.lang.String graphName,
                     java.io.OutputStream out,
                     java.lang.String lang,
                     java.lang.String base)
              throws ClientException
Specified by:
write in interface RelationManager
Throws:
ClientException
See Also:
Graph.write(java.lang.String, java.lang.String, java.lang.String)

getTransientGraph

public Graph getTransientGraph(java.lang.String type)
                        throws ClientException
Description copied from interface: RelationManager
Gets a transient graph.

Specified by:
getTransientGraph in interface RelationManager
Parameters:
type - The graph type.
Returns:
the graph.
Throws:
ClientException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.