Class HtmlPostResponseProxy

java.lang.Object
org.apache.sling.servlets.post.impl.helper.HtmlPostResponseProxy
All Implemented Interfaces:
PostResponse

@Deprecated public class HtmlPostResponseProxy extends Object implements PostResponse
Deprecated.
The HtmlPostResponseProxy class implements the PostResponse interface using a Sling API HtmlResponse.

This class is mainly used by the deprecated AbstractSlingPostOperation for bridging into the new AbstractPostOperation.

  • Constructor Details

    • HtmlPostResponseProxy

      public HtmlPostResponseProxy(HtmlResponse apiHtmlResponse)
      Deprecated.
  • Method Details

    • getHtmlResponse

      public HtmlResponse getHtmlResponse()
      Deprecated.
    • getError

      public Throwable getError()
      Deprecated.
      Description copied from interface: PostResponse
      Returns any recorded error or null
      Specified by:
      getError in interface PostResponse
      Returns:
      an error or null
    • getLocation

      public String getLocation()
      Deprecated.
      Description copied from interface: PostResponse
      Returns the location of the modification.

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

      Specified by:
      getLocation in interface PostResponse
      Returns:
      the location
    • getParentLocation

      public String getParentLocation()
      Deprecated.
      Description copied from interface: PostResponse
      Returns the parent location of the modification.

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

      Specified by:
      getParentLocation in interface PostResponse
      Returns:
      the parent location
    • getPath

      public String getPath()
      Deprecated.
      Description copied from interface: PostResponse
      Returns the absolute path of the item upon which the request operated.

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

      Specified by:
      getPath in interface PostResponse
      Returns:
      the path (might be null)
    • getProperty

      public <Type> Type getProperty(String name, Class<Type> type)
      Deprecated.
    • getProperty

      public Object getProperty(String name)
      Deprecated.
    • getReferer

      public String getReferer()
      Deprecated.
      Description copied from interface: PostResponse
      Returns the referer previously set by PostResponse.setReferer(String)
      Specified by:
      getReferer in interface PostResponse
      Returns:
      the referer
    • getStatusCode

      public int getStatusCode()
      Deprecated.
      Description copied from interface: PostResponse
      Returns the status code of this instance. If the status code has never been set by calling the PostResponse.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.
      Specified by:
      getStatusCode in interface PostResponse
      Returns:
      the status code
    • getStatusMessage

      public String getStatusMessage()
      Deprecated.
      Description copied from interface: PostResponse
      Returns the status message or null if no has been set with the PostResponse.setStatus(int, String) method.
      Specified by:
      getStatusMessage in interface PostResponse
      Returns:
      the status message (might be null)
    • isCreateRequest

      public boolean isCreateRequest()
      Deprecated.
      Description copied from interface: PostResponse
      Returns true if this was a create request.

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

      Specified by:
      isCreateRequest in interface PostResponse
      Returns:
      if this was a create request
    • isSuccessful

      public boolean isSuccessful()
      Deprecated.
      Description copied from interface: PostResponse
      Returns true if no error is set and if the status code is one of the 2xx codes.
      Specified by:
      isSuccessful in interface PostResponse
      Returns:
      true if the status code is 2xx
    • onChange

      public void onChange(String type, String... arguments)
      Deprecated.
      Description copied from interface: PostResponse
      Records a generic change of the given type with arguments.
      Specified by:
      onChange in interface PostResponse
      Parameters:
      type - The type of the modification
      arguments - The arguments to the modifications
    • onCopied

      public void onCopied(String srcPath, String dstPath)
      Deprecated.
      Description copied from interface: PostResponse
      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.

      Specified by:
      onCopied in interface PostResponse
      Parameters:
      srcPath - source path of the node that was copied
      dstPath - destination path of the node that was copied.
    • onCreated

      public void onCreated(String path)
      Deprecated.
      Description copied from interface: PostResponse
      Records a 'created' change
      Specified by:
      onCreated in interface PostResponse
      Parameters:
      path - path of the item that was created
    • onDeleted

      public void onDeleted(String path)
      Deprecated.
      Description copied from interface: PostResponse
      Records a 'deleted' change
      Specified by:
      onDeleted in interface PostResponse
      Parameters:
      path - path of the item that was deleted
    • onModified

      public void onModified(String path)
      Deprecated.
      Description copied from interface: PostResponse
      Records a 'modified' change
      Specified by:
      onModified in interface PostResponse
      Parameters:
      path - path of the item that was modified
    • onMoved

      public void onMoved(String srcPath, String dstPath)
      Deprecated.
      Description copied from interface: PostResponse
      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.

      Specified by:
      onMoved in interface PostResponse
      Parameters:
      srcPath - source path of the node that was moved
      dstPath - destination path of the node that was moved.
    • send

      public void send(javax.servlet.http.HttpServletResponse response, boolean setStatus) throws IOException
      Deprecated.
      Description copied from interface: PostResponse
      Writes the response back over the provided HTTP channel. The actual format of the response is implementation dependent.
      Specified by:
      send in interface PostResponse
      Parameters:
      response - to send to
      setStatus - whether to set the status code on the response
      Throws:
      IOException - if an i/o exception occurs
    • setCreateRequest

      public void setCreateRequest(boolean isCreateRequest)
      Deprecated.
      Description copied from interface: PostResponse
      Sets whether the request was a create request or not.
      Specified by:
      setCreateRequest in interface PostResponse
      Parameters:
      isCreateRequest - true if the request was a create request
    • setError

      public void setError(Throwable error)
      Deprecated.
      Description copied from interface: PostResponse
      Sets the recorded error causing the operation to fail.
      Specified by:
      setError in interface PostResponse
      Parameters:
      error - the throwable
    • setLocation

      public void setLocation(String location)
      Deprecated.
      Description copied from interface: PostResponse
      Sets the location of this modification. This is the externalized form of the current path.
      Specified by:
      setLocation in interface PostResponse
      Parameters:
      location - the location
    • setParentLocation

      public void setParentLocation(String parentLocation)
      Deprecated.
      Description copied from interface: PostResponse
      Sets the parent location of the modification. This is the externalized form of the parent node of the current path.
      Specified by:
      setParentLocation in interface PostResponse
      Parameters:
      parentLocation - the parent location of the modification
    • setPath

      public void setPath(String path)
      Deprecated.
      Description copied from interface: PostResponse
      Sets the absolute path of the item upon which the request operated.
      Specified by:
      setPath in interface PostResponse
      Parameters:
      path - the path
    • setProperty

      public void setProperty(String name, Object value)
      Deprecated.
    • setReferer

      public void setReferer(String referer)
      Deprecated.
      Description copied from interface: PostResponse
      Sets the referer property
      Specified by:
      setReferer in interface PostResponse
      Parameters:
      referer - the referer
    • setStatus

      public void setStatus(int code, String message)
      Deprecated.
      Description copied from interface: PostResponse
      Sets the response status code properties
      Specified by:
      setStatus in interface PostResponse
      Parameters:
      code - the code
      message - the message
    • setTitle

      public void setTitle(String title)
      Deprecated.
      Description copied from interface: PostResponse
      Sets the title of the response message
      Specified by:
      setTitle in interface PostResponse
      Parameters:
      title - the title