P2PRegistry
Keywords: uk.ac.ic.doc.automed.p2p.P2PRegistry class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.ic.doc.automed.p2p
Class P2PRegistry

    java.lang.Object
      uk.ac.ic.doc.automed.p2p.communication.AbstractRequestListener
          uk.ac.ic.doc.automed.p2p.P2PRegistry

All Implemented Interfaces:
  RequestListener

    public class P2PRegistry

extends AbstractRequestListener

Method Summary
`void` | `close()`
`int` | `getPeerPort(java.lang.String name)`
`boolean` | `getReadyState()` Is the socket server ready to accept requests?
`static P2PRegistry` | `getRegistryInstance()` Start a registry from a Peer
`int` | `getTimeOut()`
`byte[]` | `handleRequest(byte[] dataReceived, ResponseHandler output)` Handle both TCP and UDP requests
`static void` | `main(java.lang.String[] args)` Start registry from command-line
`void` | `removePeer(java.lang.String name)`

Methods inherited from class uk.ac.ic.doc.automed.p2p.communication.AbstractRequestListener
`getRequestMessage, getResponseData, getType, handleRequest, handleRequest, handleRequest, handleUDPRequest, handleUDPRequest, handleUDPRequest`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getRegistryInstance

    public static P2PRegistry getRegistryInstance()
                                           throws CommunicationException,
                                                  AutoMedException

  Start a registry from a Peer

  Throws:
    `CommunicationException`
    `AutoMedException`

### main

    public static void main(java.lang.String[] args)

  Start registry from command-line

### close

    public void close()

### getReadyState

    public boolean getReadyState()

  Is the socket server ready to accept requests?

### getPeerPort

    public int getPeerPort(java.lang.String name)

### removePeer

    public void removePeer(java.lang.String name)

### getTimeOut

    public int getTimeOut()

### handleRequest

    public byte[] handleRequest(byte[] dataReceived,
                                ResponseHandler output)
                         throws CommunicationException

  Description copied from class: `AbstractRequestListener`
  Handle both TCP and UDP requests

  Specified by:
    `handleRequest` in interface `RequestListener`
  Overrides:
    `handleRequest` in class `AbstractRequestListener`
  Throws:
    `CommunicationException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD