|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.remote.RemoteGraphDatabase
public final class RemoteGraphDatabase
A remote connection to a running Graph Database
instance, providing access to the Neo4j Graph Database API.
| Constructor Summary | |
|---|---|
RemoteGraphDatabase(ConfigurationModule config,
ConnectionTarget site)
Creates a new remote graph database connection. |
|
RemoteGraphDatabase(ConfigurationModule config,
ConnectionTarget site,
String username,
String password)
Creates a new remote graph database connection. |
|
RemoteGraphDatabase(ConfigurationModule config,
String resourceUri)
Create a remote graph database connection. |
|
RemoteGraphDatabase(ConfigurationModule config,
String resourceUri,
String username,
String password)
Create a remote graph database connection. |
|
RemoteGraphDatabase(ConnectionTarget site)
Creates a new remote graph database connection. |
|
RemoteGraphDatabase(ConnectionTarget site,
String username,
String password)
Creates a new remote graph database connection. |
|
RemoteGraphDatabase(String resourceUri)
Create a remote graph database connection. |
|
RemoteGraphDatabase(String resourceUri,
String username,
String password)
Create a remote graph database connection. |
|
| Method Summary | ||
|---|---|---|
Transaction |
beginTx()
Starts a new transaction and associates it with the current thread. |
|
Node |
createNode()
Creates a new node. |
|
boolean |
enableRemoteShell()
Enables remote shell access (with default configuration) to this Neo4j instance, if the Neo4j shell component is available on the classpath. |
|
boolean |
enableRemoteShell(Map<String,Serializable> initialProperties)
Enables remote shell access to this Neo4j instance, if the Neo4j Shell component is available on the classpath. |
|
Iterable<Node> |
getAllNodes()
Returns all nodes in the node space. |
|
Node |
getNodeById(long id)
Looks up a node by id. |
|
Node |
getReferenceNode()
Returns the reference node, which is a "starting point" in the node space. |
|
Relationship |
getRelationshipById(long id)
Looks up a relationship by id. |
|
Iterable<RelationshipType> |
getRelationshipTypes()
Returns all relationship types currently in the underlying store. |
|
KernelEventHandler |
registerKernelEventHandler(KernelEventHandler handler)
Registers handler as a handler for kernel events which
are generated from different places in the lifecycle of the kernel. |
|
static void |
registerProtocol(Transport factory)
Register a ConnectionTarget implementation with a specified protocol. |
|
|
registerTransactionEventHandler(TransactionEventHandler<T> handler)
Registers handler as a handler for transaction events which
are generated from different places in the lifecycle of each
transaction. |
|
void |
shutdown()
Shuts down Neo4j. |
|
KernelEventHandler |
unregisterKernelEventHandler(KernelEventHandler handler)
Unregisters handler from the list of kernel event handlers. |
|
|
unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
Unregisters handler from the list of transaction event handlers. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteGraphDatabase(ConnectionTarget site)
site - The connection layer to be used.
public RemoteGraphDatabase(ConfigurationModule config,
ConnectionTarget site)
config - the ConfigurationModule containing the configurations
of the subsystems of the graph database.site - The connection layer to be used.
public RemoteGraphDatabase(ConnectionTarget site,
String username,
String password)
site - The connection layer to be used.username - the name of the user to log in as on the remote site. (
null means anonymous)password - the password for the user to log in as on the remote site.
public RemoteGraphDatabase(ConfigurationModule config,
ConnectionTarget site,
String username,
String password)
config - the ConfigurationModule containing the configurations
of the subsystems of the graph database.site - The connection layer to be used.username - the name of the user to log in as on the remote site. (
null means anonymous)password - the password for the user to log in as on the remote site.
public RemoteGraphDatabase(String resourceUri)
throws URISyntaxException
resourceUri - the URI where the connection resource is located.
URISyntaxException - if the resource URI is malformed.
public RemoteGraphDatabase(ConfigurationModule config,
String resourceUri)
throws URISyntaxException
config - the ConfigurationModule containing the configurations
of the subsystems of the graph database.resourceUri - the URI where the connection resource is located.
URISyntaxException - if the resource URI is malformed.
public RemoteGraphDatabase(String resourceUri,
String username,
String password)
throws URISyntaxException
resourceUri - the URI where the connection resource is located.username - the name of the user to log in as on the remote site. (
null means anonymous)password - the password for the user to log in as on the remote site.
URISyntaxException - if the resource URI is malformed.
public RemoteGraphDatabase(ConfigurationModule config,
String resourceUri,
String username,
String password)
throws URISyntaxException
config - the ConfigurationModule containing the configurations
of the subsystems of the graph database.resourceUri - the URI where the connection resource is located.username - the name of the user to log in as on the remote site. (
null means anonymous)password - the password for the user to log in as on the remote site.
URISyntaxException - if the resource URI is malformed.| Method Detail |
|---|
public static void registerProtocol(Transport factory)
ConnectionTarget implementation with a specified protocol.
factory - a factory to create the site once it's required.public Transaction beginTx()
GraphDatabaseService
beginTx in interface GraphDatabaseServicepublic Node createNode()
GraphDatabaseService
createNode in interface GraphDatabaseServicepublic Node getNodeById(long id)
GraphDatabaseService
getNodeById in interface GraphDatabaseServiceid - the id of the node
id if foundpublic Relationship getRelationshipById(long id)
GraphDatabaseService
getRelationshipById in interface GraphDatabaseServiceid - the id of the relationship
id if foundpublic Node getReferenceNode()
GraphDatabaseService
getReferenceNode in interface GraphDatabaseServicepublic Iterable<RelationshipType> getRelationshipTypes()
GraphDatabaseServicenode.createRelationshipTo(...). Note that this method is guaranteed to
return all known relationship types, but it does not guarantee that it
won't return more than that (e.g. it can return "historic"
relationship types that no longer have any relationships in the node
space).
getRelationshipTypes in interface GraphDatabaseServicepublic Iterable<Node> getAllNodes()
GraphDatabaseService
getAllNodes in interface GraphDatabaseServicepublic void shutdown()
GraphDatabaseService
shutdown in interface GraphDatabaseServicepublic KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
GraphDatabaseServicehandler as a handler for kernel events which
are generated from different places in the lifecycle of the kernel.
To guarantee proper behaviour the handler should be registered right
after the graph database has been started. If the specified handler
instance has already been registered this method will do nothing.
registerKernelEventHandler in interface GraphDatabaseServicehandler - the handler to receive events about different states
in the kernel lifecycle.
public KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
GraphDatabaseServicehandler from the list of kernel event handlers.
If handler hasn't been registered with
GraphDatabaseService.registerKernelEventHandler(KernelEventHandler) prior to calling
this method an IllegalStateException will be thrown.
After a successful call to this method the handler will no
longer receive any kernel events.
unregisterKernelEventHandler in interface GraphDatabaseServicehandler - the handler to receive events about different states
in the kernel lifecycle.
public <T> TransactionEventHandler<T> registerTransactionEventHandler(TransactionEventHandler<T> handler)
GraphDatabaseServicehandler as a handler for transaction events which
are generated from different places in the lifecycle of each
transaction. To guarantee that the handler gets all events properly
it shouldn't be registered when the application is running (i.e. in the
middle of one or more transactions). If the specified handler instance
has already been registered this method will do nothing.
registerTransactionEventHandler in interface GraphDatabaseServiceT - the type of state object used in the handler, see more
documentation about it at TransactionEventHandler.handler - the handler to receive events about different states
in transaction lifecycles.
public <T> TransactionEventHandler<T> unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
GraphDatabaseServicehandler from the list of transaction event handlers.
If handler hasn't been registered with
GraphDatabaseService.registerTransactionEventHandler(TransactionEventHandler) prior
to calling this method an IllegalStateException will be thrown.
After a successful call to this method the handler will no
longer receive any transaction events.
unregisterTransactionEventHandler in interface GraphDatabaseServiceT - the type of state object used in the handler, see more
documentation about it at TransactionEventHandler.handler - the handler to receive events about different states
in transaction lifecycles.
public boolean enableRemoteShell()
GraphDatabaseServiceenableRemoteShell( null ).
enableRemoteShell in interface GraphDatabaseServicetrue if the shell has been enabled,
false otherwise (false usually
indicates that the shell jar dependency is not on
the classpath)public boolean enableRemoteShell(Map<String,Serializable> initialProperties)
GraphDatabaseServiceorg.neo4j.shell.ShellClient from the Neo4j Shell project.
Typically, the neo4j-shell binary package is used (see neo4j.org/download).
The shell is parameterized by a map of properties passed in to this method. Currently, two properties are used:
port, an Integer describing the port of the RMI
registry where the Neo4j shell will be bound, defaults to
1337
name, the String under which the Neo4j shell
will be bound in the RMI registry, defaults to shell
enableRemoteShell in interface GraphDatabaseServiceinitialProperties - a set of properties that will be used to
configure the remote shell, or null if the
default properties should be used
true if the shell has been enabled,
false otherwise (false usually
indicates that the shell jar dependency is not on
the classpath)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||