public class

Neo4jConnector

extends Object
implements MuleContextAware
java.lang.Object
   ↳ org.mule.modules.neo4j.Neo4jConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Neo4j Connector, for versions 1.9 or above.

{@sample.config INCLUDE_ERROR}

{@sample.config INCLUDE_ERROR}

Summary

Nested Classes
enum Neo4jConnector.AutoIndexingStatus  
enum Neo4jConnector.QueryResultOrder  
enum Neo4jConnector.RelationshipDirection  
Constants
String CREATE_OR_FAIL_UNIQUENESS
String GET_OR_CREATE_UNIQUENESS
String HEADER_STREAMING
String LABEL_TEMPLATE
String PAGINATION_PARAMS_TEMPLATE
String PROPERTY_KEY_TEMPLATE
String RETURN_TYPE_TEMPLATE
String TYPE_LIST_TEMPLATE
Fields
private static final TypeReference<Collection<BatchJobResult>> BATCH_JOB_RESULTS_TYPE_REFERENCE
private static final TypeReference<Boolean> BOOLEAN_TYPE_REFERENCE
private static final TypeReference<CypherQueryResult> CYPHER_QUERY_RESULT_TYPE_REFERENCE
private static final Set<String> ENTITY_CARRYING_HTTP_METHODS
private static final TypeReference<Collection<Fullpath>> FULLPATHS_TYPE_REFERENCE
private static final TypeReference<Collection<IndexedNode>> INDEXED_NODES_TYPE_REFERENCE
private static final TypeReference<IndexedNode> INDEXED_NODE_TYPE_REFERENCE
private static final TypeReference<IndexedRelationship> INDEXED_RELATIONSHIP_TYPE_REFERENCE
private static final TypeReference<Index> INDEX_TYPE_REFERENCE
private static final Log LOGGER
private static final TypeReference<Collection<Node>> NODES_TYPE_REFERENCE
private static final TypeReference<Map<String, Map<String, String>>> NODE_INDEXES_TYPE_REFERENCE
private static final TypeReference<Node> NODE_TYPE_REFERENCE
private static final Set<Integer> NO_RESPONSE_STATUSES
private static final ObjectMapper OBJECT_MAPPER
private static final TypeReference<Collection<Path>> PATHS_TYPE_REFERENCE
private static final TypeReference<Collection<PathQueryResult>> PATH_QUERY_RESULTS_TYPE_REFERENCE
private static final TypeReference<PathQueryResult> PATH_QUERY_RESULT_TYPE_REFERENCE
private static final TypeReference<Collection<Relationship>> RELATIONSHIPS_TYPE_REFERENCE
private static final TypeReference<Relationship> RELATIONSHIP_TYPE_REFERENCE
private static final TypeReference<Collection<SchemaIndex>> SCHEMA_INDEXES_TYPE_REFERENCE
private static final TypeReference<SchemaIndex> SCHEMA_INDEX_TYPE_REFERENCE
private static final Set<Integer> SC_CREATED
private static final Set<Integer> SC_NO_CONTENT
private static final Set<Integer> SC_NO_CONTENT_OR_NOT_FOUND
private static final Set<Integer> SC_OK
private static final Set<Integer> SC_OK_OR_CREATED
private static final Set<Integer> SC_OK_OR_NOT_FOUND
private static final Set<Integer> SC_OK_OR_NO_CONTENT
private static final TypeReference<ServiceRoot> SERVICE_ROOT_TYPE_REFERENCE
private static final TypeReference<Collection<String>> STRINGS_TYPE_REFERENCE
private String authorization
private String baseUri
private Connector connector The connector to use to reach Neo4j: configure only if there is more than one HTTP/HTTPS connector active in your Mule application.
private MuleContext muleContext
private String password The password used to authenticate to Neo4j.
private ServiceRoot serviceRoot
private boolean streaming Should streaming be used when communicating with the Neo4j server.
private String user The user used to authenticate to Neo4j.
Public Constructors
Neo4jConnector()
Public Methods
void addAutoindexingProperty(String propertyName)
This method is deprecated. since Neo4j 2.0.0
void addNodeLabel(Node node, String label)
Add a label to a Node.
void addNodeLabels(Node node, List<String> labels)
Add labels to a Node.
IndexedNode addNodeToIndex(String indexName, Node node, String key, String value)
This method is deprecated. since Neo4j 2.0.0
void connect(String baseUri)
Connect to a Neo4j server.
Node createNode(Map<String, Object> properties)
Create a Node.
Index createNodeIndex(String indexName, String type, String provider)
This method is deprecated. since Neo4j 2.0.0
Relationship createRelationship(Node fromNode, Node toNode, String type, Map<String, Object> properties)
Create a Relationship.
Index createRelationshipIndex(String indexName, String type, String provider)
This method is deprecated. since Neo4j 2.0.0
SchemaIndex createSchemaIndex(String label, List<String> propertyKeys)
Create a SchemaIndex.
IndexedNode createUniqueNodeOrFail(String indexName, String key, String value, Map<String, Object> properties)
Create a unique Node or fail.
IndexedRelationship createUniqueRelationshipOrFail(String relationshipName, String type, String key, String value, Node startNode, Node endNode)
Create a unique Relationship or fail.
void deleteAutoindexingProperty(String propertyName)
This method is deprecated. since Neo4j 2.0.0
void deleteNode(Node node, boolean failIfNotFound)
Delete a Node.
void deleteNodeById(long nodeId, boolean failIfNotFound)
Delete a Node.
void deleteNodeIndex(String indexName, boolean failIfNotFound)
This method is deprecated. since Neo4j 2.0.0
void deleteNodeLabel(Node node, String label)
Delete a label from a node, never failing even if the label doesn't exist.
void deleteNodeProperties(Node node)
Delete all properties from a Node.
void deleteNodeProperty(Node node, String key, boolean failIfNotFound)
Delete a property from a Node.
void deleteRelationship(Relationship relationship, boolean failIfNotFound)
Delete a Relationship.
void deleteRelationshipById(long relationshipId, boolean failIfNotFound)
Delete a Relationship.
void deleteRelationshipIndex(String indexName, boolean failIfNotFound)
This method is deprecated. since Neo4j 2.0.0
void deleteRelationshipProperties(Relationship relationship)
Delete all properties of a Relationship.
void deleteRelationshipProperty(Relationship relationship, String key, boolean failIfNotFound)
Delete one property of a Relationship.
void deleteSchemaIndex(String label, String propertyKey, boolean failIfNotFound)
Delete a schema index.
void disconnect()
Collection<BatchJobResult> executeBatch(List<ConfigurableBatchJob> jobs)
Execute a batch of jobs.
Collection<IndexedNode> findNodesByAutoIndex(String key, String value)
This method is deprecated. since Neo4j 2.0.0
Collection<IndexedNode> findNodesByAutoIndexQuery(String query)
This method is deprecated. since Neo4j 2.0.0
Collection<IndexedNode> findNodesByIndex(String indexName, String key, String value)
This method is deprecated. since Neo4j 2.0.0
Collection<IndexedNode> findNodesByQuery(String indexName, String query, Neo4jConnector.QueryResultOrder order)
This method is deprecated. since Neo4j 2.0.0
String getAuthorization()
Collection<String> getAutoindexingProperties()
This method is deprecated. since Neo4j 2.0.0
Neo4jConnector.AutoIndexingStatus getAutoindexingStatus()
This method is deprecated. since Neo4j 2.0.0
String getBaseUri()
Connector getConnector()
Collection<String> getLabels()
Get all the labels.
Node getNodeById(long nodeId, boolean failIfNotFound)
Get a Node.
Collection<Index> getNodeIndexes()
This method is deprecated. since Neo4j 2.0.0
Collection<String> getNodeLabels(Node node)
Get all the labels of a Node.
Collection<Relationship> getNodeRelationships(Node node, Neo4jConnector.RelationshipDirection direction, List<String> types)
Get the relationships for a particular Node.
Collection<Node> getNodesByLabel(String label, String propertyName, Object propertyValue)
Get all the Nodes that have a particular label and, optional, a particular property.
IndexedNode getOrCreateUniqueNode(String indexName, String key, String value, Map<String, Object> properties)
Get or create a unique Node.
IndexedRelationship getOrCreateUniqueRelationship(String relationshipName, String type, String key, String value, Node startNode, Node endNode)
Get or create a unique Relationship.
String getPassword()
Relationship getRelationshipById(long relationshipId, boolean failIfNotFound)
Collection<Index> getRelationshipIndexes()
This method is deprecated. since Neo4j 2.0.0
Collection<String> getRelationshipTypes()
Get all the relationship types.
Collection<SchemaIndex> getSchemaIndexes(String label)
Get the SchemaIndexes for a particular label.
ServiceRoot getServiceRoot()
Get service root.
boolean getStreaming()
String getUser()
boolean isConnected()
boolean isStreaming()
void removeNodeIndexEntries(String indexName, Node node, String key, String value, boolean failIfNotFound)
This method is deprecated. since Neo4j 2.0.0
CypherQueryResult runCypherQuery(String query, Map<String, Object> params, boolean includeStatistics, boolean profile)
Run a cypher query.
void setAutoindexingStatus(Neo4jConnector.AutoIndexingStatus status)
This method is deprecated. since Neo4j 2.0.0
void setConnector(Connector connector)
void setMuleContext(MuleContext muleContext)
void setNodeLabels(Node node, List<String> labels)
Set labels of a Node.
void setNodeProperties(Node node, Map<String, Object> properties)
Set the properties of a Node.
void setNodeProperty(Node node, String key, Object value)
Set a property of a Node.
void setPassword(String password)
void setRelationshipProperties(Relationship relationship, Map<String, Object> properties)
Set the properties of a Relationship.
void setRelationshipProperty(Relationship relationship, String key, Object value)
Set one property of a Relationship.
void setStreaming(boolean streaming)
void setUser(String user)
Collection<Fullpath> traverseForFullpaths(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)
Perform a node traversal, returning Fullpath instances.
void traverseForFullpathsWithPaging(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)
Perform a paged node traversal, dispatching Fullpath instances to the rest of the flow.
Collection<Node> traverseForNodes(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)
Perform a node traversal, returning Node instances.
void traverseForNodesWithPaging(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)
Perform a paged node traversal, dispatching Node instances to the rest of the flow.
PathQueryResult traverseForPathWithAlgorithm(Node fromNode, Node toNode, PathQuery.Algorithm algorithm, String relationshipType, int maxDepth, String costProperty, Double defaultCost, boolean failIfNotFound)
Traverse nodes with a particular algorithm, returning the first successful path found.
Collection<Path> traverseForPaths(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)
Perform a node traversal, returning Path instances.
Collection<PathQueryResult> traverseForPathsWithAlgorithm(Node fromNode, Node toNode, PathQuery.Algorithm algorithm, String relationshipType, int maxDepth, String costProperty, Double defaultCost)
Traverse nodes with a particular algorithm, returning all the successful paths found.
void traverseForPathsWithPaging(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)
Perform a paged node traversal, dispatching Path instances to the rest of the flow.
Collection<Relationship> traverseForRelationships(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)
Perform a node traversal, returning Relationship instances.
void traverseForRelationshipsWithPaging(Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)
Perform a paged node traversal, dispatching Relationship instances to the rest of the flow.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.api.context.MuleContextAware

Constants

private static final String CREATE_OR_FAIL_UNIQUENESS

Constant Value: "create_or_fail"

private static final String GET_OR_CREATE_UNIQUENESS

Constant Value: "get_or_create"

private static final String HEADER_STREAMING

Constant Value: "X-Stream"

private static final String LABEL_TEMPLATE

Constant Value: "{label}"

private static final String PAGINATION_PARAMS_TEMPLATE

Constant Value: "{?pageSize,leaseTime}"

private static final String PROPERTY_KEY_TEMPLATE

Constant Value: "{key}"

private static final String RETURN_TYPE_TEMPLATE

Constant Value: "{returnType}"

private static final String TYPE_LIST_TEMPLATE

Constant Value: "{-list|&|types}"

Fields

private static final TypeReference<Collection<BatchJobResult>> BATCH_JOB_RESULTS_TYPE_REFERENCE

private static final TypeReference<Boolean> BOOLEAN_TYPE_REFERENCE

private static final TypeReference<CypherQueryResult> CYPHER_QUERY_RESULT_TYPE_REFERENCE

private static final Set<String> ENTITY_CARRYING_HTTP_METHODS

private static final TypeReference<Collection<Fullpath>> FULLPATHS_TYPE_REFERENCE

private static final TypeReference<Collection<IndexedNode>> INDEXED_NODES_TYPE_REFERENCE

private static final TypeReference<IndexedNode> INDEXED_NODE_TYPE_REFERENCE

private static final TypeReference<IndexedRelationship> INDEXED_RELATIONSHIP_TYPE_REFERENCE

private static final TypeReference<Index> INDEX_TYPE_REFERENCE

private static final Log LOGGER

private static final TypeReference<Collection<Node>> NODES_TYPE_REFERENCE

private static final TypeReference<Map<String, Map<String, String>>> NODE_INDEXES_TYPE_REFERENCE

private static final TypeReference<Node> NODE_TYPE_REFERENCE

private static final Set<Integer> NO_RESPONSE_STATUSES

private static final ObjectMapper OBJECT_MAPPER

private static final TypeReference<Collection<Path>> PATHS_TYPE_REFERENCE

private static final TypeReference<Collection<PathQueryResult>> PATH_QUERY_RESULTS_TYPE_REFERENCE

private static final TypeReference<PathQueryResult> PATH_QUERY_RESULT_TYPE_REFERENCE

private static final TypeReference<Collection<Relationship>> RELATIONSHIPS_TYPE_REFERENCE

private static final TypeReference<Relationship> RELATIONSHIP_TYPE_REFERENCE

private static final TypeReference<Collection<SchemaIndex>> SCHEMA_INDEXES_TYPE_REFERENCE

private static final TypeReference<SchemaIndex> SCHEMA_INDEX_TYPE_REFERENCE

private static final Set<Integer> SC_CREATED

private static final Set<Integer> SC_NO_CONTENT

private static final Set<Integer> SC_NO_CONTENT_OR_NOT_FOUND

private static final Set<Integer> SC_OK

private static final Set<Integer> SC_OK_OR_CREATED

private static final Set<Integer> SC_OK_OR_NOT_FOUND

private static final Set<Integer> SC_OK_OR_NO_CONTENT

private static final TypeReference<ServiceRoot> SERVICE_ROOT_TYPE_REFERENCE

private static final TypeReference<Collection<String>> STRINGS_TYPE_REFERENCE

private String authorization

private String baseUri

private Connector connector

The connector to use to reach Neo4j: configure only if there is more than one HTTP/HTTPS connector active in your Mule application.

private MuleContext muleContext

private String password

The password used to authenticate to Neo4j.

private ServiceRoot serviceRoot

private boolean streaming

Should streaming be used when communicating with the Neo4j server.

private String user

The user used to authenticate to Neo4j.

Public Constructors

public Neo4jConnector ()

Public Methods

public void addAutoindexingProperty (String propertyName)

This method is deprecated.
since Neo4j 2.0.0

Add a property for autoindexing on nodes.

Parameters
propertyName The property to add.
Throws
MuleException if anything goes wrong with the operation.

public void addNodeLabel (Node node, String label)

Add a label to a Node.

Parameters
node The Node to add a label to.
label The label to add.
Throws
MuleException if anything goes wrong with the operation.

public void addNodeLabels (Node node, List<String> labels)

Add labels to a Node.

Parameters
node The Node to add labels to.
labels A List of labels to add.
Throws
MuleException if anything goes wrong with the operation.

public IndexedNode addNodeToIndex (String indexName, Node node, String key, String value)

This method is deprecated.
since Neo4j 2.0.0

Add a Node to an index.

Parameters
indexName The name of the index to add the node to.
node The node to add.
key The key to use with the index entry.
value The value to use with the index entry.
Returns
Throws
MuleException if anything goes wrong with the operation.

public void connect (String baseUri)

Connect to a Neo4j server.

Parameters
baseUri The base URI of the Neo4j server API.
Throws
ConnectionException in case connection fails.

public Node createNode (Map<String, Object> properties)

Create a Node.

Parameters
properties The properties of the node.
Returns
  • the created Node instance.
Throws
MuleException if anything goes wrong with the operation.

public Index createNodeIndex (String indexName, String type, String provider)

This method is deprecated.
since Neo4j 2.0.0

Create a node index.

Parameters
indexName The name of the new node index to create.
type The type of the new node index.
provider The provider for the new node index.
Returns
  • the created NodeIndex.
Throws
MuleException if anything goes wrong with the operation.

public Relationship createRelationship (Node fromNode, Node toNode, String type, Map<String, Object> properties)

Create a Relationship.

Parameters
fromNode The node where the relationship starts.
toNode The node where the relationship ends.
type The type of relationship.
properties The properties of the relationship.
Returns
Throws
MuleException if anything goes wrong with the operation.

public Index createRelationshipIndex (String indexName, String type, String provider)

This method is deprecated.
since Neo4j 2.0.0

Create a relationship index.

Parameters
indexName The name of the new node index to create.
type The type of the new node index.
provider The provider for the new node index.
Returns
  • the created NodeIndex.
Throws
MuleException if anything goes wrong with the operation.

public SchemaIndex createSchemaIndex (String label, List<String> propertyKeys)

Create a SchemaIndex.

Parameters
label The label to create the index for.
propertyKeys The property key or keys to index.
Returns
Throws
MuleException if anything goes wrong with the operation.

public IndexedNode createUniqueNodeOrFail (String indexName, String key, String value, Map<String, Object> properties)

Create a unique Node or fail.

Parameters
indexName The name of the index.
key The key for the index.
value The value for the index's key.
properties The properties of the node.
Returns
  • the created or pre-existing Node instance.
Throws
MuleException if anything goes wrong with the operation.

public IndexedRelationship createUniqueRelationshipOrFail (String relationshipName, String type, String key, String value, Node startNode, Node endNode)

Create a unique Relationship or fail.

Parameters
relationshipName The name of the relationship.
type The type of the relationship.
key The index key.
value The index value.
startNode The start Node.
endNode The end Node.
Returns
Throws
MuleException if anything goes wrong with the operation.

public void deleteAutoindexingProperty (String propertyName)

This method is deprecated.
since Neo4j 2.0.0

Delete a property for autoindexing on nodes.

Parameters
propertyName The property to remove.
Throws
MuleException if anything goes wrong with the operation.

public void deleteNode (Node node, boolean failIfNotFound)

Delete a Node.

Parameters
node The Node to delete.
failIfNotFound If true, an exception will be thrown if the node is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteNodeById (long nodeId, boolean failIfNotFound)

Delete a Node.

Parameters
nodeId Id of the node to delete.
failIfNotFound If true, an exception will be thrown if the node is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteNodeIndex (String indexName, boolean failIfNotFound)

This method is deprecated.
since Neo4j 2.0.0

Delete a node index.

Parameters
indexName The name of the node index to delete.
failIfNotFound If true, an exception will be thrown if the node index is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteNodeLabel (Node node, String label)

Delete a label from a node, never failing even if the label doesn't exist.

Parameters
node The Node to delete the label from.
label The label to delete.
Throws
MuleException if anything goes wrong with the operation.

public void deleteNodeProperties (Node node)

Delete all properties from a Node.

Parameters
node The Node to delete properties from.
Throws
MuleException if anything goes wrong with the operation.

public void deleteNodeProperty (Node node, String key, boolean failIfNotFound)

Delete a property from a Node.

Parameters
node The Node to delete the property from.
key The key of the property.
failIfNotFound If true, an exception will be thrown if the property is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteRelationship (Relationship relationship, boolean failIfNotFound)

Delete a Relationship.

Parameters
relationship The Relationship to delete.
failIfNotFound If true, an exception will be thrown if the relationship is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteRelationshipById (long relationshipId, boolean failIfNotFound)

Delete a Relationship.

Parameters
relationshipId The ID of the relationship to delete.
failIfNotFound If true, an exception will be thrown if the relationship is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteRelationshipIndex (String indexName, boolean failIfNotFound)

This method is deprecated.
since Neo4j 2.0.0

Delete a relationship index.

Parameters
indexName The name of the node index to delete.
failIfNotFound If true, an exception will be thrown if the node index is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteRelationshipProperties (Relationship relationship)

Delete all properties of a Relationship.

Parameters
relationship The Relationship to delete from.
Throws
MuleException if anything goes wrong with the operation.

public void deleteRelationshipProperty (Relationship relationship, String key, boolean failIfNotFound)

Delete one property of a Relationship.

Parameters
relationship The Relationship to delete from.
key The key of the property.
failIfNotFound If true, an exception will be thrown if the property is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void deleteSchemaIndex (String label, String propertyKey, boolean failIfNotFound)

Delete a schema index.

Parameters
label The label to delete the schema index from.
propertyKey The property key to delete the schema index for.
failIfNotFound If true, an exception will be thrown if the schema index is not found and couldn't be deleted.
Throws
MuleException if anything goes wrong with the operation.

public void disconnect ()

Throws
IOException

public Collection<BatchJobResult> executeBatch (List<ConfigurableBatchJob> jobs)

Execute a batch of jobs.

Parameters
jobs The batch to execute.
Returns
Throws
MuleException if anything goes wrong with the operation.

public Collection<IndexedNode> findNodesByAutoIndex (String key, String value)

This method is deprecated.
since Neo4j 2.0.0

Find nodes by exact match on an auto-index.

Parameters
key The key to use.
value The value to use.
Returns
  • a Collection of IndexedNodes, never null but possibly empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<IndexedNode> findNodesByAutoIndexQuery (String query)

This method is deprecated.
since Neo4j 2.0.0

Find nodes by query on an auto-index.

Parameters
query The query to run.
Returns
  • a Collection of IndexedNodes, never null but possibly empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<IndexedNode> findNodesByIndex (String indexName, String key, String value)

This method is deprecated.
since Neo4j 2.0.0

Find nodes by exact index match.

Parameters
indexName The name of the index to use for the search.
key The key to use.
value The value to use.
Returns
  • a Collection of IndexedNodes, never null but possibly empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<IndexedNode> findNodesByQuery (String indexName, String query, Neo4jConnector.QueryResultOrder order)

This method is deprecated.
since Neo4j 2.0.0

Find nodes by index query.

Parameters
indexName The name of the index to use for the search.
query The query to run.
order The desired Neo4jConnector.QueryResultOrder.
Returns
  • a Collection of IndexedNodes, never null but possibly empty.
Throws
MuleException if anything goes wrong with the operation.

public String getAuthorization ()

public Collection<String> getAutoindexingProperties ()

This method is deprecated.
since Neo4j 2.0.0

Get the properties being autoindexed.

Returns
  • a Collection of String instances, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public Neo4jConnector.AutoIndexingStatus getAutoindexingStatus ()

This method is deprecated.
since Neo4j 2.0.0

Get current status for autoindexing on nodes.

Returns
  • an Neo4jConnector#AutoIndexingStatus.
Throws
MuleException if anything goes wrong with the operation.

public String getBaseUri ()

public Connector getConnector ()

public Collection<String> getLabels ()

Get all the labels.

Returns
  • a Collection of String labels, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public Node getNodeById (long nodeId, boolean failIfNotFound)

Get a Node.

Parameters
nodeId Id of the node to get.
failIfNotFound If true, an exception will be thrown if the node is not found, otherwise null will be returned.
Returns
  • a Node instance or null.
Throws
MuleException if anything goes wrong with the operation.

public Collection<Index> getNodeIndexes ()

This method is deprecated.
since Neo4j 2.0.0

Get all the node indexes.

Returns
  • a Collection of NodeIndexes, never null but can be empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<String> getNodeLabels (Node node)

Get all the labels of a Node.

Parameters
node The Node from which to get the labels.
Returns
  • a Collection of String representing the labels, never null but possible empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<Relationship> getNodeRelationships (Node node, Neo4jConnector.RelationshipDirection direction, List<String> types)

Get the relationships for a particular Node.

Parameters
node The Node for which relationships are considered.
direction The Neo4jConnector.RelationshipDirection to use.
types The relationship types to look for.
Returns
  • a Collection of Relationship, which can be empty but never null.
Throws
MuleException if anything goes wrong with the operation.

public Collection<Node> getNodesByLabel (String label, String propertyName, Object propertyValue)

Get all the Nodes that have a particular label and, optional, a particular property.

Parameters
label The label to use when searching for nodes.
propertyName The property name to use when searching for nodes.
propertyValue The property value to use when searching for nodes.
Returns
  • a Collection of Node, never null but possibly empty.
Throws
MuleException if anything goes wrong with the operation.

public IndexedNode getOrCreateUniqueNode (String indexName, String key, String value, Map<String, Object> properties)

Get or create a unique Node.

Parameters
indexName The name of the index.
key The key for the index.
value The value for the index's key.
properties The properties of the node.
Returns
  • the created or pre-existing Node instance.
Throws
MuleException if anything goes wrong with the operation.

public IndexedRelationship getOrCreateUniqueRelationship (String relationshipName, String type, String key, String value, Node startNode, Node endNode)

Get or create a unique Relationship.

Parameters
relationshipName The name of the relationship.
type The type of the relationship.
key The index key.
value The index value.
startNode The start Node.
endNode The end Node.
Returns
Throws
MuleException if anything goes wrong with the operation.

public String getPassword ()

public Relationship getRelationshipById (long relationshipId, boolean failIfNotFound)

Get a Relationship.

Parameters
relationshipId The ID of the relationship to retrieve.
failIfNotFound If true, an exception will be thrown if the node is not found, otherwise null will be returned.
Returns
Throws
MuleException if anything goes wrong with the operation.

public Collection<Index> getRelationshipIndexes ()

This method is deprecated.
since Neo4j 2.0.0

Get all the relationship indexes.

Returns
  • a Collection of NodeIndexes, never null but can be empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<String> getRelationshipTypes ()

Get all the relationship types.

Returns
  • a Collection of String, which can be empty but never null.
Throws
MuleException if anything goes wrong with the operation.

public Collection<SchemaIndex> getSchemaIndexes (String label)

Get the SchemaIndexes for a particular label.

Parameters
label The label to consider.
Returns
  • a Collection of SchemaIndex instances, never null but possibly empty
Throws
MuleException if anything goes wrong with the operation.

public ServiceRoot getServiceRoot ()

Get service root.

Returns
  • the service root data.

public boolean getStreaming ()

public String getUser ()

public boolean isConnected ()

public boolean isStreaming ()

public void removeNodeIndexEntries (String indexName, Node node, String key, String value, boolean failIfNotFound)

This method is deprecated.
since Neo4j 2.0.0

Remove node index entries.

Parameters
indexName The name of the index to remove entries from.
node The node for which entries will be removed.
key The key for which entries will be removed.
value The value for which entries will be removed.
failIfNotFound If true, an exception will be thrown if no index entry can be deleted.
Throws
MuleException if anything goes wrong with the operation.

public CypherQueryResult runCypherQuery (String query, Map<String, Object> params, boolean includeStatistics, boolean profile)

Run a cypher query.

Parameters
query The query to execute.
params The parameters to use.
includeStatistics Defines if meta data about the query must be returned.
profile Defines if a profile of the executed query must be returned.
Returns
Throws
MuleException if anything goes wrong with the operation.

public void setAutoindexingStatus (Neo4jConnector.AutoIndexingStatus status)

This method is deprecated.
since Neo4j 2.0.0

Enable or disable node autoindexing.

Parameters
status An Neo4jConnector#AutoIndexingStatus.
Throws
MuleException if anything goes wrong with the operation.

public void setConnector (Connector connector)

Parameters
connector

public void setMuleContext (MuleContext muleContext)

Parameters
muleContext

public void setNodeLabels (Node node, List<String> labels)

Set labels of a Node.

Parameters
node The Node to set labels of.
labels A List of labels to set.
Throws
MuleException if anything goes wrong with the operation.

public void setNodeProperties (Node node, Map<String, Object> properties)

Set the properties of a Node.

Parameters
node The Node to set properties on.
properties The properties of the node.
Throws
MuleException if anything goes wrong with the operation.

public void setNodeProperty (Node node, String key, Object value)

Set a property of a Node.

Parameters
node The Node to set the property on.
key The key of the property.
value The value of the property.
Throws
MuleException if anything goes wrong with the operation.

public void setPassword (String password)

Parameters
password

public void setRelationshipProperties (Relationship relationship, Map<String, Object> properties)

Set the properties of a Relationship.

Parameters
relationship The Relationship to set properties on.
properties The properties to set.
Throws
MuleException if anything goes wrong with the operation.

public void setRelationshipProperty (Relationship relationship, String key, Object value)

Set one property of a Relationship.

Parameters
relationship The Relationship to set a property on.
key The property key.
value The property value.
Throws
MuleException if anything goes wrong with the operation.

public void setStreaming (boolean streaming)

Parameters
streaming

public void setUser (String user)

Parameters
user

public Collection<Fullpath> traverseForFullpaths (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)

Perform a node traversal, returning Fullpath instances.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
Returns
  • a Collection of Fullpath, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public void traverseForFullpathsWithPaging (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)

Perform a paged node traversal, dispatching Fullpath instances to the rest of the flow.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
pageSize The size of the result page.
leaseTimeSeconds The time during which the paged results will be accessible.
muleEvent The MuleEvent being processed.
sourceCallback The SourceCallback invoked for each result page.
Returns
  • a Collection of Node, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<Node> traverseForNodes (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)

Perform a node traversal, returning Node instances.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
Returns
  • a Collection of Node, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public void traverseForNodesWithPaging (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)

Perform a paged node traversal, dispatching Node instances to the rest of the flow.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
pageSize The size of the result page.
leaseTimeSeconds The time during which the paged results will be accessible.
muleEvent The MuleEvent being processed.
sourceCallback The SourceCallback invoked for each result page.
Returns
  • a Collection of Node, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public PathQueryResult traverseForPathWithAlgorithm (Node fromNode, Node toNode, PathQuery.Algorithm algorithm, String relationshipType, int maxDepth, String costProperty, Double defaultCost, boolean failIfNotFound)

Traverse nodes with a particular algorithm, returning the first successful path found.

Parameters
fromNode The Node where traversal should start.
toNode The Node where traversal should end.
algorithm The PathQuery.Algorithm to use for the traversal.
relationshipType The type of relationship to traverse.
maxDepth The maximum depth from the start node below which traversal must stop.
costProperty The property that contains the cost of traversal.
defaultCost The default cost of the traversal.
failIfNotFound If true, an exception will be thrown if no path can be found, otherwise null will be returned.
Returns
Throws
MuleException if anything goes wrong with the operation.

public Collection<Path> traverseForPaths (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)

Perform a node traversal, returning Path instances.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
Returns
  • a Collection of Path, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<PathQueryResult> traverseForPathsWithAlgorithm (Node fromNode, Node toNode, PathQuery.Algorithm algorithm, String relationshipType, int maxDepth, String costProperty, Double defaultCost)

Traverse nodes with a particular algorithm, returning all the successful paths found.

Parameters
fromNode The Node where traversal should start.
toNode The Node where traversal should end.
algorithm The PathQuery.Algorithm to use for the traversal.
relationshipType The type of relationship to traverse.
maxDepth The maximum depth from the start node below which traversal must stop.
costProperty The property that contains the cost of traversal.
defaultCost The default cost of the traversal.
Returns
  • a Collection of PathQueryResult instances, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public void traverseForPathsWithPaging (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)

Perform a paged node traversal, dispatching Path instances to the rest of the flow.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
pageSize The size of the result page.
leaseTimeSeconds The time during which the paged results will be accessible.
muleEvent The MuleEvent being processed.
sourceCallback The SourceCallback invoked for each result page.
Returns
  • a Collection of Node, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public Collection<Relationship> traverseForRelationships (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator)

Perform a node traversal, returning Relationship instances.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
Returns
  • a Collection of Relationship, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.

public void traverseForRelationshipsWithPaging (Node node, TraversalQuery.Order order, TraversalQuery.Uniqueness uniqueness, Integer maxDepth, List<RelationshipQuery> relationships, TraversalScript returnFilter, TraversalScript pruneEvaluator, int pageSize, int leaseTimeSeconds, MuleEvent muleEvent, SourceCallback sourceCallback)

Perform a paged node traversal, dispatching Relationship instances to the rest of the flow.

Parameters
node The start Node.
order The order to visit the nodes.
uniqueness How uniquess should be calculated.
maxDepth The maximum depth from the start node after which results must be pruned.
relationships The relationship types and directions that must be followed.
returnFilter A filter that determines if the current position should be included in the result.
pruneEvaluator An evaluator that determines of traversal should stop or continue.
pageSize The size of the result page.
leaseTimeSeconds The time during which the paged results will be accessible.
muleEvent The MuleEvent being processed.
sourceCallback The SourceCallback invoked for each result page.
Returns
  • a Collection of Node, never null but potentially empty.
Throws
MuleException if anything goes wrong with the operation.