Class SubscribeMethod

java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
All Implemented Interfaces:
org.apache.commons.httpclient.HttpMethod, DepthSupport

public class SubscribeMethod extends XMLResponseMethodBase implements DepthSupport
Implements the SUBSCRIBE method.
See Also:
  • Field Details

  • Constructor Details

    • SubscribeMethod

      public SubscribeMethod()
    • SubscribeMethod

      public SubscribeMethod(String path)
  • Method Details

    • getCallback

      public String getCallback()
    • setCallback

      public void setCallback(String callback)
      Sets the URI that's to be notified if the subscribed event does occur.
    • getNotificationType

      public String getNotificationType()
    • setNotificationType

      public void setNotificationType(String notificationType)
      Sets the notification type, i.e. determines the events that are subscribed.
      See Also:
    • getSubsciptionLifetime

      public long getSubsciptionLifetime()
    • setSubsciptionLifetime

      public void setSubsciptionLifetime(long subsciptionLifetime)
      Sets the duration of the subscription in seconds.
    • getSubscriptionId

      public long getSubscriptionId()
    • setSubscriptionId

      public void setSubscriptionId(int subscriptionId)
      Sets the ID of a subscription to be refreshed.
      Parameters:
      subscriptionId -
    • setNotificationDelay

      public void setNotificationDelay(long delay)
      Sets the notification delay in seconds.
    • getNotificationDelay

      public long getNotificationDelay()
    • getDepth

      public int getDepth()
      Description copied from interface: DepthSupport
      Depth getter.
      Specified by:
      getDepth in interface DepthSupport
      Returns:
      int depth value
    • setDepth

      public void setDepth(int depth)
      Sets the depth.
      Specified by:
      setDepth in interface DepthSupport
      Parameters:
      depth - New depth value
    • getResponsedSubscriptionId

      public int getResponsedSubscriptionId()
      Returns the subscription ID responsed from the server.
      Returns:
      -1 if no subscription id was in the response
    • getResponsedSubscriptionLifetime

      public long getResponsedSubscriptionLifetime()
      Returns the subscription lifetime responsed from the server.
      Returns:
      -1 if no subscription lifetime was given in the response
    • getResponsedContentLocation

      public String getResponsedContentLocation()
      Returns the value of the content-location header of the response. This shall be used to the request uri for a POLL method querying this subscription.
    • getName

      public String getName()
      Specified by:
      getName in interface org.apache.commons.httpclient.HttpMethod
      Specified by:
      getName in class org.apache.commons.httpclient.HttpMethodBase
    • recycle

      public void recycle()
      Description copied from class: XMLResponseMethodBase
      Reset the State of the class to its initial state, so that it can be used again.
      Specified by:
      recycle in interface org.apache.commons.httpclient.HttpMethod
      Overrides:
      recycle in class XMLResponseMethodBase
    • addRequestHeaders

      protected void addRequestHeaders(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws IOException, org.apache.commons.httpclient.HttpException
      Overrides:
      addRequestHeaders in class org.apache.commons.httpclient.HttpMethodBase
      Throws:
      IOException
      org.apache.commons.httpclient.HttpException
    • setRequestHeader

      public void setRequestHeader(String headerName, String headerValue)
      Adds special checking of header values of the SUBSCRIBE method to the super class implementation.
      Specified by:
      setRequestHeader in interface org.apache.commons.httpclient.HttpMethod
      Overrides:
      setRequestHeader in class org.apache.commons.httpclient.HttpMethodBase
    • processResponseHeaders

      protected void processResponseHeaders(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn)
      Overrides:
      processResponseHeaders in class org.apache.commons.httpclient.HttpMethodBase