Interface PostResponse

    • Method Detail

      • setReferer

        void setReferer​(String referer)
        Sets the referer property
      • setPath

        void setPath​(String path)
        Sets the absolute path of the item upon which the request operated.
      • getPath

        String getPath()
        Returns the absolute path of the item upon which the request operated.

        If the setPath(String) method has not been called yet, this method returns null.

      • setCreateRequest

        void setCreateRequest​(boolean isCreateRequest)
        Sets whether the request was a create request or not.
      • isCreateRequest

        boolean isCreateRequest()
        Returns true if this was a create request.

        Before calling the setCreateRequest(boolean) method, this method always returns false.

      • setLocation

        void setLocation​(String location)
        Sets the location of this modification. This is the externalized form of the current path.
        Parameters:
        location -
      • getLocation

        String getLocation()
        Returns the location of the modification.

        If the setLocation(String) method has not been called yet, this method returns null.

      • setParentLocation

        void setParentLocation​(String parentLocation)
        Sets the parent location of the modification. This is the externalized form of the parent node of the current path.
      • getParentLocation

        String getParentLocation()
        Returns the parent location of the modification.

        If the setParentLocation(String) method has not been called yet, this method returns null.

      • setTitle

        void setTitle​(String title)
        Sets the title of the response message
        Parameters:
        title - the title
      • setStatus

        void setStatus​(int code,
                       String message)
        Sets the response status code properties
        Parameters:
        code - the code
        message - the message
      • getStatusCode

        int getStatusCode()
        Returns the status code of this instance. If the status code has never been set by calling the setStatus(int, String) method, the status code is determined by checking if there was an error. If there was an error, the response is assumed to be unsuccessful and 500 is returned. If there is no error, the response is assumed to be successful and 200 is returned.
      • setError

        void setError​(Throwable error)
        Sets the recorded error causing the operation to fail.
      • getError

        Throwable getError()
        Returns any recorded error or null
        Returns:
        an error or null
      • isSuccessful

        boolean isSuccessful()
        Returns true if no error is set and if the status code is one of the 2xx codes.
      • onCreated

        void onCreated​(String path)
        Records a 'created' change
        Parameters:
        path - path of the item that was created
      • onModified

        void onModified​(String path)
        Records a 'modified' change
        Parameters:
        path - path of the item that was modified
      • onDeleted

        void onDeleted​(String path)
        Records a 'deleted' change
        Parameters:
        path - path of the item that was deleted
      • onMoved

        void onMoved​(String srcPath,
                     String dstPath)
        Records a 'moved' change.

        Note: the moved change only records the basic move command. the implied changes on the moved properties and sub nodes are not recorded.

        Parameters:
        srcPath - source path of the node that was moved
        dstPath - destination path of the node that was moved.
      • onCopied

        void onCopied​(String srcPath,
                      String dstPath)
        Records a 'copied' change.

        Note: the copy change only records the basic copy command. the implied changes on the copied properties and sub nodes are not recorded.

        Parameters:
        srcPath - source path of the node that was copied
        dstPath - destination path of the node that was copied.
      • onChange

        void onChange​(String type,
                      String... arguments)
        Records a generic change of the given type with arguments.
        Parameters:
        type - The type of the modification
        arguments - The arguments to the modifications
      • send

        void send​(HttpServletResponse response,
                  boolean setStatus)
           throws IOException
        Writes the response back over the provided HTTP channel. The actual format of the response is implementation dependent.
        Parameters:
        response - to send to
        setStatus - whether to set the status code on the response
        Throws:
        IOException - if an i/o exception occurs