fr.dyade.aaa.agent
Class ServerDesc

java.lang.Object
  extended by fr.dyade.aaa.agent.ServerDesc
All Implemented Interfaces:
java.io.Serializable

public final class ServerDesc
extends java.lang.Object
implements java.io.Serializable

Description of an agent server. It is used by Channel and Network objects. Be careful, this structure is initialized in AgentServer, but it can be viewed outside of the agent package, so it's very important to make all modifiers package.

See Also:
Serialized Form

Field Summary
(package private)  boolean active
          True if there is no waiting messages for this server.
private  MessageConsumer domain
          Domain description of this server.
(package private)  short gateway
          Server Id. of a gateway server for this server if it is not in an adjoining domain.
(package private)  long last
          Date of the last unsuccessful connection to this server.
(package private)  java.lang.String name
          Server name.
(package private)  int retry
          Number of unsuccessful connection to this server.
private static long serialVersionUID
           
(package private)  ServiceDesc[] services
          Description of services running on this server.
(package private)  short sid
          Server unique identifier.
private  java.util.Vector sockAddrs
          The IP address of the server.
 
Constructor Summary
ServerDesc(short sid, java.lang.String name, java.lang.String hostname, int port)
          Constructs a new node for a persistent agent server.
 
Method Summary
(package private)  void addSockAddr(java.lang.String hostname, int port)
           
 java.net.InetAddress getAddr()
          Returns an IP address for its server.
 MessageConsumer getDomain()
           
 java.lang.String getDomainName()
           
 java.lang.Class getDomainType()
           
 short getGateway()
           
 java.lang.String getHostname()
          Gets hostname for this server.
 int getPort()
          Gets port for this server.
 short getServerId()
          Gets server id. for this server.
 java.lang.String getServerName()
          Gets server name for this server.
 ServiceDesc[] getServices()
          Gets the description of services running on this server.
(package private)  java.util.Enumeration getSockAddrs()
          In case of an HA server, gets the IP address of all the components of the HA configuration.
(package private)  void moveToFirst(SocketAddress addr)
          In case of an HA server, selects the IP address as this of the master component of the HA configuration.
 java.net.InetAddress resetAddr()
          Resolves an IP address for its server, don't use an eventually caching address.
 void setDomain(MessageConsumer domain)
           
 void setGateway(short id)
           
 java.lang.String toString()
          Provides a string image for this object.
 void updateSockAddr(java.lang.String hostname, int port)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

sid

short sid
Server unique identifier.


name

java.lang.String name
Server name.


sockAddrs

private java.util.Vector sockAddrs
The IP address of the server. It contains hostname and port (SocketAddress) of remote server. The communication port is set only if the server is directly accessible from this node; in this case it corresponds to the communication port of the server in the adjoining domain. The descriptor of an HA server contains one SocketAddress for each of its constituent.


services

transient ServiceDesc[] services
Description of services running on this server.


gateway

short gateway
Server Id. of a gateway server for this server if it is not in an adjoining domain.


domain

private transient MessageConsumer domain
Domain description of this server.


active

transient volatile boolean active
True if there is no waiting messages for this server.


last

transient volatile long last
Date of the last unsuccessful connection to this server.


retry

transient volatile int retry
Number of unsuccessful connection to this server.

Constructor Detail

ServerDesc

public ServerDesc(short sid,
                  java.lang.String name,
                  java.lang.String hostname,
                  int port)
Constructs a new node for a persistent agent server.

Parameters:
sid - the server unique id
name - the server name
hostname - the server hostname
port - the server port
Method Detail

getServerId

public short getServerId()
Gets server id. for this server.

Returns:
the server id.

getServerName

public java.lang.String getServerName()
Gets server name for this server.

Returns:
the server name.

getHostname

public java.lang.String getHostname()
Gets hostname for this server.

Returns:
the hostname.

getPort

public int getPort()
Gets port for this server.

Returns:
the port.

getAddr

public java.net.InetAddress getAddr()
Returns an IP address for its server.

Returns:
an IP address for this server.

resetAddr

public java.net.InetAddress resetAddr()
Resolves an IP address for its server, don't use an eventually caching address.

Returns:
an IP address for this server.

addSockAddr

void addSockAddr(java.lang.String hostname,
                 int port)

updateSockAddr

public void updateSockAddr(java.lang.String hostname,
                           int port)

moveToFirst

void moveToFirst(SocketAddress addr)
In case of an HA server, selects the IP address as this of the master component of the HA configuration.


getSockAddrs

java.util.Enumeration getSockAddrs()
In case of an HA server, gets the IP address of all the components of the HA configuration.


getServices

public ServiceDesc[] getServices()
Gets the description of services running on this server.

Returns:
the description of services.

getGateway

public short getGateway()

setGateway

public void setGateway(short id)

getDomainName

public java.lang.String getDomainName()

getDomainType

public java.lang.Class getDomainType()

toString

public java.lang.String toString()
Provides a string image for this object.

Overrides:
toString in class java.lang.Object
Returns:
printable image of this object

setDomain

public void setDomain(MessageConsumer domain)

getDomain

public MessageConsumer getDomain()


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.