Package cloud.piranha

Class DefaultHttpServerRequest

  • java.lang.Object
    • cloud.piranha.DefaultHttpServerRequest
  • All Implemented Interfaces:
    cloud.piranha.api.HttpServerRequest


    public class DefaultHttpServerRequest
    extends java.lang.Object
    implements cloud.piranha.api.HttpServerRequest
    The default HttpServerRequest.
    Author:
    Manfred Riem (mriem@manorrock.com)
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultHttpServerRequest​(java.net.Socket socket)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String name, java.lang.String value)
      Add the header.
      java.lang.String getHeader​(java.lang.String name)
      Get the header.
      java.util.Iterator<java.lang.String> getHeaderNames​()
      Get the header names.
      java.io.InputStream getInputStream​()
      Get the input stream.
      java.lang.String getLocalAddress​()
      Get the local address.
      java.lang.String getLocalHostname​()
      Get the local hostname.
      int getLocalPort​()
      Get the local port.
      java.lang.String getMethod​()
      Get the method.
      java.lang.String getQueryParameter​(java.lang.String name)
      Get the query parameter.
      java.lang.String getQueryString​()
      Get the query string.
      java.lang.String getRemoteAddress​()
      Get the remote address.
      java.lang.String getRemoteHostname​()
      Get the remote hostname.
      int getRemotePort​()
      Get the remote port.
      java.lang.String getRequestTarget​()
      Get the request target.
      void setMethod​(java.lang.String method)
      Set the method.
      void setRequestTarget​(java.lang.String requestTarget)
      Set the request target.
      • Methods inherited from class java.lang.Object

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

      • DefaultHttpServerRequest

        public DefaultHttpServerRequest​(java.net.Socket socket)
        Constructor.
        Parameters:
        socket - the socket.
    • Method Detail

      • addHeader

        public void addHeader​(java.lang.String name,
                              java.lang.String value)
        Add the header.
        Parameters:
        name - the name.
        value - the value.
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        Get the header.
        Specified by:
        getHeader in interface cloud.piranha.api.HttpServerRequest
        Parameters:
        name - the name.
        Returns:
        the value or null if not found.
      • getHeaderNames

        public java.util.Iterator<java.lang.String> getHeaderNames​()
        Get the header names.
        Specified by:
        getHeaderNames in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the header names.
      • getInputStream

        public java.io.InputStream getInputStream​()
        Get the input stream.
        Specified by:
        getInputStream in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the input stream.
      • getLocalAddress

        public java.lang.String getLocalAddress​()
        Get the local address.
        Specified by:
        getLocalAddress in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the local address.
      • getLocalHostname

        public java.lang.String getLocalHostname​()
        Get the local hostname.
        Specified by:
        getLocalHostname in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the local hostname.
      • getLocalPort

        public int getLocalPort​()
        Get the local port.
        Specified by:
        getLocalPort in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the local port.
      • getMethod

        public java.lang.String getMethod​()
        Get the method.
        Specified by:
        getMethod in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the method.
      • getQueryParameter

        public java.lang.String getQueryParameter​(java.lang.String name)
        Get the query parameter.
        Specified by:
        getQueryParameter in interface cloud.piranha.api.HttpServerRequest
        Parameters:
        name - the name.
        Returns:
        the value, or null.
      • getQueryString

        public java.lang.String getQueryString​()
        Get the query string.
        Specified by:
        getQueryString in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the query string.
      • getRemoteAddress

        public java.lang.String getRemoteAddress​()
        Get the remote address.
        Specified by:
        getRemoteAddress in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the remote address.
      • getRemoteHostname

        public java.lang.String getRemoteHostname​()
        Get the remote hostname.
        Specified by:
        getRemoteHostname in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the remote hostname.
      • getRemotePort

        public int getRemotePort​()
        Get the remote port.
        Specified by:
        getRemotePort in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the remote port.
      • getRequestTarget

        public java.lang.String getRequestTarget​()
        Get the request target.
        Specified by:
        getRequestTarget in interface cloud.piranha.api.HttpServerRequest
        Returns:
        the request target.
      • setMethod

        public void setMethod​(java.lang.String method)
        Set the method.
        Parameters:
        method - the method.
      • setRequestTarget

        public void setRequestTarget​(java.lang.String requestTarget)
        Set the request target.
        Parameters:
        requestTarget - the request target.

Copyright © 2020 Piranha Cloud. All rights reserved.