org.licas.server

## Class ServerHandler

- java.lang.Object
- - org.licas.server.ServerHandler

- Direct Known Subclasses:
    BlockingServerHandler, NonBlockingServerHandler

      public abstract class ServerHandler
      extends java.lang.Object

  This class provides some base methods for http request handling.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `adminKey` The server admin key
    `protected java.lang.String` | `localURI` Local ip address - not currently used
    `protected java.lang.String` | `serverPassword` The server password

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerHandler(java.lang.String theServerPassword, java.lang.String theAdminKey)` Create a new instance of ServerHandler.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract HttpEntity` | `handle(HttpEntity request)` Handle the HTTP request.
    `protected boolean` | `isBlocking()` Return true if this handler is blocking, or requires a method reply.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### serverPassword

          protected java.lang.String serverPassword

      The server password

    - #### adminKey

          protected java.lang.String adminKey

      The server admin key

    - #### localURI

          protected java.lang.String localURI

      Local ip address - not currently used

  - ### Constructor Detail

    - #### ServerHandler

          public ServerHandler(java.lang.String theServerPassword,
                               java.lang.String theAdminKey)
                        throws java.lang.Exception

      Create a new instance of ServerHandler.
      Parameters:
        `theServerPassword` - the server password.
        `theAdminKey` - the server admin key.
      Throws:
        `java.lang.Exception` - any error.

  - ### Method Detail

    - #### handle

          public abstract HttpEntity handle(HttpEntity request)
                                     throws java.lang.Exception

      Handle the HTTP request.
      Parameters:
        `request` - the HTTP request.
      Returns:
        the method execution response.
      Throws:
        `java.lang.Exception` - any error.

    - #### isBlocking

          protected boolean isBlocking()

      Return true if this handler is blocking, or requires a method reply.
      Returns:
        true if blocking, false if not blocking.