uk.ac.ic.doc.automed.p2p.directory
Class P2PDirectory
java.lang.Object
uk.ac.ic.doc.automed.p2p.communication.AbstractRequestListener
uk.ac.ic.doc.automed.p2p.directory.P2PDirectory
- All Implemented Interfaces:
- RequestListener
public class P2PDirectory
- extends AbstractRequestListener
|
Method Summary |
java.util.List |
getPeersImplementing(java.lang.String schema)
|
java.util.List |
getPublicSchema(java.lang.String name)
|
java.util.List |
getPublicSchemas()
|
java.util.List |
getSchemasImplementedBy(java.lang.String peerName)
|
void |
handleRequest(uk.ac.ic.doc.automed.p2p.messages.abstractlayer.AbstractMessage request,
java.io.OutputStream output)
Handle TCP-type requests |
boolean |
heartBeat(java.lang.String peerName,
java.lang.String url)
|
static void |
main(java.lang.String[] args)
|
boolean |
peerImplementsSchema(java.lang.String peer,
java.lang.String schema)
|
boolean |
publishModel(java.lang.String name,
java.lang.String description,
java.lang.String structure)
Store a received model to the directory's repository |
boolean |
publishModel(java.lang.String name,
java.lang.String description,
java.lang.String structure,
java.lang.String[] schemaNames)
An overloading method of {@link #publishModel(name, description, structure)
above. |
boolean |
publishSchema(java.lang.String name,
java.lang.String description,
java.lang.String structure)
|
boolean |
registerPeer(java.lang.String name,
java.lang.String url,
java.lang.String status,
java.lang.String lastUpdate)
dmle 2/11/2005: register peer status as well |
boolean |
updatePeer(java.lang.String name,
java.lang.String url)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
repository
protected static P2PDirectoryRepository repository
P2PDirectory
public P2PDirectory()
registerPeer
public boolean registerPeer(java.lang.String name,
java.lang.String url,
java.lang.String status,
java.lang.String lastUpdate)
- dmle 2/11/2005: register peer status as well
updatePeer
public boolean updatePeer(java.lang.String name,
java.lang.String url)
peerImplementsSchema
public boolean peerImplementsSchema(java.lang.String peer,
java.lang.String schema)
publishSchema
public boolean publishSchema(java.lang.String name,
java.lang.String description,
java.lang.String structure)
publishModel
public boolean publishModel(java.lang.String name,
java.lang.String description,
java.lang.String structure)
- Store a received model to the directory's repository
- Parameters:
name - the model namedescription - the model descriptionstructure - the model objects
- Returns:
boolean indicates the result of the operation
publishModel
public boolean publishModel(java.lang.String name,
java.lang.String description,
java.lang.String structure,
java.lang.String[] schemaNames)
- An overloading method of {@link #publishModel(name, description, structure)
above.
- Parameters:
name - the model namedescription - the model descriptionstructure - the model objectsschemas - an array of schema names associated to this model
- Returns:
boolean indicates the result of the operation
getPublicSchemas
public java.util.List getPublicSchemas()
getPublicSchema
public java.util.List getPublicSchema(java.lang.String name)
getPeersImplementing
public java.util.List getPeersImplementing(java.lang.String schema)
getSchemasImplementedBy
public java.util.List getSchemasImplementedBy(java.lang.String peerName)
heartBeat
public boolean heartBeat(java.lang.String peerName,
java.lang.String url)
handleRequest
public void handleRequest(uk.ac.ic.doc.automed.p2p.messages.abstractlayer.AbstractMessage request,
java.io.OutputStream output)
throws java.io.IOException
- Description copied from class:
AbstractRequestListener
- Handle TCP-type requests
- Specified by:
handleRequest in interface RequestListener- Overrides:
handleRequest in class AbstractRequestListener
- Throws:
java.io.IOException
main
public static void main(java.lang.String[] args)