net.hivecell.hive.event.cell
Class AgentDisconnectFromAllCellEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--net.hivecell.hive.event.RemoteEvent
              |
              +--net.hivecell.hive.event.HiveEvent
                    |
                    +--net.hivecell.hive.event.cell.CellEvent
                          |
                          +--net.hivecell.hive.event.cell.AgentDisconnectFromAllCellEvent

public class AgentDisconnectFromAllCellEvent
extends CellEvent

This encapsulates an agent connect server event. Usually, the sourceAddress and the destinationAddrses are null as set by the CellEventMonitor. When the AgentMonitoringAgent rebroadcasts these events out -- it will set these appropriatly from its cache

See Also:
Serialized Form

Fields inherited from class net.hivecell.hive.event.cell.CellEvent
AGENTBORN, AGENTDISCONNECTALL, AGENTDYING, AGENTMESSAGE, AGENTMOVINGFROM, AGENTMOVINGTO, AGENTSCONNECT, AGENTSDISCONNECT, eventCount, SERVERBORN, serverEventCode, SERVERGOINGDOWN, SERVERREPORT, SERVERWITHDRAWN, source
 
Fields inherited from class net.hivecell.hive.event.HiveEvent
ALL_EVENTS
 
Fields inherited from class net.hivecell.hive.event.RemoteEvent
eventID
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
AgentDisconnectFromAllCellEvent(java.lang.Object broadcastingAgent, long eventCount, Agent agent)
           
AgentDisconnectFromAllCellEvent(java.lang.Object broadcastingAgent, long eventCount, Agent agent, CellAddress address)
          Create an agent from all disconnect server event.
 
Method Summary
 CellEvent createNewEvent(java.lang.Object newSender, long eventCount)
          This method is used so a new CellEvent type can be created with this data, but with a different source and a different count
 Agent getAgent()
          Get the handle to the agent which has started the disconnection
 CellAddress getAgentAddress()
          Get the cell address of the agent.
 CellAddress[] getCellAddresses()
          This methoud should return all the servers taht this server event pertains to -- "pertains to" is defined by the server event itself
 boolean matchesCellAddress(CellAddress toTest)
          This method should return true if the cell address that it comparing with pertains to this server event -- it will return false otherwise
 
Methods inherited from class net.hivecell.hive.event.cell.CellEvent
addPassThrough, eventCode, passedThrough
 
Methods inherited from class net.hivecell.hive.event.HiveEvent
getCount, getEventData, getEventTime, getRegistrationObject, getSource, toString
 
Methods inherited from class net.hivecell.hive.event.RemoteEvent
getID, getSequenceNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentDisconnectFromAllCellEvent

public AgentDisconnectFromAllCellEvent(java.lang.Object broadcastingAgent,
                                       long eventCount,
                                       Agent agent,
                                       CellAddress address)
Create an agent from all disconnect server event.
Parameters:
broadcastingAgent - the agent which is going to be sending out this event
eventCount - the number of event which the helper is going to send out
agent - the agent which is originating the disconnection

AgentDisconnectFromAllCellEvent

public AgentDisconnectFromAllCellEvent(java.lang.Object broadcastingAgent,
                                       long eventCount,
                                       Agent agent)
Method Detail

getAgent

public Agent getAgent()
Get the handle to the agent which has started the disconnection
Returns:
the handle to the agent

getAgentAddress

public CellAddress getAgentAddress()
Get the cell address of the agent. There is no guarantee that this will not return null -- it depends on whether or not the appropriate constructor was called
Returns:
the cell address of the agent

matchesCellAddress

public boolean matchesCellAddress(CellAddress toTest)
Description copied from class: CellEvent
This method should return true if the cell address that it comparing with pertains to this server event -- it will return false otherwise
Overrides:
matchesCellAddress in class CellEvent
Tags copied from class: CellEvent
Parameters:
toTest - the address to test on
Returns:
true if the toTest pertains to this server event

getCellAddresses

public CellAddress[] getCellAddresses()
Description copied from class: CellEvent
This methoud should return all the servers taht this server event pertains to -- "pertains to" is defined by the server event itself
Overrides:
getCellAddresses in class CellEvent
Tags copied from class: CellEvent
Returns:
an array of server addresses this event pertains to

createNewEvent

public CellEvent createNewEvent(java.lang.Object newSender,
                                long eventCount)
Description copied from class: CellEvent
This method is used so a new CellEvent type can be created with this data, but with a different source and a different count
Overrides:
createNewEvent in class CellEvent
Tags copied from class: CellEvent
Parameters:
newSender - the new sender to create a server event with
eventCount - the new event count
Returns:
a new server event with the new senders and the count