JXTA

net.jxta.share
Class SharePolicyImpl

java.lang.Object
  |
  +--net.jxta.share.SharePolicyImpl

public class SharePolicyImpl
extends java.lang.Object
implements net.jxta.share.SharePolicy


Fields inherited from interface net.jxta.share.SharePolicy
documentName, name
 
Constructor Summary
SharePolicyImpl()
           
 
Method Summary
 net.jxta.document.Advertisement getAdvertisement()
          Returns the advertisment for that service.
 java.io.File getCacheDirectory()
           
 net.jxta.share.ShareStatus getContent(net.jxta.protocol.PeerGroupAdvertisement destPeer, net.jxta.share.ContentId cid)
           
 net.jxta.share.ShareStatus getContent(net.jxta.protocol.PeerGroupAdvertisement destPeer, net.jxta.share.ContentId cid, java.io.File destFile)
           
 net.jxta.share.ShareStatus getContent(net.jxta.protocol.PipeAdvertisement destPipe, net.jxta.share.ContentId cid)
           
 net.jxta.share.ShareStatus getContent(net.jxta.protocol.PipeAdvertisement destPipe, net.jxta.share.ContentId cid, java.io.File destFile)
           
 java.io.File getContentDirectory()
           
 net.jxta.share.ContentManager getContentManager()
          Returns the ContentManager for this policy.
 java.io.File getDirectory()
           
 net.jxta.service.Service getInterface()
           
 net.jxta.share.ShareStatus getList(net.jxta.protocol.PeerGroupAdvertisement destPeer)
          SharePolicy Interface Methods
 net.jxta.share.ShareStatus getList(net.jxta.protocol.PipeAdvertisement destPipe)
           
 java.lang.String getName()
          Returns the name of this policy.
 net.jxta.protocol.PipeAdvertisement getPipeAdvertisement()
           
 net.jxta.pipe.Pipe getPipePolicy()
           
 java.io.File getTempDirectory()
           
 void handleJxtaMessage(net.jxta.endpoint.Message message)
           
 void init(net.jxta.peergroup.PeerGroup group, net.jxta.document.Advertisement adv)
          Initialize the application
 net.jxta.document.Advertisement loadAdvertisement(java.io.File advFile)
          load the advertisement located in the given file
 void saveAdvertisement(net.jxta.document.Advertisement adv, java.io.File advFile)
          save the advertisement to the given file
 int startApp(java.lang.String[] str)
           
 void startPolicy(java.io.File groupDir)
          AppPolicy Interface Methods
 void stopApp()
           
 void stopPolicy()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharePolicyImpl

public SharePolicyImpl()
Method Detail

getAdvertisement

public net.jxta.document.Advertisement getAdvertisement()
Returns the advertisment for that service.
Returns:
Advertisement the advertisement.
Since:
JXTA 1.0

init

public void init(net.jxta.peergroup.PeerGroup group,
                 net.jxta.document.Advertisement adv)
          throws net.jxta.exception.PeerGroupException
Initialize the application
Parameters:
group - PeerGroup this application is started from
Since:
JXTA 1.0

getName

public java.lang.String getName()
Returns the name of this policy. The name is dilvered as a copy that belongs to the caller.
Returns:
String the name of this policy.

getInterface

public net.jxta.service.Service getInterface()

startPolicy

public void startPolicy(java.io.File groupDir)
                 throws net.jxta.exception.PeerGroupException
AppPolicy Interface Methods
Specified by:
startPolicy in interface net.jxta.share.SharePolicy

startApp

public int startApp(java.lang.String[] str)

stopApp

public void stopApp()

stopPolicy

public void stopPolicy()
Specified by:
stopPolicy in interface net.jxta.share.SharePolicy

getPipePolicy

public net.jxta.pipe.Pipe getPipePolicy()
Specified by:
getPipePolicy in interface net.jxta.share.SharePolicy

getPipeAdvertisement

public net.jxta.protocol.PipeAdvertisement getPipeAdvertisement()
Specified by:
getPipeAdvertisement in interface net.jxta.share.SharePolicy

handleJxtaMessage

public void handleJxtaMessage(net.jxta.endpoint.Message message)
Specified by:
handleJxtaMessage in interface net.jxta.share.SharePolicy

getList

public net.jxta.share.ShareStatus getList(net.jxta.protocol.PeerGroupAdvertisement destPeer)
SharePolicy Interface Methods
Specified by:
getList in interface net.jxta.share.SharePolicy

getList

public net.jxta.share.ShareStatus getList(net.jxta.protocol.PipeAdvertisement destPipe)
Specified by:
getList in interface net.jxta.share.SharePolicy

getContent

public net.jxta.share.ShareStatus getContent(net.jxta.protocol.PeerGroupAdvertisement destPeer,
                                             net.jxta.share.ContentId cid)
Specified by:
getContent in interface net.jxta.share.SharePolicy

getContent

public net.jxta.share.ShareStatus getContent(net.jxta.protocol.PeerGroupAdvertisement destPeer,
                                             net.jxta.share.ContentId cid,
                                             java.io.File destFile)
Specified by:
getContent in interface net.jxta.share.SharePolicy

getContent

public net.jxta.share.ShareStatus getContent(net.jxta.protocol.PipeAdvertisement destPipe,
                                             net.jxta.share.ContentId cid)
Specified by:
getContent in interface net.jxta.share.SharePolicy

getContent

public net.jxta.share.ShareStatus getContent(net.jxta.protocol.PipeAdvertisement destPipe,
                                             net.jxta.share.ContentId cid,
                                             java.io.File destFile)
Specified by:
getContent in interface net.jxta.share.SharePolicy

getContentManager

public net.jxta.share.ContentManager getContentManager()
Returns the ContentManager for this policy.
Specified by:
getContentManager in interface net.jxta.share.SharePolicy

loadAdvertisement

public net.jxta.document.Advertisement loadAdvertisement(java.io.File advFile)
load the advertisement located in the given file
Parameters:
advFile - file that contains the Advertisement
Returns:
the Advertisement that the file contains or null if error
Since:
JXTA 1.0

saveAdvertisement

public void saveAdvertisement(net.jxta.document.Advertisement adv,
                              java.io.File advFile)
save the advertisement to the given file
Parameters:
adv - the Advertisement to save
advFile - file to write the Advertisement
Since:
JXTA 1.0

getDirectory

public java.io.File getDirectory()

getContentDirectory

public java.io.File getContentDirectory()

getCacheDirectory

public java.io.File getCacheDirectory()

getTempDirectory

public java.io.File getTempDirectory()

JXTA