Package fr.dyade.aaa.agent
Class ServerDesc
- java.lang.Object
-
- fr.dyade.aaa.agent.ServerDesc
-
- All Implemented Interfaces:
Serializable
public final class ServerDesc extends Object implements Serializable
Description of an agent server. It is used byChannelandNetworkobjects. 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
Fields Modifier and Type Field Description (package private) booleanactiveTrue if there is no waiting messages for this server.private MessageConsumerdomainDomain description of this server.(package private) shortgatewayServer Identifier of a gateway server for this server if it is not in an adjoining domain.(package private) longlastDate of the last unsuccessful connection to this server.(package private) StringnameServer name.(package private) intretryNumber of unsuccessful connection to this serverprivate static longserialVersionUIDdefine serialVersionUID for interoperability(package private) ServiceDesc[]servicesDescription of services running on this server.(package private) shortsidServer unique identifier.private Vector<SocketAddress>sockAddrsThe IP address of the server.
-
Constructor Summary
Constructors Constructor Description ServerDesc(short sid, String name, String hostname, int port)Constructs a new node for a persistent agent server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddSockAddr(String hostname, int port)InetAddressgetAddr()Returns an IP address for its server.MessageConsumergetDomain()StringgetDomainName()Class<MessageConsumer>getDomainType()shortgetGateway()StringgetHostname()Gets hostname for this server.intgetPort()Gets port for this server.shortgetServerId()Gets server id. for this server.StringgetServerName()Gets server name for this server.ServiceDesc[]getServices()Gets the description of services running on this server.(package private) Enumeration<SocketAddress>getSockAddrs()In case of an HA server, gets the IP address of all the components of the HA configuration.(package private) voidmoveToFirst(SocketAddress addr)In case of an HA server, selects the IP address as this of the master component of the HA configuration.InetAddressresetAddr()Resolves an IP address for its server, don't use an eventually caching address.voidsetDomain(MessageConsumer domain)voidsetGateway(short id)StringtoString()Provides a string image for this object.voidupdateSockAddr(String hostname, int port)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
sid
short sid
Server unique identifier.
-
name
String name
Server name.
-
sockAddrs
private Vector<SocketAddress> 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 oneSocketAddressfor each of its constituent.
-
services
transient ServiceDesc[] services
Description of services running on this server.
-
gateway
short gateway
Server Identifier 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. /!\ Be careful, this counter is incremented in a non-atomic way so its value can be lower than reality. However, this counter is only used to handle the delay between 2 connection attempts.
-
-
Method Detail
-
getServerId
public short getServerId()
Gets server id. for this server.- Returns:
- the server id.
-
getServerName
public String getServerName()
Gets server name for this server.- Returns:
- the server name.
-
getHostname
public String getHostname()
Gets hostname for this server.- Returns:
- the hostname.
-
getPort
public int getPort()
Gets port for this server.- Returns:
- the port.
-
getAddr
public InetAddress getAddr()
Returns an IP address for its server.- Returns:
- an IP address for this server.
-
resetAddr
public 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(String hostname, int port)
-
updateSockAddr
public void updateSockAddr(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.- Parameters:
addr- the socket address.
-
getSockAddrs
Enumeration<SocketAddress> getSockAddrs()
In case of an HA server, gets the IP address of all the components of the HA configuration.- Returns:
- 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 String getDomainName()
-
getDomainType
public Class<MessageConsumer> getDomainType()
-
toString
public String toString()
Provides a string image for this object.
-
setDomain
public void setDomain(MessageConsumer domain)
-
getDomain
public MessageConsumer getDomain()
-
-