JXTA

net.jxta.impl.protocol
Class PlatformConfig

java.lang.Object
  extended by net.jxta.document.Advertisement
      extended by net.jxta.document.ExtendableAdvertisement
          extended by net.jxta.protocol.ConfigParams
              extended by net.jxta.impl.protocol.GroupConfig
                  extended by net.jxta.impl.protocol.PlatformConfig
All Implemented Interfaces:
Cloneable

public final class PlatformConfig
extends GroupConfig
implements Cloneable

Configuration container for the World Peer Group. For historical reasons the same configuration container and instance is also used for the Net Peer Group.


Nested Class Summary
static class PlatformConfig.Instantiator
          Instantiator for PlatformConfig
 
Field Summary
 
Fields inherited from class net.jxta.protocol.ConfigParams
modCount
 
Constructor Summary
PlatformConfig()
          Use the Instantiator through the factory
PlatformConfig(XMLElement doc)
          Use the Instantiator through the factory
 
Method Summary
 boolean addDocumentElements(StructuredDocument adv)
          Return the advertisement as a document.
 PlatformConfig clone()
          Make a safe clone of this PlatformConfig.
 boolean equals(Object other)
          
static String getAdvertisementType()
          returns the advertisement type
 String getAdvType()
          Returns the identifying type of this Advertisement.
 String getDebugLevel()
          Deprecated. The debug level is no longer set via this api. See Logging.
 StructuredDocument getDesc()
          Returns the description
 String getDescription()
          returns the description
 ID getID()
          Returns a unique ID for that peer X group intersection.
 String getName()
          returns the name of the peer.
 PeerID getPeerID()
          Returns the id of the peer.
protected  boolean handleElement(Element raw)
          Process an individual element from the document during parse.
 void setDebugLevel(String debugLevel)
          Deprecated. The debug level is no longer set via this api. See Logging.
 void setDesc(Element desc)
          Sets the description
 void setDescription(String description)
          Sets the description
 void setName(String name)
          sets the name of the peer.
 void setPeerID(PeerID pid)
          Sets the peer ID to use for this peer.
 
Methods inherited from class net.jxta.impl.protocol.GroupConfig
getDocument, getIndexFields
 
Methods inherited from class net.jxta.protocol.ConfigParams
getBaseAdvType, getModCount, getServiceParam, getServiceParamsEntrySet, getSvcConfigAdvertisement, incModCount, isSvcEnabled, putServiceParam, removeServiceParam, removeSvcConfigAdvertisement, setSvcConfigAdvertisement, setSvcConfigAdvertisement
 
Methods inherited from class net.jxta.document.ExtendableAdvertisement
handleAttribute
 
Methods inherited from class net.jxta.document.Advertisement
toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlatformConfig

PlatformConfig()
Use the Instantiator through the factory


PlatformConfig

PlatformConfig(XMLElement doc)
Use the Instantiator through the factory

Parameters:
doc - the element
Method Detail

clone

public PlatformConfig clone()
Make a safe clone of this PlatformConfig.

Overrides:
clone in class GroupConfig
Returns:
Object an object of class PlatformConfig that is a deep-enough copy of this one.

equals

public boolean equals(Object other)

Overrides:
equals in class ConfigParams

getAdvertisementType

public static String getAdvertisementType()
returns the advertisement type

Returns:
string type

getAdvType

public String getAdvType()
Returns the identifying type of this Advertisement. Unlike Advertisement.getAdvertisementType() this method will return the correct runtime type of an Advertisement object.

This implementation is provided for existing advertisements which do not provide their own implementation. In most cases you should provide your own implementation for efficiency reasons.

Overrides:
getAdvType in class GroupConfig
Returns:
The identifying type of this Advertisement.

getName

public String getName()
returns the name of the peer.

Returns:
String name of the peer.

setName

public void setName(String name)
sets the name of the peer.

Parameters:
name - name of the peer.

getPeerID

public PeerID getPeerID()
Returns the id of the peer.

Returns:
PeerID the peer id

setPeerID

public void setPeerID(PeerID pid)
Sets the peer ID to use for this peer.

Parameters:
pid - The peer ID to use for this peer.

getID

public ID getID()
Returns a unique ID for that peer X group intersection. This is for indexing purposes only.

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

getDescription

public String getDescription()
returns the description

Returns:
String the description

setDescription

public void setDescription(String description)
Sets the description

Parameters:
description - the description

getDesc

public StructuredDocument getDesc()
Returns the description

Returns:
the description

setDesc

public void setDesc(Element desc)
Sets the description

Parameters:
desc - the description

getDebugLevel

@Deprecated
public String getDebugLevel()
Deprecated. The debug level is no longer set via this api. See Logging.

returns the debugLevel

Returns:
String the debugLevel

setDebugLevel

@Deprecated
public void setDebugLevel(String debugLevel)
Deprecated. The debug level is no longer set via this api. See Logging.

Sets the debugLevel

Parameters:
debugLevel - the debugLevel

handleElement

protected boolean handleElement(Element raw)
Process an individual element from the document during parse. Normally, implementations will allow the base advertisements a chance to handle the element before attempting to handle the element themselves. ie.


  protected boolean handleElement(Element elem) {

      if (super.handleElement()) {
           // it's been handled.
           return true;
           }
      ... handle elements here ...

      // we don't know how to handle the element
      return false;
      }
  

Overrides:
handleElement in class ConfigParams
Parameters:
raw - The element to be processed.
Returns:
true if the element was recognized, otherwise false.

addDocumentElements

public boolean addDocumentElements(StructuredDocument adv)
Return the advertisement as a document.

Overrides:
addDocumentElements in class ConfigParams
Parameters:
adv - the document to add elements to.
Returns:
true if elements were added otherwise false.

JXSE