|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.graph.Graph
@NotThreadSafe public class Graph
A graph representation of the content within a RepositorySource
, including mechanisms to interact and manipulate that
content. The graph is designed to be an embedded domain
specific language, meaning calls to it are designed to read like sentences even though they are really just Java
methods. And to be more readable, methods can be chained together.
Nested Class Summary | |
---|---|
static interface |
Graph.And<Next>
A interface that is used to add more locations that are to be copied/moved. |
static interface |
Graph.At<Next>
The interface for defining the node upon which which a request operates. |
class |
Graph.Batch
Interface for creating multiple requests to perform various operations. |
static interface |
Graph.BatchConjunction
|
static interface |
Graph.Conjunction<Next>
A interface that can be used to finish the current request and start another. |
static interface |
Graph.Copy<Next>
The interface for defining additional nodes to be copied and the parent into which the node(s) are to be copied. where the node(s) are to be moved. |
static interface |
Graph.Create<Next>
The interface for defining additional properties on a new node. |
static interface |
Graph.Executable
A interface used to execute the accumulated requests . |
static interface |
Graph.ImportInto<Next>
A component that defines the location into which a node should be copied or moved. |
static interface |
Graph.Into<Next>
A component that defines the location into which a node should be copied or moved. |
static interface |
Graph.Move<Next>
The interface for defining additional nodes to be moved and the parent into which the node(s) are to be moved. |
static interface |
Graph.Of<Next>
The interface for defining the node upon which a request operates. |
static interface |
Graph.On<Next>
The interface for defining the node upon which a request operates. |
Method Summary | |
---|---|
Graph.Batch |
batch()
Begin a batch of requests to perform various operations. |
Graph.Copy<Graph> |
copy(Location from)
Begin the request to copy a node at the specified location into a parent node at a different location, which is specified via the into(...) |
Graph.Copy<Graph> |
copy(Node from)
Begin the request to copy the specified node into a parent node at a different location, which is specified via the into(...) |
Graph.Copy<Graph> |
copy(Path from)
Begin the request to copy a node located at the supplied path into a parent node at a different location, which is specified via the into(...) |
Graph.Copy<Graph> |
copy(Property idProperty)
Begin the request to copy a node with the specified unique identification property into a parent node at a different location, which is specified via the into(...) |
Graph.Copy<Graph> |
copy(Property firstIdProperty,
Property... additionalIdProperties)
Begin the request to copy a node with the specified identification properties into a parent node at a different location, which is specified via the into(...) |
Graph.Copy<Graph> |
copy(String fromPath)
Begin the request to copy a node located at the supplied path into a parent node at a different location, which is specified via the into(...) |
Graph.Copy<Graph> |
copy(UUID from)
Begin the request to copy a node with the specified unique identifier into a parent node at a different location, which is specified via the into(...) |
Graph.Conjunction<Graph> |
create(Path at)
Begin the request to create a node located at the supplied path. |
Graph.Conjunction<Graph> |
create(Path at,
Iterable<Property> properties)
Begin the request to create a node located at the supplied path. |
Graph.Conjunction<Graph> |
create(Path at,
Property... properties)
Begin the request to create a node located at the supplied path. |
Graph.Conjunction<Graph> |
create(String atPath)
Begin the request to create a node located at the supplied path. |
Graph.Conjunction<Graph> |
create(String atPath,
Property... properties)
Begin the request to create a node located at the supplied path. |
static Graph |
create(String sourceName,
RepositoryConnectionFactory connectionFactory,
ExecutionContext context)
Create a graph instance that uses the supplied repository and context . |
Graph.Conjunction<Graph> |
delete(Location at)
Request to delete the node at the given location. |
Graph.Conjunction<Graph> |
delete(Node at)
Request to delete the specified node. |
Graph.Conjunction<Graph> |
delete(Path at)
Request to delete the node at the given path. |
Graph.Conjunction<Graph> |
delete(Property idProperty)
Request to delete the node with the given unique identification property. |
Graph.Conjunction<Graph> |
delete(Property firstIdProperty,
Property... additionalIdProperties)
Request to delete the node with the given identification properties. |
Graph.Conjunction<Graph> |
delete(String atPath)
Request to delete the node at the given path. |
Graph.Conjunction<Graph> |
delete(UUID at)
Request to delete the node with the given UUID. |
Graph.Of<List<Location>> |
getChildren()
Request that the children be read on the node defined via the of(...) |
Graph.Of<List<Location>> |
getChildrenInBlock(int startingIndex,
int blockSize)
Request that the children in the specified block be read on the node defined via the of(...) |
Graph.Of<List<Location>> |
getChildrenInRange(int startingIndex,
int endingIndex)
Request that the children in the specified index range be read on the node defined via the of(...) |
RepositoryConnectionFactory |
getConnectionFactory()
Get the RepositoryConnectionFactory that this graph uses to create repository connections . |
ExecutionContext |
getContext()
Get the context of execution within which operations on this graph are performed. |
CachePolicy |
getDefaultCachePolicy()
Get the default cache policy for this graph. |
Node |
getNodeAt(Location location)
Request to read the node at the supplied location. |
Node |
getNodeAt(Path path)
Request to read the node at the supplied path. |
Node |
getNodeAt(Property idProperty)
Request to read the node with the supplied unique identifier property. |
Node |
getNodeAt(Property firstIdProperty,
Property... additionalIdProperties)
Request to read the node with the supplied unique identifier properties. |
Node |
getNodeAt(String path)
Request to read the node at the supplied path. |
Node |
getNodeAt(UUID uuid)
Request to read the node with the supplied UUID. |
Graph.On<Collection<Property>> |
getProperties()
Request that the properties be read on the node defined via the on(...) |
Graph.On<Map<Name,Property>> |
getPropertiesByName()
Request that the properties be read on the node defined via the on(...) |
Graph.On<Property> |
getProperty(Name name)
Request that the property with the given name be read on the node defined via the on(...) |
Graph.On<Property> |
getProperty(String name)
Request that the property with the given name be read on the node defined via the on(...) |
String |
getSourceName()
The name of the repository that will be used by this graph. |
Graph.At<Subgraph> |
getSubgraphOfDepth(int depth)
Request to read a subgraph of the specified depth, rooted at a location that will be specified via at(...) |
Graph.ImportInto<Graph.Conjunction<Graph>> |
importXmlFrom(File file)
Import the content from the XML file at the supplied file, specifying via the returned object where the
content is to be imported. |
Graph.ImportInto<Graph.Conjunction<Graph>> |
importXmlFrom(String pathToFile)
Import the content from the XML file at the supplied file location, specifying via the returned object
where the content is to be imported. |
Graph.ImportInto<Graph.Conjunction<Graph>> |
importXmlFrom(URI uri)
Import the content from the XML file at the supplied URI, specifying via the returned object where the
content is to be imported. |
Graph.Move<Graph.Conjunction<Graph>> |
move(Location from)
Begin the request to move a node at the specified location into a parent node at a different location, which is specified via the into(...) |
Graph.Move<Graph.Conjunction<Graph>> |
move(Node from)
Begin the request to move the specified node into a parent node at a different location, which is specified via the into(...) |
Graph.Move<Graph.Conjunction<Graph>> |
move(Path from)
Begin the request to move a node located at the supplied path into a parent node at a different location, which is specified via the into(...) |
Graph.Move<Graph.Conjunction<Graph>> |
move(Property idProperty)
Begin the request to move a node with the specified unique identification property into a parent node at a different location, which is specified via the into(...) |
Graph.Move<Graph.Conjunction<Graph>> |
move(Property firstIdProperty,
Property... additionalIdProperties)
Begin the request to move a node with the specified identification properties into a parent node at a different location, which is specified via the into(...) |
Graph.Move<Graph.Conjunction<Graph>> |
move(String fromPath)
Begin the request to move a node located at the supplied path into a parent node at a different location, which is specified via the into(...) |
Graph.Move<Graph.Conjunction<Graph>> |
move(UUID from)
Begin the request to move a node with the specified unique identifier into a parent node at a different location, which is specified via the into(...) |
Graph.On<Graph.Conjunction<Graph>> |
remove(Name... propertyNames)
Remove properties from the node at the given location. |
Graph.On<Graph.Conjunction<Graph>> |
remove(String... propertyNames)
Remove properties from the node at the given location. |
Graph.On<Graph.Conjunction<Graph>> |
set(Property... properties)
Set the properties on a node. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Graph create(String sourceName, RepositoryConnectionFactory connectionFactory, ExecutionContext context)
context
.
sourceName
- the name of the source that should be usedconnectionFactory
- the factory of repository connectionscontext
- the context in which all executions should be performed
IllegalArgumentException
- if the source or context parameters are nullpublic RepositoryConnectionFactory getConnectionFactory()
repository connections
.
public String getSourceName()
connection factory
when this graph needs to obtain
a
repository connection
.
public ExecutionContext getContext()
public CachePolicy getDefaultCachePolicy()
source
.
RepositorySourceException
- if no repository source with the name
could be foundpublic Graph.Move<Graph.Conjunction<Graph>> move(Node from)
into(...)
method on the returned Graph.Move
object.
Like all other methods on the Graph
, the move request will be performed immediately when the into(...)
method is called.
from
- the node that is to be moved.
public Graph.Move<Graph.Conjunction<Graph>> move(Location from)
into(...)
method on the returned Graph.Move
object.
Like all other methods on the Graph
, the move request will be performed immediately when the into(...)
method is called.
from
- the location of the node that is to be moved.
public Graph.Move<Graph.Conjunction<Graph>> move(String fromPath)
into(...)
method on the returned Graph.Move
object.
Like all other methods on the Graph
, the move request will be performed immediately when the into(...)
method is called.
fromPath
- the path to the node that is to be moved.
public Graph.Move<Graph.Conjunction<Graph>> move(Path from)
into(...)
method on the returned Graph.Move
object.
Like all other methods on the Graph
, the move request will be performed immediately when the into(...)
method is called.
from
- the path to the node that is to be moved.
public Graph.Move<Graph.Conjunction<Graph>> move(UUID from)
into(...)
method on the returned Graph.Move
object.
Like all other methods on the Graph
, the move request will be performed immediately when the into(...)
method is called.
from
- the UUID of the node that is to be moved.
public Graph.Move<Graph.Conjunction<Graph>> move(Property idProperty)
into(...)
method on the returned Graph.Move
object. The identification
property should uniquely identify a single node.
Like all other methods on the Graph
, the move request will be performed immediately when the into(...)
method is called.
idProperty
- the unique identification property of the node that is to be moved.
public Graph.Move<Graph.Conjunction<Graph>> move(Property firstIdProperty, Property... additionalIdProperties)
into(...)
method on the returned Graph.Move
object. The identification properties
should uniquely identify a single node.
Like all other methods on the Graph
, the move request will be performed immediately when the into(...)
method is called.
firstIdProperty
- the first identification property of the node that is to be movedadditionalIdProperties
- the remaining idenficiation properties of the node that is to be moved
public Graph.Copy<Graph> copy(Node from)
into(...)
method on the returned Graph.Copy
object.
Like all other methods on the Graph
, the copy request will be performed immediately when the into(...)
method is called.
from
- the node that is to be copied.
public Graph.Copy<Graph> copy(Location from)
into(...)
method on the returned Graph.Copy
object.
Like all other methods on the Graph
, the copy request will be performed immediately when the into(...)
method is called.
from
- the location of the node that is to be copied.
public Graph.Copy<Graph> copy(String fromPath)
into(...)
method on the returned Graph.Copy
object.
Like all other methods on the Graph
, the copy request will be performed immediately when the into(...)
method is called.
fromPath
- the path to the node that is to be copied.
public Graph.Copy<Graph> copy(Path from)
into(...)
method on the returned Graph.Copy
object.
Like all other methods on the Graph
, the copy request will be performed immediately when the into(...)
method is called.
from
- the path to the node that is to be copied.
public Graph.Copy<Graph> copy(UUID from)
into(...)
method on the returned Graph.Copy
object.
Like all other methods on the Graph
, the copy request will be performed immediately when the into(...)
method is called.
from
- the UUID of the node that is to be copied.
public Graph.Copy<Graph> copy(Property idProperty)
into(...)
method on the returned Graph.Copy
object. The identification
property should uniquely identify a single node.
Like all other methods on the Graph
, the copy request will be performed immediately when the into(...)
method is called.
idProperty
- the unique identification property of the node that is to be copied.
public Graph.Copy<Graph> copy(Property firstIdProperty, Property... additionalIdProperties)
into(...)
method on the returned Graph.Copy
object. The identification properties
should uniquely identify a single node.
Like all other methods on the Graph
, the copy request will be performed immediately when the into(...)
method is called.
firstIdProperty
- the first identification property of the node that is to be copiedadditionalIdProperties
- the remaining idenficiation properties of the node that is to be copied
public Graph.Conjunction<Graph> delete(Node at)
at
- the node that is to be deleted
public Graph.Conjunction<Graph> delete(Location at)
at
- the location of the node that is to be deleted
public Graph.Conjunction<Graph> delete(String atPath)
atPath
- the path of the node that is to be deleted
public Graph.Conjunction<Graph> delete(Path at)
at
- the path of the node that is to be deleted
public Graph.Conjunction<Graph> delete(UUID at)
at
- the UUID of the node that is to be deleted
public Graph.Conjunction<Graph> delete(Property idProperty)
idProperty
- the unique identifying property of the node that is to be deleted
public Graph.Conjunction<Graph> delete(Property firstIdProperty, Property... additionalIdProperties)
firstIdProperty
- the first identification property of the node that is to be copiedadditionalIdProperties
- the remaining idenficiation properties of the node that is to be copied
public Graph.Conjunction<Graph> create(String atPath)
atPath
- the path to the node that is to be created.
public Graph.Conjunction<Graph> create(String atPath, Property... properties)
atPath
- the path to the node that is to be created.properties
- the properties for the new node
public Graph.Conjunction<Graph> create(Path at)
at
- the path to the node that is to be created.
public Graph.Conjunction<Graph> create(Path at, Property... properties)
at
- the path to the node that is to be created.properties
- the properties for the new node
public Graph.Conjunction<Graph> create(Path at, Iterable<Property> properties)
at
- the path to the node that is to be created.properties
- the properties for the new node
public Graph.On<Graph.Conjunction<Graph>> set(Property... properties)
properties
- the properties to set
public Graph.On<Graph.Conjunction<Graph>> remove(Name... propertyNames)
propertyNames
- the names of the properties to be removed
public Graph.On<Graph.Conjunction<Graph>> remove(String... propertyNames)
propertyNames
- the names of the properties to be removed
public Graph.On<Collection<Property>> getProperties()
on(...)
method on the returned Graph.On
object. Once the location is specified, the collection of properties
are read and then returned.
public Graph.On<Map<Name,Property>> getPropertiesByName()
on(...)
method on the returned Graph.On
object. Once the location is specified, the map of properties
are read and then returned.
public Graph.Of<List<Location>> getChildren()
of(...)
method on the returned Graph.Of
object. Once the location is specified, the list of children
are read and then returned.
public Graph.Of<List<Location>> getChildrenInRange(int startingIndex, int endingIndex)
of(...)
method on
the returned Graph.Of
object. Once the location is specified, the list of children
are read and then
returned.
startingIndex
- the index of the first child to be readendingIndex
- the index past the last the first child to be read
public Graph.Of<List<Location>> getChildrenInBlock(int startingIndex, int blockSize)
of(...)
method on the
returned Graph.Of
object. Once the location is specified, the list of children
are read and then returned.
startingIndex
- the index of the first child to be readblockSize
- the maximum number of children that should be read
public Graph.On<Property> getProperty(String name)
on(...)
method on the
returned Graph.On
object. Once the location is specified, the property
is read and then returned.
name
- the name of the property that is to be read
public Graph.On<Property> getProperty(Name name)
on(...)
method on the
returned Graph.On
object. Once the location is specified, the property
is read and then returned.
name
- the name of the property that is to be read
public Node getNodeAt(UUID uuid)
uuid
- the UUID of the node that is to be read
public Node getNodeAt(Location location)
location
- the location of the node that is to be read
public Node getNodeAt(String path)
path
- the path of the node that is to be read
public Node getNodeAt(Path path)
path
- the path of the node that is to be read
public Node getNodeAt(Property idProperty)
idProperty
- the identification property that is unique to the node that is to be read
public Node getNodeAt(Property firstIdProperty, Property... additionalIdProperties)
firstIdProperty
- the first of the identification properties that uniquely identify the node that is to be readadditionalIdProperties
- the remaining identification properties that uniquely identify the node that is to be read
public Graph.At<Subgraph> getSubgraphOfDepth(int depth)
at(...)
in
the resulting Graph.At
object. All properties and children of every node in the subgraph will be read and returned in the
Subgraph
object returned from the at(...)
methods.
depth
- the maximum depth of the subgraph that should be read
Subgraph
containing the resultspublic Graph.ImportInto<Graph.Conjunction<Graph>> importXmlFrom(URI uri)
object
where the
content is to be imported.
uri
- the URI where the importer can read the content that is to be imported
IllegalArgumentException
- if the uri
or destination path are nullpublic Graph.ImportInto<Graph.Conjunction<Graph>> importXmlFrom(String pathToFile)
object
where the content is to be imported.
pathToFile
- the path to the XML file that should be imported.
IllegalArgumentException
- if the uri
or destination path are nullpublic Graph.ImportInto<Graph.Conjunction<Graph>> importXmlFrom(File file)
object
where the
content is to be imported.
file
- the XML file that should be imported.
IllegalArgumentException
- if the uri
or destination path are nullpublic Graph.Batch batch()
repository source
. The results
are not available until the Graph.Batch.execute()
method is invoked.
Graph.Batch.execute()
,
Results
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |