Project JXTA

net.jxta.protocol
Class AccessPointAdvertisement

java.lang.Object
  extended by net.jxta.document.Advertisement
      extended by net.jxta.document.ExtendableAdvertisement
          extended by net.jxta.protocol.AccessPointAdvertisement
All Implemented Interfaces:
Cloneable

public abstract class AccessPointAdvertisement
extends ExtendableAdvertisement
implements Cloneable

A short representation of the physical endpoint addresses available for a specific peer. A peer can have many physical endpoint addresses. One endpoint addresses for each configured network interfaces or protocol (IP, HTTP). The AccessPoint advertisement is a tag field in the route advertisement (see RouteAdvertisement) to describe the endpoints available on the member peer of the peer group.

See Also:
PeerAdvertisement, PeerGroupAdvertisement, RouteAdvertisement

Constructor Summary
AccessPointAdvertisement()
           
 
Method Summary
 void addEndpointAddress(String address)
          add a new EndpointAddresses to the access point
 void addEndpointAddresses(Vector addresses)
          Add a new list of EndpointAddresses to the access point
 Object clone()
          

Make a deep copy.

 boolean contains(EndpointAddress addr)
          Check if the EndpointAddresses is already in the access point
 String display()
          Generate a string that displays an access point information for logging or debugging purpose
 boolean equals(Object target)
          compare if two access points are equals.
 String getAdvBaseType()
          
static String getAdvertisementType()
          Returns the identifying type of this Advertisement.
 Enumeration getEndpointAddresses()
          returns the list of endpoint addresses associated with this access point
 PeerID getPeerID()
          Returns the PeerId of the associated access point.
 Vector getVectorEndpointAddresses()
          Returns the vector of endpoint addresses associated with this access point.
 void removeEndpointAddresses(Vector addresses)
          remove a list of EndpointAddresses from the access point
 void setEndpointAddresses(Vector addresses)
          Sets the list of endpoint addresses associated with this access point
 void setPeerID(PeerID pid)
          Sets the peerId of the associated access point.
 int size()
          return number of endpoint addresses
 
Methods inherited from class net.jxta.document.ExtendableAdvertisement
getBaseAdvType, getDocument, handleElement
 
Methods inherited from class net.jxta.document.Advertisement
getAdvType, getID, getIndexFields, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessPointAdvertisement

public AccessPointAdvertisement()
Method Detail

clone

public Object clone()

Make a deep copy.

Overrides:
clone in class Advertisement

getAdvertisementType

public static String getAdvertisementType()
Returns the identifying type of this Advertisement.

Returns:
String the type of advertisement

getAdvBaseType

public final String getAdvBaseType()


getPeerID

public PeerID getPeerID()
Returns the PeerId of the associated access point.

Returns:
PeerID the peer id

setPeerID

public void setPeerID(PeerID pid)
Sets the peerId of the associated access point.

Parameters:
pid - The id of the peer.

getEndpointAddresses

public Enumeration getEndpointAddresses()
returns the list of endpoint addresses associated with this access point

Returns:
Enumeration list of EndpointAddresses. Warning: The returned enumeration is specified as a list of endpoint addresses represented as String objects.

getVectorEndpointAddresses

public Vector getVectorEndpointAddresses()
Returns the vector of endpoint addresses associated with this access point. The result is a vector of endpoint addresses represented as String objects. The Vector contains the "live" data of this advertisement. It should be modified only with great care.

Returns:
vector of EndpointAddresses respresented as String.

setEndpointAddresses

public void setEndpointAddresses(Vector addresses)
Sets the list of endpoint addresses associated with this access point

Parameters:
addresses - vector of endpoint addresses. Warning: The vector is specified as a vector of endpoint addresses represented as String objects.

addEndpointAddresses

public void addEndpointAddresses(Vector addresses)
Add a new list of EndpointAddresses to the access point

Parameters:
addresses - vector of endpoint addresses to add to the access point. Warning: The vector is specified as a vector of endpoint addresses represented as String objects.

addEndpointAddress

public void addEndpointAddress(String address)
add a new EndpointAddresses to the access point

Parameters:
addresses - endpoint addresses to add to the access point.

removeEndpointAddresses

public void removeEndpointAddresses(Vector addresses)
remove a list of EndpointAddresses from the access point

Parameters:
addresses - vector of endpoint addresses to remove from the access point. Warning: The vector is specified as a vector of endpoint addresses represented as String objects.

contains

public boolean contains(EndpointAddress addr)
Check if the EndpointAddresses is already in the access point

Parameters:
addr - endpoint address to check

display

public String display()
Generate a string that displays an access point information for logging or debugging purpose

Returns:
String return a string containing the access point advertisement

equals

public boolean equals(Object target)
compare if two access points are equals. Equals means the same PID and the same endpoint addresses

Overrides:
equals in class Object
Parameters:
ap - AccessPoint advertisement
Returns:
boolean true or false if the access points are equals or not

size

public int size()
return number of endpoint addresses

Returns:
size number of endpointAddress in the hop

JXTA J2SE