org.restlet.ext.sip
Class Subscription

java.lang.Object
  extended by org.restlet.ext.sip.Subscription

public class Subscription
extends Object

Describes the state of a subscription. Used by the SIP "Subscription-State" header.

Author:
Thierry Boileau

Field Summary
static String REASON_DEACTIVATED
          The subscription has been terminated, but the subscriber SHOULD retry immediately with a new subscription.
static String REASON_GIVEUP
          The subscription has been terminated because the notifier could not obtain authorization in a timely fashion.
static String REASON_NORESOURCE
          The subscription has been terminated because the resource state which was being monitored no longer exists.
static String REASON_PROBATION
          The subscription has been terminated, but the client SHOULD retry at some later time.
static String REASON_REJECTED
          The subscription has been terminated due to change in authorization policy.
static String REASON_TIMEOUT
          The subscription has been terminated because it was not refreshed before it expired.
static String STATE_ACTIVE
          The subscription has been accepted and (in general) has been authorized.
static String STATE_PENDING
          The subscription has been received by the notifier, but there is insufficient policy information to grant or deny the subscription yet.
static String STATE_TERMINATED
          The subscription has been terminated.
 
Constructor Summary
Subscription(String value)
          Constructor.
Subscription(String value, String reason)
          Constructor.
Subscription(String value, String reason, int expires)
          Constructor.
Subscription(String value, String reason, int expires, int retryAfter)
          Constructor.
 
Method Summary
 long getExpires()
          Returns the expiration delay in seconds.
 Series<Parameter> getParameters()
          Returns the subscription parameters.
 String getReason()
          Returns the subscription reason.
 long getRetryAfter()
          Returns how long the service is expected to be unavailable.
 String getValue()
          Returns the subscription value.
 void setExpires(long expires)
          Sets the expiration delay in seconds.
 void setParameters(Series<Parameter> parameters)
          Sets the subscription parameters.
 void setReason(String reason)
          Sets the subscription reason.
 void setRetryAfter(long retryAfter)
          Sets how long the service is expected to be unavailable.
 void setValue(String value)
          Sets the subscription state value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REASON_DEACTIVATED

public static final String REASON_DEACTIVATED
The subscription has been terminated, but the subscriber SHOULD retry immediately with a new subscription.

See Also:
Subscription-State header, Constant Field Values

REASON_GIVEUP

public static final String REASON_GIVEUP
The subscription has been terminated because the notifier could not obtain authorization in a timely fashion.

See Also:
Subscription-State header, Constant Field Values

REASON_NORESOURCE

public static final String REASON_NORESOURCE
The subscription has been terminated because the resource state which was being monitored no longer exists.

See Also:
Subscription-State header, Constant Field Values

REASON_PROBATION

public static final String REASON_PROBATION
The subscription has been terminated, but the client SHOULD retry at some later time.

See Also:
Subscription-State header, Constant Field Values

REASON_REJECTED

public static final String REASON_REJECTED
The subscription has been terminated due to change in authorization policy.

See Also:
Subscription-State header, Constant Field Values

REASON_TIMEOUT

public static final String REASON_TIMEOUT
The subscription has been terminated because it was not refreshed before it expired.

See Also:
Subscription-State header, Constant Field Values

STATE_ACTIVE

public static final String STATE_ACTIVE
The subscription has been accepted and (in general) has been authorized.

See Also:
Subscription-State header, Constant Field Values

STATE_PENDING

public static final String STATE_PENDING
The subscription has been received by the notifier, but there is insufficient policy information to grant or deny the subscription yet.

See Also:
Subscription-State header, Constant Field Values

STATE_TERMINATED

public static final String STATE_TERMINATED
The subscription has been terminated.

See Also:
Subscription-State header, Constant Field Values
Constructor Detail

Subscription

public Subscription(String value)
Constructor.

Parameters:
value - The subscription value.

Subscription

public Subscription(String value,
                    String reason)
Constructor.

Parameters:
value - The subscription value.
reason - The subscription reason.

Subscription

public Subscription(String value,
                    String reason,
                    int expires)
Constructor.

Parameters:
value - The subscription value.
reason - The subscription reason.
expires - The expiration delay in seconds.

Subscription

public Subscription(String value,
                    String reason,
                    int expires,
                    int retryAfter)
Constructor.

Parameters:
value - The subscription value.
reason - The subscription reason.
expires - The expiration delay in seconds.
Method Detail

getExpires

public long getExpires()
Returns the expiration delay in seconds.

Returns:
The expiration delay in seconds.

getParameters

public Series<Parameter> getParameters()
Returns the subscription parameters.

Returns:
The subscription parameters.

getReason

public String getReason()
Returns the subscription reason.

Returns:
The subscription reason.

getRetryAfter

public long getRetryAfter()
Returns how long the service is expected to be unavailable.

Returns:
How long the service is expected to be unavailable.

getValue

public String getValue()
Returns the subscription value.

Returns:
The subscription value.

setExpires

public void setExpires(long expires)
Sets the expiration delay in seconds.

Parameters:
expires - The expiration delay in seconds.

setParameters

public void setParameters(Series<Parameter> parameters)
Sets the subscription parameters.

Parameters:
parameters - The subscription parameters.

setReason

public void setReason(String reason)
Sets the subscription reason.

Parameters:
reason - The subscription reason.

setRetryAfter

public void setRetryAfter(long retryAfter)
Sets how long the service is expected to be unavailable.

Parameters:
retryAfter - How long the service is expected to be unavailable

setValue

public void setValue(String value)
Sets the subscription state value.

Parameters:
value - The subscription state value.


Copyright © 2005-2013 Restlet.