zeus.concepts
Class FIPA_AID_Address

java.lang.Object
  extended byzeus.concepts.FIPA_AID_Address
All Implemented Interfaces:
Address

public class FIPA_AID_Address
extends java.lang.Object
implements Address

FIPA_AID_Address is an implementation of the Address interface that is used to hold addresses of agents that have identified themselves with FIPA format aid's

ISSUES

Resolvers: we don't do them yet, and we might need to. Personally I hate the idea....


Field Summary
private  java.util.Vector addresses
           
private  java.lang.String alias
           
private  boolean forwardSet
           
private  java.lang.String host
           
private  java.lang.String name
           
private  java.lang.String port
           
private  java.lang.String type
           
 
Constructor Summary
FIPA_AID_Address(FIPA_AID_Address copy)
           
FIPA_AID_Address(java.lang.String address)
           
FIPA_AID_Address(java.lang.String name, java.lang.String host)
           
 
Method Summary
 void addAddress(java.lang.String address)
          addAddress could be confusing to the unwary - this method is used to store one of the list of addresses that fipa uses ie.
private  java.lang.String allAddresses()
          all addresses just spits out the content of the addresses vector in a nicely formatted way
 boolean equals(Address addr)
          if this address has the same name value and the same host value return true
protected  java.util.Vector getAddresses()
          getAddresses is protected because I don't want to expose the vector but need access to copy it internally.
 AgentID getAgentID()
          return this zeus.concepts.FIPA_AID_Address rendered as a FIPA.AgentID.
 java.lang.String getAlias()
          retrieve the value of the alias for this address
 boolean getForwardingRuleSet()
          forwarding rules used for zeus housekeeping
 java.lang.String getHost()
          return the host name (ie. the fipa.bt.com bit of acc@fipa.bt.com)
 java.lang.String getName()
          return the name of the agent (ie. the acc bit of acc@fipa.bt.com)
 int getPort()
          this method always returns 900
 java.lang.String getType()
          this method always returns "FIPA_AID"
 java.util.Iterator iterator()
           
 void resetAlias(java.lang.String newVal)
          reset the value of the alias for this address regardless of its current state
 boolean sameAddress(Address addr)
          if the addresses share a host name return true; also return true if the addresses sequence of this address share a common host name and transport WARNING: I am not sure if this is the right behaviour.
 java.lang.String setAlias(java.lang.String possibleValue)
          set the value of the alias for this address that is being used at this time, if the value is already set then return the current value.
 void setForwardingRuleSet(boolean val)
          forwarding rules used for zeus housekeeping
 void setHost(java.lang.String host)
           
 void setName(java.lang.String name)
          set the name field
 void setType(java.lang.String type)
          allow the type to be manipulated
 java.lang.String toFIPAString()
          return a String version in FIPA_AID format
 java.lang.String toString()
          return a zeus address - ie. one that can be handled by Zeus internally.
 java.lang.String toXML()
          return this as XML as per XC00084C
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name

host

private java.lang.String host

port

private java.lang.String port

type

private java.lang.String type

addresses

private java.util.Vector addresses

alias

private java.lang.String alias

forwardSet

private boolean forwardSet
Constructor Detail

FIPA_AID_Address

public FIPA_AID_Address(FIPA_AID_Address copy)

FIPA_AID_Address

public FIPA_AID_Address(java.lang.String address)

FIPA_AID_Address

public FIPA_AID_Address(java.lang.String name,
                        java.lang.String host)
Method Detail

getName

public java.lang.String getName()
return the name of the agent (ie. the acc bit of acc@fipa.bt.com)

Specified by:
getName in interface Address

getHost

public java.lang.String getHost()
return the host name (ie. the fipa.bt.com bit of acc@fipa.bt.com)

Specified by:
getHost in interface Address

getType

public java.lang.String getType()
this method always returns "FIPA_AID"

Specified by:
getType in interface Address

getPort

public int getPort()
this method always returns 900

Specified by:
getPort in interface Address

setAlias

public java.lang.String setAlias(java.lang.String possibleValue)
set the value of the alias for this address that is being used at this time, if the value is already set then return the current value.

if a value is set already this method will not reset it

note, if you want to set an alias with a current value then you should use void resetAlias(String newVal)

See Also:
resetAlias

resetAlias

public void resetAlias(java.lang.String newVal)
reset the value of the alias for this address regardless of its current state


getAlias

public java.lang.String getAlias()
retrieve the value of the alias for this address


equals

public boolean equals(Address addr)
if this address has the same name value and the same host value return true

Specified by:
equals in interface Address

sameAddress

public boolean sameAddress(Address addr)
if the addresses share a host name return true; also return true if the addresses sequence of this address share a common host name and transport

WARNING: I am not sure if this is the right behaviour.

Specified by:
sameAddress in interface Address

toString

public java.lang.String toString()
return a zeus address - ie. one that can be handled by Zeus internally.

Specified by:
toString in interface Address

toFIPAString

public java.lang.String toFIPAString()
return a String version in FIPA_AID format


addAddress

public void addAddress(java.lang.String address)
addAddress could be confusing to the unwary - this method is used to store one of the list of addresses that fipa uses ie.

:addresses (sequence iiop://foo.com/ACC http://foo.com/ACC )

Personally I think that this is all a big mistake, forced on FIPA by the use of agent containers and platforms, which are a big mistake. Still, this is the way the wind is blowing....


allAddresses

private java.lang.String allAddresses()
all addresses just spits out the content of the addresses vector in a nicely formatted way


iterator

public java.util.Iterator iterator()

getAddresses

protected java.util.Vector getAddresses()
getAddresses is protected because I don't want to expose the vector but need access to copy it internally. Use allAddresses() or iterator() as an alternatives


setName

public void setName(java.lang.String name)
Description copied from interface: Address
set the name field

Specified by:
setName in interface Address

setHost

public void setHost(java.lang.String host)

getForwardingRuleSet

public boolean getForwardingRuleSet()
forwarding rules used for zeus housekeeping


setForwardingRuleSet

public void setForwardingRuleSet(boolean val)
forwarding rules used for zeus housekeeping


getAgentID

public AgentID getAgentID()
return this zeus.concepts.FIPA_AID_Address rendered as a FIPA.AgentID. This is might be used by zeus.actors.service.Transport implementors in order to create valid FIPA_99 messages

ISSUES:

No resolvers or userDefinedProperties yet... (29/01/01 - set resolvers and udp's to empty arrays) 02/02/01 removed addresses - is this why FIPA-os acc's can't forward things????


toXML

public java.lang.String toXML()
return this as XML as per XC00084C


setType

public void setType(java.lang.String type)
allow the type to be manipulated

Specified by:
setType in interface Address


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.