fr.dyade.aaa.agent
Class AdminEventListenerId

java.lang.Object
  extended byfr.dyade.aaa.agent.AdminEventListenerId
All Implemented Interfaces:
java.io.Serializable

public class AdminEventListenerId
extends java.lang.Object
implements java.io.Serializable

The type of listener of an event, can be a Role or a couple <@ip,port>

See Also:
Serialized Form

Field Summary
 java.net.InetAddress address
          the InetAdress of the listener (if DISTANT_LISTENER)
static short DISTANT_LISTENER
           
 AgentId id
          the AgentId of the listener (if LOCAL_LISTENER)
static short LOCAL_LISTENER
           
static short NULL_LISTENER
           
 int port
          the port number of the listener (if DISTANT_LISTENER)
 short type
          the type of listener: AgentId or distant Agent (= @ip, port number)
 
Constructor Summary
AdminEventListenerId(short type)
          construct a listener (can be an AgentId or a couple <@ip, port number>)
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares two objects for equality.
 void setListener(AgentId id)
          Sets the listener id.
 void setListener(java.net.InetAddress address, int port)
          Sets the listener address.
 java.lang.String toString()
          Provides a string image for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_LISTENER

public static final short NULL_LISTENER
See Also:
Constant Field Values

DISTANT_LISTENER

public static final short DISTANT_LISTENER
See Also:
Constant Field Values

LOCAL_LISTENER

public static final short LOCAL_LISTENER
See Also:
Constant Field Values

type

public short type
the type of listener: AgentId or distant Agent (= @ip, port number)


id

public AgentId id
the AgentId of the listener (if LOCAL_LISTENER)


address

public java.net.InetAddress address
the InetAdress of the listener (if DISTANT_LISTENER)


port

public int port
the port number of the listener (if DISTANT_LISTENER)

Constructor Detail

AdminEventListenerId

public AdminEventListenerId(short type)
construct a listener (can be an AgentId or a couple <@ip, port number>)

Parameters:
type - DISTANT_LISTENER or LOCAL_LISTENER
Method Detail

setListener

public void setListener(AgentId id)
                 throws java.lang.Exception
Sets the listener id. If the listener type is DISTANT_LISTENER, returns an exception.

Parameters:
id - the agent id of the listener
Throws:
java.lang.Exception - when type is not LOCAL_LISTENER

setListener

public void setListener(java.net.InetAddress address,
                        int port)
                 throws java.lang.Exception
Sets the listener address. If the listener type is LOCAL_LISTENER, returns an exception.

Parameters:
address - the IP address of the distant listener
port - the port number of the distant listener
Throws:
java.lang.Exception - when type is not DISTANT_LISTENER

toString

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

Returns:
a string image for this object

equals

public boolean equals(java.lang.Object obj)
Compares two objects for equality.

Parameters:
obj - the reference object with which to compare
Returns:
true if this object is the same as the obj argument; false otherwise


Copyright © 2004 Scalagent - All rights reserved