public class HyperGraphPeer
extends java.lang.Object
Constructor and Description |
---|
HyperGraphPeer(Json configuration)
Creates a peer from a JSON object.
|
HyperGraphPeer(Json configuration,
HyperGraph graph)
Creates a peer from a JSON object and a given local database.
|
Modifier and Type | Method and Description |
---|---|
void |
addPeerPresenceListener(PeerPresenceListener listener) |
void |
bindIdentityToNetworkTarget(HGPeerIdentity id,
java.lang.Object networkTarget) |
ActivityManager |
getActivityManager() |
Json |
getConfiguration() |
java.util.Set<HGPeerIdentity> |
getConnectedPeers() |
java.util.concurrent.ExecutorService |
getExecutorService() |
HyperGraph |
getGraph() |
HGPeerIdentity |
getIdentity()
Return this peer's identity.
|
static HGPeerIdentity |
getIdentity(HyperGraph graph,
java.lang.String peerName) |
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() |
java.lang.Exception |
getStartupFailedException()
Return the exception (if any) that prevents this peer from starting up.
|
StorageGraph |
getSubgraph(HGHandle handle)
Announces the interests of this peer.
|
static Json |
loadConfiguration(java.io.File configFile) |
void |
removePeerPresenceListener(PeerPresenceListener listener) |
void |
setLog(Log log) |
java.util.concurrent.Future<java.lang.Boolean> |
start()
Starts the peer and leaves it in a state where all its functions are available.
|
java.util.concurrent.Future<java.lang.Boolean> |
start(java.lang.String ignored1,
java.lang.String ignored2)
Deprecated.
|
void |
stop() |
void |
unbindNetworkTargetFromIdentity(java.lang.Object networkTarget) |
void |
updateNetworkProperties()
will broadcast messages and update the peers knowledge of the neighboring peers
|
public HyperGraphPeer(Json configuration)
configuration
- public HyperGraphPeer(Json configuration, HyperGraph graph)
configuration
- public static HGPeerIdentity getIdentity(HyperGraph graph, java.lang.String peerName)
public HGPeerIdentity getIdentity()
Return this peer's identity.
public static Json loadConfiguration(java.io.File configFile)
public java.util.concurrent.Future<java.lang.Boolean> start(java.lang.String ignored1, java.lang.String ignored2)
Return start()
, parameters ignored.
public java.util.concurrent.Future<java.lang.Boolean> start()
user
- The user name to use when the group is joined.passwd
- Password to use to authenticate against the group.public void stop()
public StorageGraph 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.Set<HGPeerIdentity> getConnectedPeers()
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.
public Json getConfiguration()
public java.lang.Exception getStartupFailedException()
Return the exception (if any) that prevents this peer from starting up.
public void addPeerPresenceListener(PeerPresenceListener listener)
public void removePeerPresenceListener(PeerPresenceListener listener)