Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.replication
Class ReplicationPeer
All Implemented Interfaces:
       CommChannelStateListener, ConnectionListener, MessageListener, ReplicationTarget

public class ReplicationPeer      
ReplicationPeers are contained within the local replicator and act as proxies
for remote replicators. When two replicators establish a relationship through
negotiation of services, they create replication peers for each other and
delegate the actual fulfilment of replication services to the peers.
ReplicationPeers are responsible for opening and maintaining of (unicast)
replication channels, as well as sending, receiving and directing the actual
replication traffic.
Author:
dpetroni
Implements:
ReplicationTarget
ConnectionListener
MessageListener
CommChannelStateListener
 
Links:
Kernel Association Association Link
to Class Replicator
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
 
Kernel Association Association Link
to Class Replicant
 
Associates type:
aggregation
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
0..
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
associates:
com.newstep.solid.replication.Replicant
link:
aggregation
 
Kernel Association Association Link
to Interface MessageChannel
Associates type:
aggregation
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
aggregation
 
Implementation Implementation Link
to Interface MessageListener
ReplicationPeers are contained within the local replicator and act as proxies
for remote replicators. When two replicators establish a relationship through
negotiation of services, they create replication peers for each other and
delegate the actual fulfilment of replication services to the peers.
ReplicationPeers are responsible for opening and maintaining of (unicast)
replication channels, as well as sending, receiving and directing the actual
replication traffic.
Author:
dpetroni
 
Implementation Implementation Link
to Interface ReplicationTarget
ReplicationPeers are contained within the local replicator and act as proxies
for remote replicators. When two replicators establish a relationship through
negotiation of services, they create replication peers for each other and
delegate the actual fulfilment of replication services to the peers.
ReplicationPeers are responsible for opening and maintaining of (unicast)
replication channels, as well as sending, receiving and directing the actual
replication traffic.
Author:
dpetroni
 
Implementation Implementation Link
to Interface ConnectionListener
ReplicationPeers are contained within the local replicator and act as proxies
for remote replicators. When two replicators establish a relationship through
negotiation of services, they create replication peers for each other and
delegate the actual fulfilment of replication services to the peers.
ReplicationPeers are responsible for opening and maintaining of (unicast)
replication channels, as well as sending, receiving and directing the actual
replication traffic.
Author:
dpetroni
 
Implementation Implementation Link
to Interface CommChannelStateListener
ReplicationPeers are contained within the local replicator and act as proxies
for remote replicators. When two replicators establish a relationship through
negotiation of services, they create replication peers for each other and
delegate the actual fulfilment of replication services to the peers.
ReplicationPeers are responsible for opening and maintaining of (unicast)
replication channels, as well as sending, receiving and directing the actual
replication traffic.
Author:
dpetroni
 
 

Field Summary
private final static String
private HashMap
private HashMap
private final static Logger
private int
private Replicator
private int
private HashMap
Constructor Summary
protected void
ReplicationPeer(Integer peerId, Replicator parent)
Method Summary
protected void
protected void
protected Replicant
protected int
public boolean
public void
messageReceived(Byte message)
public synchronized void
protected boolean
protected boolean
public boolean
replicate(Capsule newState)
protected synchronized void
startReplication(Replicant replicant, Long clientReplicantId)
public void
Field Detail
className
private final static String className
Final.
Multiplicity:
1
Static.
 

clientReplicants
private HashMap clientReplicants
Multiplicity:
1
 

clientToServer
private HashMap clientToServer
Multiplicity:
1
 

logger
private final static Logger logger
Final.
Multiplicity:
1
Static.
 

remoteId
private int remoteId
Multiplicity:
1
 

replicator
private Replicator replicator
Multiplicity:
1
 

replicatorId
private int replicatorId
Multiplicity:
1
 

serverReplicants
private HashMap serverReplicants
 
Multiplicity:
1
Custom properties
associates:
com.newstep.solid.replication.Replicant
 

unicastChannel
private MessageChannel unicastChannel
Multiplicity:
1
 
Constructor Detail
ReplicationPeer
protected void ReplicationPeer (Integer peerId, Replicator parent)
 
Stereotype:
create
 
Method Detail
addClientReplicant
protected void addClientReplicant (Replicant replicant)
 
 

connect
protected void connect (AccessPoint cap, ChannelEndpoint endpoint)
 
Connects to the remote peer listening on the channel. Server connects to
the client as a confirmation of the initial request. It is invoked only
when there is no connection between the two Replicators.
See Also:
 
Parameters:
channel
channel to use for communication
Throws:
IOException
 

failOver
protected Replicant failOver ()
 
 

getRemoteId
protected int getRemoteId ()
 
 

isConnected
public boolean isConnected ()
 
 

messageReceived
public void messageReceived (Byte message)
 
 

newConnection
public synchronized void newConnection (CommChannel channel)
 
Synchronized.
 

removeClientReplicant
protected boolean removeClientReplicant (Replicant replicant)
 
 

removeServerReplicant
protected boolean removeServerReplicant (Replicant replicant)
 
 

replicate
public boolean replicate (Capsule newState)
 
When a client requests replication services from a remote peer it listens
for a connection from the server and is notified when the connection
happens
 

startReplication
protected synchronized void startReplication (Replicant replicant, Long clientReplicantId)
 
Accepts the client replicant and establishes a client-server relationship
with the local replicant
Parameters:
replicant
local replicant providing replication services
clientReplicantId
id of the remote (client) replicant
Synchronized.
 

stateChanged
public void stateChanged (CommChannelState state)
 
 

Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD