Package com.c8db.internal
Class C8GraphImpl
- java.lang.Object
-
- com.c8db.internal.C8Executeable<E>
-
- com.c8db.internal.InternalC8Graph<C8DBImpl,C8DatabaseImpl,C8ExecutorSync>
-
- com.c8db.internal.C8GraphImpl
-
- All Implemented Interfaces:
C8Graph,C8SerializationAccessor
public class C8GraphImpl extends InternalC8Graph<C8DBImpl,C8DatabaseImpl,C8ExecutorSync> implements C8Graph
-
-
Field Summary
-
Fields inherited from class com.c8db.internal.InternalC8Graph
EDGE, PATH_API_GHARIAL, VERTEX
-
Fields inherited from class com.c8db.internal.C8Executeable
context, executor, util
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedC8GraphImpl(C8DatabaseImpl db, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphEntityaddEdgeDefinition(EdgeDefinition definition)Adds the given edge definition to the graph.GraphEntityaddVertexCollection(String name)Adds a vertex collection to the set of collections of the graph.GraphEntitycreate(Collection<EdgeDefinition> edgeDefinitions)Creates the graph in the graph module.GraphEntitycreate(Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options)Creates the graph in the graph module.voiddrop()Deletes the graph from the database.voiddrop(boolean dropCollections)Deletes the graph from the database.C8EdgeCollectionedgeCollection(String name)Returns aArangoEdgeCollectioninstance for the given edge collection name.booleanexists()Checks whether the graph existsCollection<String>getEdgeDefinitions()Fetches all edge collections from the graph and returns a list of collection names.GraphEntitygetInfo()Retrieves general information about the graph.Collection<String>getVertexCollections()Fetches all vertex collections from the graph and returns a list of collection names.GraphEntityremoveEdgeDefinition(String definitionName)Remove one edge definition from the graph.GraphEntityreplaceEdgeDefinition(EdgeDefinition definition)Change one specific edge definition.C8VertexCollectionvertexCollection(String name)Returns aArangoVertexCollectioninstance for the given vertex collection name.-
Methods inherited from class com.c8db.internal.InternalC8Graph
addEdgeDefinitionRequest, addEdgeDefinitionResponseDeserializer, addVertexCollectionRequest, addVertexCollectionResponseDeserializer, db, dropRequest, dropRequest, getEdgeDefinitionsDeserializer, getEdgeDefinitionsRequest, getInfoRequest, getInfoResponseDeserializer, getVertexCollectionsRequest, getVertexCollectionsResponseDeserializer, name, removeEdgeDefinitionRequest, removeEdgeDefinitionResponseDeserializer, replaceEdgeDefinitionRequest, replaceEdgeDefinitionResponseDeserializer
-
Methods inherited from class com.c8db.internal.C8Executeable
createPath, executor, request, util, util
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.c8db.C8SerializationAccessor
util, util
-
-
-
-
Constructor Detail
-
C8GraphImpl
protected C8GraphImpl(C8DatabaseImpl db, String name)
-
-
Method Detail
-
exists
public boolean exists() throws C8DBExceptionDescription copied from interface:C8GraphChecks whether the graph exists- Specified by:
existsin interfaceC8Graph- Returns:
- true if the graph exists, otherwise false
- Throws:
C8DBException
-
create
public GraphEntity create(Collection<EdgeDefinition> edgeDefinitions) throws C8DBException
Description copied from interface:C8GraphCreates the graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Specified by:
createin interfaceC8Graph- Parameters:
edgeDefinitions- An array of definitions for the edge- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
create
public GraphEntity create(Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options) throws C8DBException
Description copied from interface:C8GraphCreates the graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Specified by:
createin interfaceC8Graph- Parameters:
edgeDefinitions- An array of definitions for the edgeoptions- Additional options, can be null- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
drop
public void drop() throws C8DBExceptionDescription copied from interface:C8GraphDeletes the graph from the database.- Specified by:
dropin interfaceC8Graph- Throws:
C8DBException- See Also:
- API Documentation
-
drop
public void drop(boolean dropCollections) throws C8DBExceptionDescription copied from interface:C8GraphDeletes the graph from the database.- Specified by:
dropin interfaceC8Graph- Parameters:
dropCollections- Drop collections of this graph as well. Collections will only be dropped if they are not used in other graphs.- Throws:
C8DBException- See Also:
- API Documentation
-
getInfo
public GraphEntity getInfo() throws C8DBException
Description copied from interface:C8GraphRetrieves general information about the graph.- Specified by:
getInfoin interfaceC8Graph- Returns:
- the definition content of this graph
- Throws:
C8DBException- See Also:
- API Documentation
-
edgeCollection
public C8EdgeCollection edgeCollection(String name)
Description copied from interface:C8GraphReturns aArangoEdgeCollectioninstance for the given edge collection name.- Specified by:
edgeCollectionin interfaceC8Graph- Parameters:
name- Name of the edge collection- Returns:
- collection handler
-
getEdgeDefinitions
public Collection<String> getEdgeDefinitions() throws C8DBException
Description copied from interface:C8GraphFetches all edge collections from the graph and returns a list of collection names.- Specified by:
getEdgeDefinitionsin interfaceC8Graph- Returns:
- all edge collections within this graph
- Throws:
C8DBException- See Also:
- API Documentation
-
addEdgeDefinition
public GraphEntity addEdgeDefinition(EdgeDefinition definition) throws C8DBException
Description copied from interface:C8GraphAdds the given edge definition to the graph.- Specified by:
addEdgeDefinitionin interfaceC8Graph- Parameters:
definition- The edge definition- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
replaceEdgeDefinition
public GraphEntity replaceEdgeDefinition(EdgeDefinition definition) throws C8DBException
Description copied from interface:C8GraphChange one specific edge definition. This will modify all occurrences of this definition in all graphs known to your database- Specified by:
replaceEdgeDefinitionin interfaceC8Graph- Parameters:
definition- The edge definition- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
removeEdgeDefinition
public GraphEntity removeEdgeDefinition(String definitionName) throws C8DBException
Description copied from interface:C8GraphRemove one edge definition from the graph. This will only remove the edge collection, the vertex collections remain untouched and can still be used in your queries- Specified by:
removeEdgeDefinitionin interfaceC8Graph- Parameters:
definitionName- The name of the edge collection used in the definition- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
getVertexCollections
public Collection<String> getVertexCollections() throws C8DBException
Description copied from interface:C8GraphFetches all vertex collections from the graph and returns a list of collection names.- Specified by:
getVertexCollectionsin interfaceC8Graph- Returns:
- all vertex collections within this graph
- Throws:
C8DBException- See Also:
- API Documentation
-
addVertexCollection
public GraphEntity addVertexCollection(String name) throws C8DBException
Description copied from interface:C8GraphAdds a vertex collection to the set of collections of the graph. If the collection does not exist, it will be created.- Specified by:
addVertexCollectionin interfaceC8Graph- Parameters:
name- Name of the vertex collection- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
vertexCollection
public C8VertexCollection vertexCollection(String name)
Description copied from interface:C8GraphReturns aArangoVertexCollectioninstance for the given vertex collection name.- Specified by:
vertexCollectionin interfaceC8Graph- Parameters:
name- Name of the vertex collection- Returns:
- collection handler
-
-