Project JXTA

net.jxta.protocol
Class RdvAdvertisement

java.lang.Object
  extended bynet.jxta.document.Advertisement
      extended bynet.jxta.document.ExtendableAdvertisement
          extended bynet.jxta.protocol.RdvAdvertisement

public abstract class RdvAdvertisement
extends ExtendableAdvertisement

This class defines a Rendezvous Advertisement


Field Summary
static String GroupIDTag
           
static String NameTag
           
static String PeerIDTag
           
static String RouteTag
           
static String ServiceNameTag
           
 
Constructor Summary
RdvAdvertisement()
           
 
Method Summary
static String getAdvertisementType()
          Returns the identifying type of this Advertisement.
 String getBaseAdvType()
          Returns the base type of this advertisement hierarchy. Typically, only the most basic advertisement of a type will implement this method and declare it as final.
 PeerGroupID getGroupID()
          get the group id
 ID getID()
          Returns a unique ID suitable for indexing of this Advertisement.

The ID is supposed to be unique and is not guaranteed to be of any particular subclass of ID. Each class of advertisement is responsible for the choice of ID to return. The value for the ID returned can either be:

  • An ID which is already part of the advertisement definition and is relatively unique between advertisements instances. For example, the Peer Advertisement returns the Peer ID.
  • A static CodatID which is generated via some canonical process which will produce the same value each time and different values for different advertisements of the same type.
  • ID.nullID for advertisement types which are not readily indexed.

Since this ID is normally used for indexing, the IDs returned must be as unique as possible to avoid collisions.

For Advertisement types which normally return non-ID.nullID values no ID should be returned when asked to generate an ID while the Advertisement is an inconsistent state (example: unitialized index fields). Instead java.lang.IllegalStateException should be thrown.

 String getName()
          get the symbolic name associated with the rdv
 PeerID getPeerID()
          get the rdv peer id
 RouteAdvertisement getRouteAdv()
          Get the Route Adv.
 String getServiceName()
          get the rdv service name
 void setGroupID(PeerGroupID id)
          set the group Id
 void setName(String n)
          set the symbolic name associated with the rdv
 void setPeerID(PeerID id)
          set the peer Id
 void setRouteAdv(RouteAdvertisement route)
          set the RouteAdvertisement
 void setServiceName(String n)
          set the service name
 
Methods inherited from class net.jxta.document.ExtendableAdvertisement
getDocument, handleElement
 
Methods inherited from class net.jxta.document.Advertisement
clone, getAdvType, getIndexFields, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GroupIDTag

public static final String GroupIDTag
See Also:
Constant Field Values

PeerIDTag

public static final String PeerIDTag
See Also:
Constant Field Values

ServiceNameTag

public static final String ServiceNameTag
See Also:
Constant Field Values

NameTag

public static final String NameTag
See Also:
Constant Field Values

RouteTag

public static final String RouteTag
See Also:
Constant Field Values
Constructor Detail

RdvAdvertisement

public RdvAdvertisement()
Method Detail

getAdvertisementType

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

Returns:
String the type of advertisement

getBaseAdvType

public final String getBaseAdvType()
Returns the base type of this advertisement hierarchy. Typically, only the most basic advertisement of a type will implement this method and declare it as final.

Specified by:
getBaseAdvType in class ExtendableAdvertisement
Returns:
String the base type of advertisements in this hierarchy.

getGroupID

public PeerGroupID getGroupID()
get the group id

Returns:
String PeerGroupID

setGroupID

public void setGroupID(PeerGroupID id)
set the group Id

Returns:
String PeerGroupId

getPeerID

public PeerID getPeerID()
get the rdv peer id

Returns:
PeerID

setPeerID

public void setPeerID(PeerID id)
set the peer Id

Returns:
String PeerId

getServiceName

public String getServiceName()
get the rdv service name

Returns:
String name

setServiceName

public void setServiceName(String n)
set the service name

Returns:
String name

getName

public String getName()
get the symbolic name associated with the rdv

Returns:
String the name field. null is returned if no name has been associated with the advertisement.

setName

public void setName(String n)
set the symbolic name associated with the rdv

Parameters:
n - the name this rdv adv should have.

getRouteAdv

public RouteAdvertisement getRouteAdv()
Get the Route Adv.

Returns:
RouteAdvertisement or null if no

setRouteAdv

public void setRouteAdv(RouteAdvertisement route)
set the RouteAdvertisement

Parameters:
route - RouteAdvertisement

getID

public ID getID()
Returns a unique ID suitable for indexing of this Advertisement.

The ID is supposed to be unique and is not guaranteed to be of any particular subclass of ID. Each class of advertisement is responsible for the choice of ID to return. The value for the ID returned can either be:

Since this ID is normally used for indexing, the IDs returned must be as unique as possible to avoid collisions.

For Advertisement types which normally return non-ID.nullID values no ID should be returned when asked to generate an ID while the Advertisement is an inconsistent state (example: unitialized index fields). Instead java.lang.IllegalStateException should be thrown.

Specified by:
getID in class Advertisement
Returns:
ID An ID that uniquely identifies the advertisement or ID.nullID if this advertisement is of a type that is not normally indexed.

JXTA J2SE