public class RestAPIImpl extends Object implements RestAPI
RestAPIInternal.Load
Modifier and Type | Field and Description |
---|---|
static String |
_QUERY_RETURN_NODE |
static String |
GET_REL_TYPES_QUERY |
protected RestRequest |
restRequest |
Constructor and Description |
---|
RestAPIImpl(String uri) |
RestAPIImpl(String uri,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
void |
addLabels(RestNode node,
Collection<String> labels) |
RestNode |
addToCache(RestNode restNode) |
RestRelationship |
addToCache(RestRelationship rel) |
<T extends org.neo4j.graphdb.PropertyContainer> |
addToIndex(T entity,
RestIndex index,
String key,
Object value) |
protected long |
asLong(Map data,
String idKey) |
RequestResult |
batch(Collection<Map<String,Object>> batchRequestData) |
org.neo4j.graphdb.Transaction |
beginTx() |
void |
close() |
<T extends org.neo4j.graphdb.PropertyContainer> |
createIndex(Class<T> type,
String indexName,
Map<String,String> config) |
void |
createIndex(String type,
String indexName,
Map<String,String> config) |
RestNode |
createNode(Map<String,Object> props) |
RestNode |
createNode(Map<String,Object> props,
Collection<String> labels) |
RestRelationship |
createRelationship(org.neo4j.graphdb.Node startNode,
org.neo4j.graphdb.Node endNode,
org.neo4j.graphdb.RelationshipType type,
Map<String,Object> props) |
RestEntity |
createRestEntity(Map data) |
protected RestRequest |
createRestRequest(String uri,
String user,
String password) |
RestTraversalDescription |
createTraversalDescription() |
void |
delete(RestIndex index) |
void |
deleteEntity(RestEntity entity) |
Collection<String> |
getAllLabelNames() |
Set<String> |
getAutoIndexedProperties(Class forClass) |
String |
getBaseUri() |
int |
getDegree(RestNode restNode,
org.neo4j.graphdb.RelationshipType type,
org.neo4j.graphdb.Direction direction) |
RestEntityExtractor |
getEntityExtractor() |
long |
getEntityRefetchTimeInMillis() |
<S extends org.neo4j.graphdb.PropertyContainer> |
getIndex(Class<S> entityType,
String indexName,
String key,
Object value) |
<T extends org.neo4j.graphdb.PropertyContainer> |
getIndex(String indexName) |
RestNode |
getNodeById(long id) |
RestNode |
getNodeById(long id,
RestAPIInternal.Load force) |
RestNode |
getNodeFromCache(long id) |
Collection<String> |
getNodeLabels(long id) |
Iterable<RestNode> |
getNodesByLabel(String label) |
Iterable<RestNode> |
getNodesByLabelAndProperty(String label,
String property,
Object value) |
RestNode |
getOrCreateNode(RestIndex<org.neo4j.graphdb.Node> index,
String key,
Object value,
Map<String,Object> properties,
Collection<String> labels) |
org.neo4j.graphdb.Relationship |
getOrCreateRelationship(org.neo4j.graphdb.Node start,
org.neo4j.graphdb.Node end,
org.neo4j.graphdb.RelationshipType type,
org.neo4j.graphdb.Direction direction,
Map<String,Object> props) |
RestRelationship |
getOrCreateRelationship(RestIndex<org.neo4j.graphdb.Relationship> index,
String key,
Object value,
RestNode start,
RestNode end,
String type,
Map<String,Object> properties) |
RestRelationship |
getRelationshipById(long id) |
RestRelationship |
getRelationshipById(long id,
RestAPIInternal.Load force) |
Iterable<org.neo4j.graphdb.Relationship> |
getRelationships(RestNode restNode,
org.neo4j.graphdb.Direction direction,
org.neo4j.graphdb.RelationshipType... types) |
Iterable<org.neo4j.graphdb.RelationshipType> |
getRelationshipTypes() |
Iterable<org.neo4j.graphdb.RelationshipType> |
getRelationshipTypes(RestNode node) |
RestRelationship |
getRelFromCache(long id) |
RestRequest |
getRestRequest() |
boolean |
hasToUpdate(long lastUpdate) |
RestIndexManager |
index() |
IndexInfo |
indexInfo(String indexType) |
String |
indexPath(Class entityType,
String indexName) |
String |
indexPath(Class entityType,
String indexName,
String key,
Object value) |
protected <T extends org.neo4j.graphdb.PropertyContainer> |
indexPath(String indexPath,
T restEntity) |
boolean |
isAutoIndexingEnabled(Class<? extends org.neo4j.graphdb.PropertyContainer> clazz) |
RestNode |
merge(String labelName,
String key,
Object value,
Map<String,Object> nodeProperties,
Collection<String> labels) |
<T extends org.neo4j.graphdb.PropertyContainer> |
putIfAbsent(T entity,
RestIndex index,
String key,
Object value) |
CypherResult |
query(String statement,
Map<String,Object> params) |
QueryResult<Map<String,Object>> |
query(String statement,
Map<String,Object> params,
ResultConverter resultConverter) |
<S extends org.neo4j.graphdb.PropertyContainer> |
queryIndex(Class<S> entityType,
String indexName,
String key,
Object value) |
<T extends org.neo4j.graphdb.PropertyContainer> |
removeFromIndex(RestIndex index,
T entity) |
<T extends org.neo4j.graphdb.PropertyContainer> |
removeFromIndex(RestIndex index,
T entity,
String key) |
<T extends org.neo4j.graphdb.PropertyContainer> |
removeFromIndex(RestIndex index,
T entity,
String key,
Object value) |
void |
removeLabel(RestNode node,
String label) |
protected Collection<org.neo4j.graphdb.Node> |
removeMissingRelationships(org.neo4j.graphdb.Node node,
Collection<org.neo4j.graphdb.Node> targetNodes,
org.neo4j.graphdb.RelationshipType type,
org.neo4j.graphdb.Direction direction,
org.neo4j.graphdb.Label targetLabel) |
void |
removeNodeFromCache(long id) |
void |
removeProperty(RestEntity entity,
String key) |
void |
removeRelFromCache(long id) |
void |
resetIndex(Class type) |
void |
setAutoIndexingEnabled(Class<? extends org.neo4j.graphdb.PropertyContainer> clazz,
boolean enabled) |
void |
setEntityRefetchTimeInMillis(long entityRefetchTimeInMillis) |
void |
setPropertiesOnEntity(RestEntity entity,
Map<String,Object> properties) |
void |
setPropertyOnEntity(RestEntity entity,
String key,
Object value) |
void |
startAutoIndexingProperty(Class forClass,
String s) |
void |
stopAutoIndexingProperty(Class forClass,
String s) |
RestTraverser |
traverse(RestNode restNode,
Map<String,Object> description) |
String |
uniqueIndexPath(RestIndex index) |
Iterable<org.neo4j.graphdb.Relationship> |
updateRelationships(org.neo4j.graphdb.Node start,
Collection<org.neo4j.graphdb.Node> endNodes,
org.neo4j.graphdb.RelationshipType type,
org.neo4j.graphdb.Direction direction,
String targetLabelName) |
Iterable<org.neo4j.graphdb.Relationship> |
wrapRelationships(RequestResult requestResult) |
public static final String _QUERY_RETURN_NODE
public static final String GET_REL_TYPES_QUERY
protected RestRequest restRequest
public RestAPIImpl(String uri)
protected RestRequest createRestRequest(String uri, String user, String password)
public RestIndexManager index()
index
in interface RestAPIIndex
public RestNode getNodeById(long id, RestAPIInternal.Load force)
getNodeById
in interface RestAPIInternal
public RestRelationship getRelationshipById(long id, RestAPIInternal.Load force)
getRelationshipById
in interface RestAPIInternal
public RestNode addToCache(RestNode restNode)
addToCache
in interface RestAPIInternal
public RestRelationship addToCache(RestRelationship rel)
addToCache
in interface RestAPIInternal
public RestNode getNodeFromCache(long id)
getNodeFromCache
in interface RestAPIInternal
public RestRelationship getRelFromCache(long id)
getRelFromCache
in interface RestAPIInternal
public void removeNodeFromCache(long id)
removeNodeFromCache
in interface RestAPIInternal
public void removeRelFromCache(long id)
removeRelFromCache
in interface RestAPIInternal
public RestNode getNodeById(long id)
getNodeById
in interface RestAPI
public RestRelationship getRelationshipById(long id)
getRelationshipById
in interface RestAPI
public RestNode createNode(Map<String,Object> props)
createNode
in interface RestAPI
public RestNode createNode(Map<String,Object> props, Collection<String> labels)
createNode
in interface RestAPI
public RestNode getOrCreateNode(RestIndex<org.neo4j.graphdb.Node> index, String key, Object value, Map<String,Object> properties, Collection<String> labels)
getOrCreateNode
in interface RestAPIIndex
public RestRelationship createRelationship(org.neo4j.graphdb.Node startNode, org.neo4j.graphdb.Node endNode, org.neo4j.graphdb.RelationshipType type, Map<String,Object> props)
createRelationship
in interface RestAPI
public <T extends org.neo4j.graphdb.PropertyContainer> RestIndex<T> getIndex(String indexName)
getIndex
in interface RestAPIIndex
public void createIndex(String type, String indexName, Map<String,String> config)
createIndex
in interface RestAPIIndex
public void resetIndex(Class type)
resetIndex
in interface RestAPIInternal
public <T extends org.neo4j.graphdb.PropertyContainer> RestIndex<T> createIndex(Class<T> type, String indexName, Map<String,String> config)
createIndex
in interface RestAPIIndex
public org.neo4j.graphdb.Relationship getOrCreateRelationship(org.neo4j.graphdb.Node start, org.neo4j.graphdb.Node end, org.neo4j.graphdb.RelationshipType type, org.neo4j.graphdb.Direction direction, Map<String,Object> props)
getOrCreateRelationship
in interface RestAPI
protected Collection<org.neo4j.graphdb.Node> removeMissingRelationships(org.neo4j.graphdb.Node node, Collection<org.neo4j.graphdb.Node> targetNodes, org.neo4j.graphdb.RelationshipType type, org.neo4j.graphdb.Direction direction, org.neo4j.graphdb.Label targetLabel)
public Iterable<org.neo4j.graphdb.Relationship> updateRelationships(org.neo4j.graphdb.Node start, Collection<org.neo4j.graphdb.Node> endNodes, org.neo4j.graphdb.RelationshipType type, org.neo4j.graphdb.Direction direction, String targetLabelName)
updateRelationships
in interface RestAPI
public RestNode merge(String labelName, String key, Object value, Map<String,Object> nodeProperties, Collection<String> labels)
public boolean isAutoIndexingEnabled(Class<? extends org.neo4j.graphdb.PropertyContainer> clazz)
isAutoIndexingEnabled
in interface RestAPIIndex
public void setAutoIndexingEnabled(Class<? extends org.neo4j.graphdb.PropertyContainer> clazz, boolean enabled)
setAutoIndexingEnabled
in interface RestAPIIndex
public Set<String> getAutoIndexedProperties(Class forClass)
getAutoIndexedProperties
in interface RestAPIIndex
public void startAutoIndexingProperty(Class forClass, String s)
startAutoIndexingProperty
in interface RestAPIIndex
public void stopAutoIndexingProperty(Class forClass, String s)
stopAutoIndexingProperty
in interface RestAPIIndex
public void removeLabel(RestNode node, String label)
removeLabel
in interface RestAPI
public Collection<String> getNodeLabels(long id)
public Collection<String> getAllLabelNames()
getAllLabelNames
in interface RestAPI
public Iterable<RestNode> getNodesByLabel(String label)
getNodesByLabel
in interface RestAPI
public Iterable<RestNode> getNodesByLabelAndProperty(String label, String property, Object value)
getNodesByLabelAndProperty
in interface RestAPI
public Iterable<org.neo4j.graphdb.RelationshipType> getRelationshipTypes(RestNode node)
getRelationshipTypes
in interface RestAPI
public int getDegree(RestNode restNode, org.neo4j.graphdb.RelationshipType type, org.neo4j.graphdb.Direction direction)
public Iterable<org.neo4j.graphdb.RelationshipType> getRelationshipTypes()
getRelationshipTypes
in interface RestAPI
public void addLabels(RestNode node, Collection<String> labels)
public RestRequest getRestRequest()
getRestRequest
in interface RestAPIInternal
public RestTraversalDescription createTraversalDescription()
createTraversalDescription
in interface RestAPI
public long getEntityRefetchTimeInMillis()
public String getBaseUri()
getBaseUri
in interface RestAPIInternal
public void setEntityRefetchTimeInMillis(long entityRefetchTimeInMillis)
public Iterable<org.neo4j.graphdb.Relationship> wrapRelationships(RequestResult requestResult)
public RestEntityExtractor getEntityExtractor()
getEntityExtractor
in interface RestAPIInternal
public <S extends org.neo4j.graphdb.PropertyContainer> org.neo4j.graphdb.index.IndexHits<S> getIndex(Class<S> entityType, String indexName, String key, Object value)
getIndex
in interface RestAPIIndex
public <S extends org.neo4j.graphdb.PropertyContainer> org.neo4j.graphdb.index.IndexHits<S> queryIndex(Class<S> entityType, String indexName, String key, Object value)
queryIndex
in interface RestAPIIndex
public void deleteEntity(RestEntity entity)
deleteEntity
in interface RestAPI
public IndexInfo indexInfo(String indexType)
indexInfo
in interface RestAPIIndex
public void setPropertyOnEntity(RestEntity entity, String key, Object value)
setPropertyOnEntity
in interface RestAPI
public void setPropertiesOnEntity(RestEntity entity, Map<String,Object> properties)
setPropertiesOnEntity
in interface RestAPI
public void delete(RestIndex index)
delete
in interface RestAPIIndex
public <T extends org.neo4j.graphdb.PropertyContainer> void removeFromIndex(RestIndex index, T entity, String key, Object value)
removeFromIndex
in interface RestAPIIndex
protected <T extends org.neo4j.graphdb.PropertyContainer> String indexPath(String indexPath, T restEntity)
public <T extends org.neo4j.graphdb.PropertyContainer> void removeFromIndex(RestIndex index, T entity, String key)
removeFromIndex
in interface RestAPIIndex
public <T extends org.neo4j.graphdb.PropertyContainer> void removeFromIndex(RestIndex index, T entity)
removeFromIndex
in interface RestAPIIndex
public <T extends org.neo4j.graphdb.PropertyContainer> void addToIndex(T entity, RestIndex index, String key, Object value)
addToIndex
in interface RestAPIIndex
public <T extends org.neo4j.graphdb.PropertyContainer> T putIfAbsent(T entity, RestIndex index, String key, Object value)
putIfAbsent
in interface RestAPIIndex
public boolean hasToUpdate(long lastUpdate)
hasToUpdate
in interface RestAPIInternal
public void removeProperty(RestEntity entity, String key)
removeProperty
in interface RestAPI
public RestRelationship getOrCreateRelationship(RestIndex<org.neo4j.graphdb.Relationship> index, String key, Object value, RestNode start, RestNode end, String type, Map<String,Object> properties)
getOrCreateRelationship
in interface RestAPIIndex
public CypherResult query(String statement, Map<String,Object> params)
public Iterable<org.neo4j.graphdb.Relationship> getRelationships(RestNode restNode, org.neo4j.graphdb.Direction direction, org.neo4j.graphdb.RelationshipType... types)
getRelationships
in interface RestAPI
public RestTraverser traverse(RestNode restNode, Map<String,Object> description)
public QueryResult<Map<String,Object>> query(String statement, Map<String,Object> params, ResultConverter resultConverter)
public RestEntity createRestEntity(Map data)
createRestEntity
in interface RestAPIInternal
public RequestResult batch(Collection<Map<String,Object>> batchRequestData)
Copyright © 2011-2015–2015 Pivotal Software, Inc.. All rights reserved.