| 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectuk.ac.ic.doc.automed.p2p.PeerCache
public class PeerCache
P2PDirectory
 for the local AutoMedPeer| Field Summary | |
|---|---|
(package private)  java.util.List | 
cacheListeners
 | 
(package private)  MessageHandler | 
myHandler
 | 
 java.util.Set | 
mySchemas
 | 
(package private)  java.lang.String | 
name
 | 
 java.util.Map | 
otherPeers
 | 
 java.util.HashSet | 
publicSchemas
 | 
| Constructor Summary | |
|---|---|
PeerCache(AutoMedPeer myPeer)
 | 
|
| Method Summary | |
|---|---|
 void | 
addListener(CacheListener listener)
Add a listener to the cache  | 
 void | 
clear()
Clear the cache  | 
 CacheContentDescription | 
getContentObject()
Get the actual content object  | 
 java.util.Set | 
getMySchemas()
 | 
 java.util.HashSet | 
getPeerDescriptions(SchemaDescription schema)
Return a Map of PeerDescriptions for 
 a given SchemaDescription. | 
 java.util.Set | 
getPublicSchemas()
Return a Set containing SchemaDescriptions | 
 boolean | 
hasNext()
 | 
 void | 
initialiseCache()
 | 
 boolean | 
isSchemaInfoCached(java.lang.String schema)
 | 
 java.lang.Object | 
next()
 | 
private  void | 
notifyListeners()
 | 
 void | 
notifyListeners(Cacheable cacheObj)
Notify listeners to handle a specific event  | 
 void | 
refresh()
Refresh cache content  | 
 void | 
refreshMySchemas()
 | 
 java.util.HashSet | 
refreshPeersOf(SchemaDescription schema)
 | 
 java.util.HashSet | 
refreshPublicSchemas()
 | 
 void | 
remove()
 | 
 void | 
setPublicSchemas(java.util.List schemas)
Assign a list of public schemas (i.e.  | 
 java.lang.String | 
toString()
 | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public java.util.Set mySchemas
public java.util.HashSet publicSchemas
public java.util.Map otherPeers
MessageHandler myHandler
java.lang.String name
java.util.List cacheListeners
| Constructor Detail | 
|---|
public PeerCache(AutoMedPeer myPeer)
| Method Detail | 
|---|
public void initialiseCache()
                     throws UnsuccessfulReplyException,
                            java.io.IOException,
                            AutoMedException
UnsuccessfulReplyException
java.io.IOException
AutoMedExceptionpublic void addListener(CacheListener listener)
addListener in interface Cacheablepublic void remove()
remove in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorpublic boolean hasNext()
hasNext in interface java.util.Iteratorpublic void notifyListeners(Cacheable cacheObj)
notifyListeners in interface CacheablecacheObj - the Cacheable object to be used by listener to handle eventpublic void clear()
clear in interface Cacheablepublic void refresh()
refresh in interface Cacheablepublic CacheContentDescription getContentObject()
getContentObject in interface Cacheable
public java.util.HashSet refreshPeersOf(SchemaDescription schema)
                                 throws UnsuccessfulReplyException,
                                        java.io.IOException,
                                        AutoMedException
UnsuccessfulReplyException
java.io.IOException
AutoMedException
public java.util.HashSet refreshPublicSchemas()
                                       throws UnsuccessfulReplyException,
                                              java.io.IOException,
                                              AutoMedException
UnsuccessfulReplyException
java.io.IOException
AutoMedException
public void refreshMySchemas()
                      throws UnsuccessfulReplyException,
                             java.io.IOException,
                             AutoMedException
UnsuccessfulReplyException
java.io.IOException
AutoMedExceptionpublic java.util.HashSet getPeerDescriptions(SchemaDescription schema)
Map of PeerDescriptions for 
 a given SchemaDescription.
public boolean isSchemaInfoCached(java.lang.String schema)
public java.util.Set getPublicSchemas()
Set containing SchemaDescriptions
public void setPublicSchemas(java.util.List schemas)
SchemaDescriptions) to cache
public java.util.Set getMySchemas()
private void notifyListeners()
public java.lang.String toString()
toString in class java.lang.Object
  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||