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

com.newstep.solid.comm.rtt
Class RedundantElement
com.newstep.solid.comm.AbstractChannel
  |
  +--com.newstep.solid.comm.ProtocolElement
       |
       +--com.newstep.solid.comm.rtt.RedundantElement
All Implemented Interfaces:
       Channel, ChannelListener, ChannelStatusListener

public class RedundantElement      
Implements:
ChannelStatusListener
 
Links:
Kernel Association Association Link
to Interface Channel
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
0..1
Supplier navigability:
NAVIGABLE
Supplier role:
redChannel
Supplier visibility:
private
 
Kernel Association Association Link
to Interface Channel
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 Enumeration Type
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
 
Implementation Implementation Link
to Interface ChannelStatusListener
 
Generalization Generalization Link
to Class ProtocolElement
 
 

Field Summary
String
private Channel
private static String
private RttState
private String
private Channel
private ConcurrentHashMap
private Type
Constructor Summary
public void
Method Summary
public void
addSecondSubChannel(Channel secondSubChannel)
private void
private void
public void
private void
drainOnAck(Channel channel, Integer ack)
private RttState
public Address
public String
public Channel
public Address
private boolean
public void
public void
private void
private void
setInternalState(RttState state)
public void
setName(String name)
public void
public void
public String
public void
write(Message message)
Field Detail
activeChannel
private Channel activeChannel
Multiplicity:
1
 

className
private static String className
Multiplicity:
1
Static.
 

internalState
private RttState internalState
Multiplicity:
1
 

name
private String name
Multiplicity:
1
 

name
String name
 

redChannel
private Channel redChannel
Multiplicity:
1
 

redChannel
Channel redChannel
 

retransmitQueues
private ConcurrentHashMap retransmitQueues
Multiplicity:
1
 

role
Type role
 

role
private Type role
Multiplicity:
1
 
Constructor Detail
RedundantElement
public void RedundantElement (Channel subChannel)
 
Stereotype:
create
 
Method Detail
addSecondSubChannel
public void addSecondSubChannel (Channel secondSubChannel)
 
Connects the redundant sub channel of this protocol element
Parameters:
secondSubChannel
 

changeActiveChannel
private void changeActiveChannel ()
 
Changes the active channel to the redundant channel
 

cleanUp
private void cleanUp ()
 
Cleans up the internal resources of this element
 

close
public void close ()
 
Channel Interface. Passes the close() downstream
Throws:
ChannelException
 

drainOnAck
private void drainOnAck (Channel channel, Integer ack)
 
Drains the non-acked transmision queues
Parameters:
channel
the channel on which the message came
ack
the sequence number acknoledged
 

getInternalState
private RttState getInternalState ()
 
Retrieves the internal state of the channel
 

getLocalAddress
public Address getLocalAddress ()
 
Channel Interface;
 

getName
public String getName ()
 
 

getRedChannel
public Channel getRedChannel ()
 
Retrieves the redundant channel of this protocol element
Return:
Channel
 

getRemoteAddress
public Address getRemoteAddress ()
 
Channel Interface.
 

hasNackMessages
private boolean hasNackMessages (Channel channel)
 
Checks if the specified channel has not acknowledged messages
Parameters:
channel
Return:
boolean
 

onMessage
public void onMessage (Message message)
 
Channel interface. If the message received is DATA or HEARTBEAT drains
the retransmission queues. Updates the active channel whith the channel
on which the data has been received HEARTBEAT messages are not sent
upstream
 

open
public void open ()
 
Channel Interface. Passes the message donwstream.
Throws:
ChannelException
 

retransmit
private void retransmit (Channel channel)
 
Retransmits the not acked messages for a particular channel
Parameters:
channel
 

setInternalState
private void setInternalState (RttState state)
 
Assigns the internal state of the channel
Parameters:
state
 

setName
public void setName (String name)
 
 

setRole
public void setRole (Type role)
 
Sets the role to client or server
 

statusChanged
public void statusChanged (Channel channel, ChannelState state)
 
ChannelStatusListener Interface. Listens for the state changes from the
elements downstream and takes action. When one of the sub channels chages
state to CLOSED or ERROR tries to retransmit the non-acked messages to
the other channel .
 

toString
public String toString ()
 
The external reprezentation of the channel
 

write
public void write (Message message)
 
Writes the message on the active Channel. If a DATA message, it adds it
to the proper retransmission queue .
Throws:
ChannelException
 

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