|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hypergraphdb.peer.HyperGraphPeer
public class HyperGraphPeer
Main class for the local peer. It will start the peer (set up the interface and register in the network) given a configuration. The class will wrap an existing HyperGraph instance. It is possible to create an instance of this class with an existing HyperGraph, or allow the peer to create its own based on the configuration properties. (if it is needed).
| Constructor Summary | |
|---|---|
HyperGraphPeer(java.io.File configFile)
Creates a peer from a file containing the JSON object |
|
HyperGraphPeer(java.io.File configFile,
HyperGraph graph)
Creates a peer from a file containing the JSON object and a given local database. |
|
HyperGraphPeer(java.util.Map<java.lang.String,java.lang.Object> configuration)
Creates a peer from a JSON object. |
|
HyperGraphPeer(java.util.Map<java.lang.String,java.lang.Object> configuration,
HyperGraph graph)
Creates a peer from a JSON object and a given local database. |
|
| Method Summary | |
|---|---|
void |
bindIdentityToNetworkTarget(HGPeerIdentity id,
java.lang.Object networkTarget)
|
ActivityManager |
getActivityManager()
|
java.util.List<RemotePeer> |
getConnectedPeers()
|
java.util.concurrent.ExecutorService |
getExecutorService()
|
HyperGraph |
getGraph()
|
HGPeerIdentity |
getIdentity()
Return this peer's identity. |
HGPeerIdentity |
getIdentity(java.lang.Object networkTarget)
|
Log |
getLog()
|
java.lang.Object |
getNetworkTarget(HGPeerIdentity id)
|
java.util.Map<java.lang.String,java.lang.Object> |
getObjectContext()
The objectContext is just a peer-global map of objects that
are shared between activities. |
PeerInterface |
getPeerInterface()
|
RemotePeer |
getRemotePeer(java.lang.String peerName)
Returns a remote peer with the given name (if it is connected at that point - otherwise null). |
Subgraph |
getSubgraph(HGHandle handle)
Announces the interests of this peer. |
HyperGraph |
getTempDb()
|
static java.util.Map<java.lang.String,java.lang.Object> |
loadConfiguration(java.io.File configFile)
|
void |
setLog(Log log)
|
boolean |
start(java.lang.String user,
java.lang.String passwd)
Starts the peer and leaves it in a state where all its functions are available. |
void |
stop()
|
void |
unbindNetworkTargetFromIdentity(java.lang.Object networkTarget)
|
void |
updateNetworkProperties()
will broadcast messages and update the peers knowledge of the neighboring peers |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HyperGraphPeer(java.util.Map<java.lang.String,java.lang.Object> configuration)
configuration -
public HyperGraphPeer(java.util.Map<java.lang.String,java.lang.Object> configuration,
HyperGraph graph)
configuration - public HyperGraphPeer(java.io.File configFile)
configFile -
public HyperGraphPeer(java.io.File configFile,
HyperGraph graph)
configFile - | Method Detail |
|---|
public HGPeerIdentity getIdentity()
Return this peer's identity.
public static java.util.Map<java.lang.String,java.lang.Object> loadConfiguration(java.io.File configFile)
public boolean start(java.lang.String user,
java.lang.String passwd)
user - The user name to use when the group is joined.passwd - Password to use to authenticate against the group.
public void stop()
public Subgraph getSubgraph(HGHandle handle)
pred - An atom predicate that needs to be matched by an atom in order for any operations on the atom to be sent to this peer.public void updateNetworkProperties()
public Log getLog()
public void setLog(Log log)
public HyperGraph getGraph()
public java.util.List<RemotePeer> getConnectedPeers()
public RemotePeer getRemotePeer(java.lang.String peerName)
peerName -
public HyperGraph getTempDb()
public ActivityManager getActivityManager()
public PeerInterface getPeerInterface()
public java.util.concurrent.ExecutorService getExecutorService()
public HGPeerIdentity getIdentity(java.lang.Object networkTarget)
public java.lang.Object getNetworkTarget(HGPeerIdentity id)
public void bindIdentityToNetworkTarget(HGPeerIdentity id,
java.lang.Object networkTarget)
public void unbindNetworkTargetFromIdentity(java.lang.Object networkTarget)
public java.util.Map<java.lang.String,java.lang.Object> getObjectContext()
The objectContext is just a peer-global map of objects that
are shared between activities. Such objects can be instantiated at configuration
time by BootstrapPeer implementation and/or create, removed or
modified at a later time. The map is merely a convenience way to store and
refer to such peer-wide objects.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||