JXTA

net.jxta.protocol
Class PipeAdvertisement

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

public abstract class PipeAdvertisement
extends ExtendableAdvertisement
implements Cloneable

Describes a JXTA Pipe. A pipe is described by a pipe id and by a pipe type. A pipe can also optionally have a name and/or a description.

See Also:
PipeService, JXTA Protocols Specification : Pipe Binding Protocol

Field Summary
static String descTag
          XML tag to store the name of the Pipe
static String IdTag
          XML tag to store the PipeID
static String NameTag
          XML tag to store the name of the Pipe
static String TypeTag
          XML tag to store the Pipe Type
 
Constructor Summary
PipeAdvertisement()
           
 
Method Summary
 PipeAdvertisement clone()
          
 boolean equals(Object obj)
          
static String getAdvertisementType()
          Returns the identifying type of this Advertisement.
 String getBaseAdvType()
          Returns the base type of this advertisement hierarchy.
 StructuredDocument getDesc()
          Return the description meta-data for the pipe described by this advertisement.
 String getDescription()
          Returns the description
 ID getID()
          Returns an ID which identifies this Advertisement as uniquely as possible.
 String getName()
          Return the symbolic name for the pipe described by this advertisement.
 ID getPipeID()
          Return the pipe ID for the pipe described by this advertisement.
 String getType()
          Return the pipe type for the pipe described by this advertisement.
 int hashCode()
          
 void setDesc(Element desc)
          Set the description meta-data for the pipe described by this advertisement.
 void setDescription(String description)
          Set the description meta-data for the pipe described by this advertisement.
 void setName(String name)
          Set the symbolic name for the pipe described by this advertisement.
 void setPipeID(ID pipeId)
          Set the pipe ID for the pipe described by this advertisement.
 void setType(String type)
          Set the pipe type for the pipe described by this advertisement.
 
Methods inherited from class net.jxta.document.ExtendableAdvertisement
getDocument, handleAttribute, handleElement
 
Methods inherited from class net.jxta.document.Advertisement
getAdvType, getIndexFields, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IdTag

public static final String IdTag
XML tag to store the PipeID

See Also:
Constant Field Values

TypeTag

public static final String TypeTag
XML tag to store the Pipe Type

See Also:
Constant Field Values

NameTag

public static final String NameTag
XML tag to store the name of the Pipe

See Also:
Constant Field Values

descTag

public static final String descTag
XML tag to store the name of the Pipe

See Also:
Constant Field Values
Constructor Detail

PipeAdvertisement

public PipeAdvertisement()
Method Detail

getAdvertisementType

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

Returns:
String the type of advertisement

clone

public PipeAdvertisement clone()

Overrides:
clone in class Advertisement

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

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.

getID

public ID getID()
Returns an ID which identifies this Advertisement as uniquely as possible. This ID is typically used as the primary key for indexing of the Advertisement within databases.

Each advertisement sub-class must choose an appropriate implementation which returns canonical and relatively unique ID values for it's instances. Since this ID is commonly used for indexing, the IDs returned must be as unique as possible to avoid collisions. The value for the ID returned can either be:

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: uninitialized index fields). Instead IllegalStateException should be thrown.

The PipeID uniquely identifies this ADV.

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

getPipeID

public ID getPipeID()
Return the pipe ID for the pipe described by this advertisement.

Returns:
The pipe ID for the pipe described by this advertisement.

setPipeID

public void setPipeID(ID pipeId)
Set the pipe ID for the pipe described by this advertisement.

Parameters:
pipeId - The pipe ID for the pipe described by this advertisement.

getType

public String getType()
Return the pipe type for the pipe described by this advertisement.

Returns:
The pipe type for the pipe described by this advertisement.

setType

public void setType(String type)
Set the pipe type for the pipe described by this advertisement.

Parameters:
type - The pipe type for the pipe described by this advertisement.

getName

public String getName()
Return the symbolic name for the pipe described by this advertisement.

Returns:
String The symbolic name for the pipe described by this advertisement.

setName

public void setName(String name)
Set the symbolic name for the pipe described by this advertisement.

Parameters:
name - The symbolic name for the pipe described by this advertisement.

getDescription

public String getDescription()
Returns the description

Returns:
String the description

setDescription

public void setDescription(String description)
Set the description meta-data for the pipe described by this advertisement.

Parameters:
description - The description meta-data for the pipe described by this advertisement.

getDesc

public StructuredDocument getDesc()
Return the description meta-data for the pipe described by this advertisement.

Returns:
The description meta-data for the pipe described by this advertisement.

setDesc

public void setDesc(Element desc)
Set the description meta-data for the pipe described by this advertisement.

Parameters:
desc - The description meta-data for the pipe described by this advertisement.

JXSE