Class WebThingServer.PropertyHandler

  • All Implemented Interfaces:
    fi.iki.elonen.router.RouterNanoHTTPD.UriResponder
    Enclosing class:
    WebThingServer

    public static class WebThingServer.PropertyHandler
    extends WebThingServer.BaseHandler
    Handle a request to /properties/<property>.
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyHandler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      fi.iki.elonen.NanoHTTPD.Response get​(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,​java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)
      Handle a GET request.
      java.lang.String getPropertyName​(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, fi.iki.elonen.NanoHTTPD.IHTTPSession session)
      Get the property name from the URI.
      fi.iki.elonen.NanoHTTPD.Response put​(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,​java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)
      Handle a PUT request.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyHandler

        public PropertyHandler()
    • Method Detail

      • getPropertyName

        public java.lang.String getPropertyName​(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource,
                                                fi.iki.elonen.NanoHTTPD.IHTTPSession session)
        Get the property name from the URI.
        Parameters:
        uriResource - The URI resource that was matched
        session - The HTTP session
        Returns:
        The property name.
      • get

        public fi.iki.elonen.NanoHTTPD.Response get​(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource,
                                                    java.util.Map<java.lang.String,​java.lang.String> urlParams,
                                                    fi.iki.elonen.NanoHTTPD.IHTTPSession session)
        Handle a GET request.
        Specified by:
        get in interface fi.iki.elonen.router.RouterNanoHTTPD.UriResponder
        Overrides:
        get in class WebThingServer.BaseHandler
        Parameters:
        uriResource - The URI resource that was matched
        urlParams - Map of URL parameters
        session - The HTTP session
        Returns:
        The appropriate response.
      • put

        public fi.iki.elonen.NanoHTTPD.Response put​(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource,
                                                    java.util.Map<java.lang.String,​java.lang.String> urlParams,
                                                    fi.iki.elonen.NanoHTTPD.IHTTPSession session)
        Handle a PUT request.
        Specified by:
        put in interface fi.iki.elonen.router.RouterNanoHTTPD.UriResponder
        Overrides:
        put in class WebThingServer.BaseHandler
        Parameters:
        uriResource - The URI resource that was matched
        urlParams - Map of URL parameters
        session - The HTTP session
        Returns:
        The appropriate response.