com.thinkaurelius.titan.graphdb.blueprints

## Class TitanBlueprintsTransaction

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.blueprints.TitanBlueprintsTransaction

- All Implemented Interfaces:
    TitanTransaction, com.tinkerpop.blueprints.Graph, com.tinkerpop.blueprints.KeyIndexableGraph, com.tinkerpop.blueprints.TransactionalGraph
  Direct Known Subclasses:
    StandardTitanTx

      public abstract class TitanBlueprintsTransaction
      extends Object
      implements TitanTransaction

  Blueprints specific implementation of `TitanTransaction`. Provides utility methods that wrap Titan calls with Blueprints terminology.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.tinkerpop.blueprints.TransactionalGraph

      `com.tinkerpop.blueprints.TransactionalGraph.Conclusion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TitanBlueprintsTransaction()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TitanEdge` | `addEdge(Object id, com.tinkerpop.blueprints.Vertex outVertex, com.tinkerpop.blueprints.Vertex inVertex, String label)`
    `TitanEdge` | `addEdge(TitanVertex outVertex, TitanVertex inVertex, String label)` Creates a new edge connecting the specified vertices.
    `TitanProperty` | `addProperty(TitanVertex vertex, String key, Object attribute)` Creates a new property for the given vertex and key with the specified value.
    `TitanVertex` | `addVertex(Object id)` Creates a new vertex in the graph with the given vertex id.
    `<T extends com.tinkerpop.blueprints.Element> void` | `createKeyIndex(String key, Class<T> elementClass, com.tinkerpop.blueprints.Parameter... indexParameters)`
    `<T extends com.tinkerpop.blueprints.Element> void` | `dropKeyIndex(String key, Class<T> elementClass)`
    `TitanEdge` | `getEdge(Object id)`
    `Iterable<com.tinkerpop.blueprints.Edge>` | `getEdges(String key, Object value)`
    `com.tinkerpop.blueprints.Features` | `getFeatures()`
    `protected abstract TitanGraph` | `getGraph()` Returns the graph that this transaction is based on
    `<T extends com.tinkerpop.blueprints.Element> Set<String>` | `getIndexedKeys(Class<T> elementClass)`
    `TitanVertex` | `getVertex(Object id)`
    `Iterable<com.tinkerpop.blueprints.Vertex>` | `getVertices(String key, Object attribute)`
    `void` | `removeEdge(com.tinkerpop.blueprints.Edge edge)`
    `void` | `removeVertex(com.tinkerpop.blueprints.Vertex vertex)`
    `void` | `shutdown()`
    `void` | `stopTransaction(com.tinkerpop.blueprints.TransactionalGraph.Conclusion conclusion)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.thinkaurelius.titan.core.TitanTransaction

      `addEdge, addProperty, addVertex, addVertex, addVertexWithLabel, addVertexWithLabel, commit, containsRelationType, containsVertex, containsVertexLabel, getEdgeLabel, getEdges, getPropertyKey, getRelationType, getVertex, getVertexLabel, getVertices, hasModifications, indexQuery, isClosed, isOpen, makeEdgeLabel, makePropertyKey, makeVertexLabel, multiQuery, multiQuery, query, rollback`

    - ### Methods inherited from interface com.tinkerpop.blueprints.Graph

      `getEdges, getVertices`

- - ### Constructor Detail

    - #### TitanBlueprintsTransaction

          public TitanBlueprintsTransaction()

  - ### Method Detail

    - #### getGraph

          protected abstract TitanGraph getGraph()

      Returns the graph that this transaction is based on
      Returns:

    - #### stopTransaction

          public void stopTransaction(com.tinkerpop.blueprints.TransactionalGraph.Conclusion conclusion)

      Specified by:
        `stopTransaction` in interface `com.tinkerpop.blueprints.TransactionalGraph`

    - #### getFeatures

          public com.tinkerpop.blueprints.Features getFeatures()

      Specified by:
        `getFeatures` in interface `com.tinkerpop.blueprints.Graph`

    - #### addVertex

          public TitanVertex addVertex(Object id)

      Creates a new vertex in the graph with the given vertex id. Note, that an exception is thrown if the vertex id is not a valid Titan vertex id or if a vertex with the given id already exists. Only accepts long ids - all others are ignored.

      Custom id setting must be enabled via the configuration option `GraphDatabaseConfiguration.ALLOW_SETTING_VERTEX_ID`.

      Use `TitanId.toVertexId(long)` to construct a valid Titan vertex id from a user id.
      Specified by:
        `addVertex` in interface `com.tinkerpop.blueprints.Graph`
      Parameters:
        `id` - vertex id of the vertex to be created
      Returns:
        New vertex

    - #### getVertex

          public TitanVertex getVertex(Object id)

      Specified by:
        `getVertex` in interface `com.tinkerpop.blueprints.Graph`

    - #### getVertices

          public Iterable<com.tinkerpop.blueprints.Vertex> getVertices(String key,
                                                              Object attribute)

      Specified by:
        `getVertices` in interface `com.tinkerpop.blueprints.Graph`

    - #### removeVertex

          public void removeVertex(com.tinkerpop.blueprints.Vertex vertex)

      Specified by:
        `removeVertex` in interface `com.tinkerpop.blueprints.Graph`

    - #### addEdge

          public TitanEdge addEdge(Object id,
                          com.tinkerpop.blueprints.Vertex outVertex,
                          com.tinkerpop.blueprints.Vertex inVertex,
                          String label)

      Specified by:
        `addEdge` in interface `com.tinkerpop.blueprints.Graph`

    - #### addEdge

          public TitanEdge addEdge(TitanVertex outVertex,
                          TitanVertex inVertex,
                          String label)

      Description copied from interface: `TitanTransaction`
      Creates a new edge connecting the specified vertices.

      Creates and returns a new `TitanEdge` with given label connecting the vertices in the order specified.
      Automatically creates the edge label if it does not exist and automatic creation of types is enabled. Otherwise, this method with throw an `IllegalArgumentException`.
      Specified by:
        `addEdge` in interface `TitanTransaction`
      Parameters:
        `outVertex` - outgoing vertex of the edge
        `inVertex` - incoming vertex of the edge
        `label` - label of the edge to be created
      Returns:
        new edge

    - #### getEdge

          public TitanEdge getEdge(Object id)

      Specified by:
        `getEdge` in interface `com.tinkerpop.blueprints.Graph`

    - #### removeEdge

          public void removeEdge(com.tinkerpop.blueprints.Edge edge)

      Specified by:
        `removeEdge` in interface `com.tinkerpop.blueprints.Graph`

    - #### getEdges

          public Iterable<com.tinkerpop.blueprints.Edge> getEdges(String key,
                                                         Object value)

      Specified by:
        `getEdges` in interface `com.tinkerpop.blueprints.Graph`

    - #### addProperty

          public TitanProperty addProperty(TitanVertex vertex,
                                  String key,
                                  Object attribute)

      Description copied from interface: `TitanTransaction`
      Creates a new property for the given vertex and key with the specified value.

      Creates and returns a new `TitanProperty` with specified property key and the given object being the value.
      Automatically creates the property key if it does not exist and automatic creation of types is enabled. Otherwise, this method with throw an `IllegalArgumentException`.
      Specified by:
        `addProperty` in interface `TitanTransaction`
      Parameters:
        `vertex` - vertex for which to create the property
        `key` - key of the property to be created
        `attribute` - value of the property to be created
      Returns:
        new property

    - #### shutdown

          public void shutdown()

      Specified by:
        `shutdown` in interface `com.tinkerpop.blueprints.Graph`
      Specified by:
        `shutdown` in interface `com.tinkerpop.blueprints.TransactionalGraph`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### dropKeyIndex

          public <T extends com.tinkerpop.blueprints.Element> void dropKeyIndex(String key,
                                                                       Class<T> elementClass)

      Specified by:
        `dropKeyIndex` in interface `com.tinkerpop.blueprints.KeyIndexableGraph`

    - #### createKeyIndex

          public <T extends com.tinkerpop.blueprints.Element> void createKeyIndex(String key,
                                                                         Class<T> elementClass,
                                                                         com.tinkerpop.blueprints.Parameter... indexParameters)

      Specified by:
        `createKeyIndex` in interface `com.tinkerpop.blueprints.KeyIndexableGraph`

    - #### getIndexedKeys

          public <T extends com.tinkerpop.blueprints.Element> Set<String> getIndexedKeys(Class<T> elementClass)

      Specified by:
        `getIndexedKeys` in interface `com.tinkerpop.blueprints.KeyIndexableGraph`

Copyright © 2012–2014. All rights reserved.