AbstractRequestListener
Keywords: uk.ac.ic.doc.automed.p2p.communication.AbstractRequestListener 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.communication
Class AbstractRequestListener

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

All Implemented Interfaces:
  RequestListener

Direct Known Subclasses:
  AutoMedPeer, P2PDirectory, P2PRegistry, UpdateDataMessageHandler

    public abstract class AbstractRequestListener

extends java.lang.Object
implements RequestListener

Constructor Summary
`AbstractRequestListener()` Creates a new instance of AbstractRequestListener

Method Summary
`void` | `handleRequest(uk.ac.ic.doc.automed.p2p.messages.abstractlayer.AbstractMessage request, java.io.OutputStream output)` Handle TCP-type requests
`void` | `handleRequest(byte[] dataReceived)` Another handler for TCP-type requests
`byte[]` | `handleUDPRequest(byte[] dataReceived)` Handle UDP requests
`byte[]` | `handleUDPRequest(java.net.InetAddress srcHost, int srcPort, byte[] dataReceived)`
`byte[]` | `handleUDPRequest(java.lang.String srcHost, int srcPort, byte[] dataReceived)`

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

Constructor Detail

### AbstractRequestListener

    public AbstractRequestListener()

  Creates a new instance of AbstractRequestListener

Method Detail

### handleRequest

    public void handleRequest(uk.ac.ic.doc.automed.p2p.messages.abstractlayer.AbstractMessage request,
                              java.io.OutputStream output)
                       throws java.io.IOException

  Handle TCP-type requests

  Specified by:
    `handleRequest` in interface `RequestListener`
  Throws:
    `java.io.IOException`

### handleRequest

    public void handleRequest(byte[] dataReceived)
                       throws CommunicationException

  Description copied from interface: `RequestListener`
  Another handler for TCP-type requests

  Specified by:
    `handleRequest` in interface `RequestListener`
  Throws:
    `CommunicationException`

### handleUDPRequest

    public byte[] handleUDPRequest(byte[] dataReceived)
                            throws CommunicationException

  Handle UDP requests

  Specified by:
    `handleUDPRequest` in interface `RequestListener`
  Throws:
    `CommunicationException`

### handleUDPRequest

    public byte[] handleUDPRequest(java.lang.String srcHost,
                                   int srcPort,
                                   byte[] dataReceived)
                            throws CommunicationException

  Specified by:
    `handleUDPRequest` in interface `RequestListener`
  Throws:
    `CommunicationException`

### handleUDPRequest

    public byte[] handleUDPRequest(java.net.InetAddress srcHost,
                                   int srcPort,
                                   byte[] dataReceived)
                            throws CommunicationException

  Specified by:
    `handleUDPRequest` in interface `RequestListener`
  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