Project JXTA

net.jxta.util
Class AdvertisementUtilities

java.lang.Object
  extended by net.jxta.util.AdvertisementUtilities

Deprecated. Will be deprecated soon. Do not use these methods. They contain a number of incorrect assumption that cannot be corrected while maintaining backwards compatibility with programs which already use them.

public final class AdvertisementUtilities
extends Object


Field Summary
static StructuredTextDocument STANDARD_COMPATABILITY
          Deprecated.  
static String STANDARD_PROVIDER
          Deprecated.  
static String STANDARD_URI
          Deprecated.  
 
Method Summary
static byte[] advertisementToBytes(Advertisement advertisement)
          Deprecated. This method should not be used because it produces a result who's encoding is not predictable and may (will) differ from JVM to JVM.
static String advertisementToPlainText(Advertisement advertisement)
          Deprecated. Save a JXTA Advertisement to a Plain Text String
static String advertisementToText(Advertisement advertisement, String mimeType)
          Deprecated. Save a JXTA Advertisement to a String
static String advertisementToXmlText(Advertisement advertisement)
          Deprecated. Equivalent to Advertisement.toString()
static Advertisement bytesToAdvertisement(byte[] buf)
          Deprecated. This method should not be used because it interprets the input using the local default encoding which is not precidcatable and may (will) differ from JVM to JVM.
static void cachePeerAdvertisement(PeerGroup peerGroup, PeerAdvertisement peerAdvertisement)
          Deprecated. Publish and advertisement to the Cache
static ModuleClassAdvertisement createModuleClassAdvertisement(String name, String description)
          Deprecated. Create a ModuleClassAdvertisement
static ModuleImplAdvertisement createModuleImplAdvertisement(ModuleSpecID specID, String code, String description)
          Deprecated. This implementation initializes some fields of the resulting ModuleImplAdvertisement to constant values who's value may not be correct for all circumstances. Consider creating ModuleImpl Advertisements directy in your application.
static ModuleSpecAdvertisement createModuleSpecAdvertisement(String name, ModuleClassAdvertisement moduleClassAdvertisement, StructuredDocument param)
          Deprecated. This implementation incompletely initializes the module spec advertisement. Consider creating Module Spec Advertisements without this method.
static ModuleSpecAdvertisement createModuleSpecAdvertisement(String name, StructuredDocument param)
          Deprecated. This implementation incompletely initializes the module spec advertisement. Consider creating Module Spec Advertisements without this method.
static PipeAdvertisement createPipeAdvertisement()
          Deprecated. Create a Pipe Advertisement
static PipeAdvertisement createPipeAdvertisement(Element root)
          Deprecated. Create a Pipe Advertisement
static PipeAdvertisement createPipeAdvertisement(ID pipeID, String pipeType)
          Deprecated. Create a Pipe Advertisement
static PipeAdvertisement createPipeAdvertisement(PeerGroup peerGroup, String pipeType)
          Deprecated. Create a Pipe Advertisement
static PipeAdvertisement createPipeAdvertisement(PeerGroup peerGroup, String sPipeID, String pipeType, String name)
          Deprecated. Create a Pipe Advertisement
static PipeAdvertisement createPipeAdvertisement(PipeID pipeId, String pipeType)
          Deprecated. Create a Pipe Advertisement
static PipeAdvertisement createPipeAdvertisement(String pipeIdText, String pipeType)
          Deprecated. Create a Pipe Advertisement
static PeerAdvertisement getPeerAdvertisement(Element root)
          Deprecated. These utilities are too specialized for general use.
static PipeAdvertisement getPipeAdvertisement(Element root)
          Deprecated. These utilities are too specialized for general use.
static Advertisement newAdvertisementFromXml(byte[] xmlTextAsBytes)
          Deprecated. This method should not be used because it produces a result who's encoding is not predictable and may (will) differ from JVM to JVM.
static Advertisement newAdvertisementFromXml(String xmlText)
          Deprecated. This method should not be used because it interprets the input using the local default encoding which is not precidcatable and may (will) differ from JVM to JVM.
static Advertisement readAdvertisementFromFile(File file)
          Deprecated. Read a JXTA Advertisement from a File
static Advertisement readAdvertisementFromFile(String fileName)
          Deprecated. Read a JXTA Advertisement from a File
static void saveAdvertisementToFile(Advertisement adv, File file)
          Deprecated. Save a JXTA Advertisement as an XML Document to a File
static void saveAdvertisementToFile(Advertisement adv, String fileName)
          Deprecated. Save a JXTA Advertisement as an XML Document to a File
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD_COMPATABILITY

public static final StructuredTextDocument STANDARD_COMPATABILITY
Deprecated. 

STANDARD_URI

public static final String STANDARD_URI
Deprecated. 
See Also:
Constant Field Values

STANDARD_PROVIDER

public static final String STANDARD_PROVIDER
Deprecated. 
See Also:
Constant Field Values
Method Detail

readAdvertisementFromFile

public static Advertisement readAdvertisementFromFile(String fileName)
                                               throws JxtaException
Deprecated. 
Read a JXTA Advertisement from a File

Parameters:
fileName - The file containing the Advertisement
Returns:
An polymorphic Advertisement object
Throws:
JxtaException - if Unable to parse the Advertisement

readAdvertisementFromFile

public static Advertisement readAdvertisementFromFile(File file)
                                               throws JxtaException
Deprecated. 
Read a JXTA Advertisement from a File

Parameters:
fileName - The file containing the Advertisement
Returns:
An polymorphic Advertisement object
Throws:
JxtaException - if Unable to parse the Advertisement

saveAdvertisementToFile

public static void saveAdvertisementToFile(Advertisement adv,
                                           String fileName)
                                    throws JxtaException
Deprecated. 
Save a JXTA Advertisement as an XML Document to a File

Parameters:
adv - The Advertisement to be saved
fileName - The file to store the Advertisement
Throws:
JxtaException - if Unable to parse the Advertisement

saveAdvertisementToFile

public static void saveAdvertisementToFile(Advertisement adv,
                                           File file)
                                    throws JxtaException
Deprecated. 
Save a JXTA Advertisement as an XML Document to a File

Parameters:
adv - The Advertisement to be saved
fileName - The file to store the Advertisement
Throws:
JxtaException - if Unable to parse the Advertisement

advertisementToBytes

public static byte[] advertisementToBytes(Advertisement advertisement)
                                   throws JxtaException
Deprecated. This method should not be used because it produces a result who's encoding is not predictable and may (will) differ from JVM to JVM.

Save a JXTA Advertisement as an XML Document to an array of bytes

Parameters:
adv - The Advertisement to be saved
Throws:
JxtaException - if Unable to parse the Advertisement

bytesToAdvertisement

public static Advertisement bytesToAdvertisement(byte[] buf)
Deprecated. This method should not be used because it interprets the input using the local default encoding which is not precidcatable and may (will) differ from JVM to JVM.

Convert an array of bytes containing an XML encoded String to an JXTA Advertisement

Parameters:
buf - The source of the advertisement
Returns:
The Advertisement
Throws:
JxtaException - if Unable to parse the Advertisement

advertisementToText

public static String advertisementToText(Advertisement advertisement,
                                         String mimeType)
Deprecated. 
Save a JXTA Advertisement to a String

Parameters:
advertisement - The Advertisement to be converted
mimeType - Type of document to be created

advertisementToPlainText

public static String advertisementToPlainText(Advertisement advertisement)
Deprecated. 
Save a JXTA Advertisement to a Plain Text String

Parameters:
advertisement - The Advertisement to be converted

advertisementToXmlText

public static String advertisementToXmlText(Advertisement advertisement)
Deprecated. Equivalent to Advertisement.toString()

Save a JXTA Advertisement to an XML String

Parameters:
advertisement - The Advertisement to be converted

newAdvertisementFromXml

public static Advertisement newAdvertisementFromXml(byte[] xmlTextAsBytes)
                                             throws JxtaException
Deprecated. This method should not be used because it produces a result who's encoding is not predictable and may (will) differ from JVM to JVM.

Convert an array of bytes containing an XML encoded String to an JXTA Advertisement

Returns:
The Advertisement
Throws:
JxtaException - if Unable to parse the Advertisement

newAdvertisementFromXml

public static Advertisement newAdvertisementFromXml(String xmlText)
                                             throws JxtaException
Deprecated. This method should not be used because it interprets the input using the local default encoding which is not precidcatable and may (will) differ from JVM to JVM.

Convert a String containing an XML encoded String to an JXTA Advertisement

Parameters:
buf - The source of the advertisement
Returns:
The Advertisement
Throws:
JxtaException - if Unable to parse the Advertisement

createPipeAdvertisement

public static PipeAdvertisement createPipeAdvertisement()
Deprecated. 
Create a Pipe Advertisement

Returns:
A new Pipe Advertisement

createPipeAdvertisement

public static PipeAdvertisement createPipeAdvertisement(PipeID pipeId,
                                                        String pipeType)
Deprecated. 
Create a Pipe Advertisement

Parameters:
pipeId - The pipe ID
pipeType - The type of the Pipe
Returns:
A new Pipe Advertisement

createPipeAdvertisement

public static PipeAdvertisement createPipeAdvertisement(String pipeIdText,
                                                        String pipeType)
                                                 throws JxtaException
Deprecated. 
Create a Pipe Advertisement

Parameters:
pipeIdText - The pipe ID
pipeType - The type of the Pipe
Returns:
A new Pipe Advertisement
Throws:
JxtaException

createPipeAdvertisement

public static PipeAdvertisement createPipeAdvertisement(Element root)
Deprecated. 
Create a Pipe Advertisement

Parameters:
root - Element containing a Pipe Advertisement
Returns:
A new Pipe Advertisement

createPipeAdvertisement

public static PipeAdvertisement createPipeAdvertisement(PeerGroup peerGroup,
                                                        String pipeType)
Deprecated. 
Create a Pipe Advertisement

Parameters:
peerGroup - The peerGroup
pipeType - The pipeType
Returns:
A new Pipe Advertisement

createPipeAdvertisement

public static PipeAdvertisement createPipeAdvertisement(ID pipeID,
                                                        String pipeType)
Deprecated. 
Create a Pipe Advertisement

Parameters:
pipeID - The pipeID
pipeType - The pipeType
Returns:
A new Pipe Advertisement

createPipeAdvertisement

public static PipeAdvertisement createPipeAdvertisement(PeerGroup peerGroup,
                                                        String sPipeID,
                                                        String pipeType,
                                                        String name)
                                                 throws JxtaException
Deprecated. 
Create a Pipe Advertisement

Parameters:
peerGroup - The peerGroup
pipeType - The pipeType
name - The Pime Name
Returns:
A new Pipe Advertisement
Throws:
JxtaException

getPipeAdvertisement

public static PipeAdvertisement getPipeAdvertisement(Element root)
Deprecated. These utilities are too specialized for general use.

Create a Pipe Advertisement

Parameters:
element - The Root element containing the Advertisement
Returns:
A new Pipe Advertisement

getPeerAdvertisement

public static PeerAdvertisement getPeerAdvertisement(Element root)
Deprecated. These utilities are too specialized for general use.

Create a Peer Advertisement

Parameters:
element - The Root element containing the Advertisement
Returns:
A new Peer Advertisement

createModuleClassAdvertisement

public static ModuleClassAdvertisement createModuleClassAdvertisement(String name,
                                                                      String description)
Deprecated. 
Create a ModuleClassAdvertisement

Parameters:
name - The name
description - The description
Returns:
An ModuleClassAdvertisement

createModuleSpecAdvertisement

public static ModuleSpecAdvertisement createModuleSpecAdvertisement(String name,
                                                                    StructuredDocument param)
Deprecated. This implementation incompletely initializes the module spec advertisement. Consider creating Module Spec Advertisements without this method.

Create a ModuleSpecAdvertisement

Parameters:
name - The name
param - The param
Returns:
An ModuleSpecAdvertisement

createModuleSpecAdvertisement

public static ModuleSpecAdvertisement createModuleSpecAdvertisement(String name,
                                                                    ModuleClassAdvertisement moduleClassAdvertisement,
                                                                    StructuredDocument param)
Deprecated. This implementation incompletely initializes the module spec advertisement. Consider creating Module Spec Advertisements without this method.

Create a ModuleSpecAdvertisement

Parameters:
name - The name
moduleClassAdvertisement - The moduleClassAdvertisement
param - The param
Returns:
An ModuleSpecAdvertisement

cachePeerAdvertisement

public static void cachePeerAdvertisement(PeerGroup peerGroup,
                                          PeerAdvertisement peerAdvertisement)
                                   throws JxtaException
Deprecated. 
Publish and advertisement to the Cache

Parameters:
peerGroup - The peerGroup
peerAdvertisement - The Advertisement
Throws:
JxtaException - if Unable to cache the Advertisement

createModuleImplAdvertisement

public static ModuleImplAdvertisement createModuleImplAdvertisement(ModuleSpecID specID,
                                                                    String code,
                                                                    String description)
Deprecated. This implementation initializes some fields of the resulting ModuleImplAdvertisement to constant values who's value may not be correct for all circumstances. Consider creating ModuleImpl Advertisements directy in your application.

Create a ModuleImplAdvertisement

Parameters:
specID - The specID
code - The code
description - the advertisement description
Returns:
An ModuleImplAdvertisement

JXTA J2SE