Project JXTA

net.jxta.impl.resolver
Class AdvertisementCache

java.lang.Object
  |
  +--net.jxta.impl.resolver.AdvertisementCache

public class AdvertisementCache
extends java.lang.Object

Since:
1.0

Constructor Summary
AdvertisementCache()
          AdvertisementCache is used by resolver/discovery to store Advertisements of all types
 
Method Summary
 void checkPoint(java.lang.String filename)
          Checkpoint the cache to disk This method should be used at the very most once, and at shutdown until it is improved it should be utilized differently
 void flush()
          flush cache.
 net.jxta.id.ID get(java.lang.String id)
          given the doc ID get returns the document associated with it
 void initialize(java.lang.String filename)
          Initialize the cache from a checkpoint this method should only be used during boot
 java.util.Enumeration iterate()
          Returns all the keys in the cache
 net.jxta.document.Advertisement readAdvertisement(java.lang.String filename)
          Convenience method to aid in the functionality of reverse discovery One example of reverse discovery is peer invitation where a node would somehow get it's advertisement to another node, via e-mail etc.
 void remove(java.lang.String key)
          remove an entry from cache, this useful in invalidating an advertisement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdvertisementCache

public AdvertisementCache()
AdvertisementCache is used by resolver/discovery to store Advertisements of all types
Since:
1.0
Method Detail

remove

public void remove(java.lang.String key)
remove an entry from cache, this useful in invalidating an advertisement
Parameters:
key -  

iterate

public java.util.Enumeration iterate()
Returns all the keys in the cache
Returns:
Enumeration of keys

get

public net.jxta.id.ID get(java.lang.String id)
given the doc ID get returns the document associated with it
Parameters:
id -  
Returns:
 

flush

public void flush()
flush cache.

checkPoint

public void checkPoint(java.lang.String filename)
                throws java.io.IOException
Checkpoint the cache to disk This method should be used at the very most once, and at shutdown until it is improved it should be utilized differently
Parameters:
filename -  
Throws:
java.io.IOException -  

initialize

public void initialize(java.lang.String filename)
                throws java.lang.ClassNotFoundException,
                       java.io.IOException
Initialize the cache from a checkpoint this method should only be used during boot
Parameters:
filename -  
Throws:
java.lang.ClassNotFoundException -  
java.io.IOException -  

readAdvertisement

public net.jxta.document.Advertisement readAdvertisement(java.lang.String filename)
                                                  throws java.io.IOException
Convenience method to aid in the functionality of reverse discovery One example of reverse discovery is peer invitation where a node would somehow get it's advertisement to another node, via e-mail etc. the receiving end would read in the advertisement and (reverse) discovers the inviting node. The use of this class is not limited to reverse discovery.
Parameters:
filename -  
Returns:
PeerAdvertisement object which represent the data
Throws:
java.io.IOException -  

Project JXTA