org.ow2.jonas.discovery.base.comm
Class DiscEvent

java.lang.Object
  extended by org.ow2.jonas.discovery.base.comm.DiscMessage
      extended by org.ow2.jonas.discovery.base.comm.DiscEvent
All Implemented Interfaces:
Serializable, DiscoveryEvent
Direct Known Subclasses:
ClusterdDiscoveryEvent

public class DiscEvent
extends DiscMessage
implements DiscoveryEvent

Version:
1.0
Author:
Takoua Abdellatif , Adriana Danes
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ow2.jonas.discovery.base.comm.DiscMessage
DISCOVERY_PROTOCOL_VERSION
 
Constructor Summary
DiscEvent(String sourceAddress, int sourcePort, String serverId)
          Constructor.
DiscEvent(String sourceAddress, int sourcePort, String serverName, String domainName, String serverId, String[] connectorURLs)
          Constructor for a Discovery Event.
DiscEvent(String sourceAddress, int sourcePort, String serverName, String domainName, String serverId, String[] connectorURLs, boolean isMaster)
          Constructor for a Discovery Event.
 
Method Summary
 String[] getConnectorURL()
           
 String getDomainName()
          returns domain name.
 String getServerId()
          Gets the server ID.
 String getServerName()
          returns server name.
 String getState()
           
 String[] getUrls()
           
 boolean isDiscoveryMaster()
          Checks if discovery is master.
 boolean isMaster()
           
 void setConnectorURL(String[] connectorURLs)
           
 void setDiscoveryMaster(boolean isDiscoveryMaster)
          Discovery becomes master.
 void setDomainName(String domainName)
          sets the domain name.
 void setServerId(String serverId)
          Sets the server ID.
 void setServerName(String serverName)
          sets the serverName.
 void setState(String state)
          sets the server state : RUNNING or STOPPING.
 void setUrls(String[] urls)
          Sets connector urls of discovery host.
 String toString()
          The string version of the message.
 
Methods inherited from class org.ow2.jonas.discovery.base.comm.DiscMessage
getSourceAddress, getSourcePort, getVersion, setSourceAddress, setSourcePort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscEvent

public DiscEvent(String sourceAddress,
                 int sourcePort,
                 String serverId)
Constructor.

Parameters:
sourceAddress - Discovery address.
sourcePort - Discovery port.
serverId - The serverId for this server.

DiscEvent

public DiscEvent(String sourceAddress,
                 int sourcePort,
                 String serverName,
                 String domainName,
                 String serverId,
                 String[] connectorURLs)
Constructor for a Discovery Event.

Parameters:
sourceAddress - the host address to use to receive a response.
sourcePort - is the port used in the case of a point to point response.
serverName - is Jonas server name.
domainName - is Jonas domain name.
serverId - TODO
connectorURLs - contains the list of all connector urls registered in the mbean server.

DiscEvent

public DiscEvent(String sourceAddress,
                 int sourcePort,
                 String serverName,
                 String domainName,
                 String serverId,
                 String[] connectorURLs,
                 boolean isMaster)
Constructor for a Discovery Event.

Parameters:
sourceAddress - the host address to use to receive a response.
sourcePort - is the port used in the case of a point to point response.
serverName - is Jonas server name.
domainName - is Jonas domain name.
serverId - TODO
connectorURLs - contains the list of all connector urls registered in the mbean server.
isMaster - True id the discovery is master
Method Detail

getServerName

public String getServerName()
returns server name.

Specified by:
getServerName in interface DiscoveryEvent
Returns:
serverName

getDomainName

public String getDomainName()
returns domain name.

Specified by:
getDomainName in interface DiscoveryEvent
Returns:
domain name.

setDomainName

public void setDomainName(String domainName)
sets the domain name.

Parameters:
domainName - the management domain name

setServerName

public void setServerName(String serverName)
sets the serverName.

Parameters:
serverName - the name of the server sending the discovery event

getConnectorURL

public String[] getConnectorURL()
Specified by:
getConnectorURL in interface DiscoveryEvent
Returns:
the connector URLs of the server sending the discovery event

setConnectorURL

public void setConnectorURL(String[] connectorURLs)
Parameters:
connectorURLs - the connector URLs of the server sending the discovery event

getState

public String getState()
Specified by:
getState in interface DiscoveryEvent
Returns:
server state.

setState

public void setState(String state)
sets the server state : RUNNING or STOPPING.

Parameters:
state - state of the server sending the discovery event

toString

public String toString()
The string version of the message.

Overrides:
toString in class DiscMessage
Returns:
the message

getServerId

public String getServerId()
Gets the server ID.

Returns:
Server ID.

setServerId

public void setServerId(String serverId)
Sets the server ID.

Parameters:
serverId - Id of discovery Host.

getUrls

public String[] getUrls()
Returns:
the urls

setUrls

public void setUrls(String[] urls)
Sets connector urls of discovery host.

Parameters:
urls - the urls to set

isDiscoveryMaster

public boolean isDiscoveryMaster()
Checks if discovery is master.

Returns:
True if discovery is master.

setDiscoveryMaster

public void setDiscoveryMaster(boolean isDiscoveryMaster)
Discovery becomes master.

Parameters:
isDiscoveryMaster - the isDiscoveryMaster to set

isMaster

public boolean isMaster()
Returns:
True if discovery is master.


Copyright © 2010 OW2 Consortium. All Rights Reserved.