com.ibm.datapower.wamt.amp
Class SubscriptionResponseCode

java.lang.Object
  extended by com.ibm.datapower.wamt.amp.SubscriptionResponseCode

public class SubscriptionResponseCode
extends java.lang.Object

Provides enumerated values and helper methods for the response from the device of the subscription request. This is very similar to SubscriptionState, this class has an additional state DUPLICATE with a corresponding URL of the subscription which already exists on the device.

An instance of this class is returned from a subscription request, so you do not need to create it explicity, you need to use only the gettr methods.

See Also:
Commands.subscribeToDevice(DeviceContext, String, StringCollection, URL)

Field Summary
static SubscriptionResponseCode ACTIVE
          The requested subscription has been established on the device.
static java.lang.String COPYRIGHT_2009_2010
           
static java.lang.String DUPLICATE_STRING
          A String to test for when checking if the subscription request is a duplicate (the device already has a NotificationCatcher subscribed to it).
static SubscriptionResponseCode FAULT
          The requested subscription is a duplicate of one that already exists.
static SubscriptionResponseCode NONE
          The requested subscription does not exist on the device.
 
Method Summary
static SubscriptionResponseCode createWithDuplicate(java.lang.String url)
          The requested subscription is a duplicate of one that already exists on the device.
 boolean equals(java.lang.Object that)
          Compare two objects to see if they are equivalent.
 java.lang.String getDuplicateURL()
          Getter for duplicate URL string
 int hashCode()
           
 boolean isDuplicate()
          Check if the response indicates that the subscription request was detected as a duplicate.
 void setDuplicateURL(java.lang.String duplicateURL)
          Setter for duplicate URL string
 java.lang.String toString()
          Get a human-readable String representation of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_2009_2010

public static final java.lang.String COPYRIGHT_2009_2010
See Also:
Constant Field Values

ACTIVE

public static final SubscriptionResponseCode ACTIVE
The requested subscription has been established on the device.

See Also:
NONE, FAULT, createWithDuplicate(String), SubscriptionState.ACTIVE

NONE

public static final SubscriptionResponseCode NONE
The requested subscription does not exist on the device. This value is likely to be encountered when unsubscribing from a device where the device has lost the subscription or the subscription id is not valid. Or it may be encountered when a device is pinged (the subscription id is included in the ping request), and the ping response indicates that the subscription does not exist on the device.

See Also:
ACTIVE, FAULT, createWithDuplicate(String), SubscriptionState.NONE

FAULT

public static final SubscriptionResponseCode FAULT
The requested subscription is a duplicate of one that already exists.

See Also:
ACTIVE, NONE, createWithDuplicate(String), SubscriptionState.FAULT

DUPLICATE_STRING

public static final java.lang.String DUPLICATE_STRING
A String to test for when checking if the subscription request is a duplicate (the device already has a NotificationCatcher subscribed to it).

See Also:
Constant Field Values
Method Detail

createWithDuplicate

public static SubscriptionResponseCode createWithDuplicate(java.lang.String url)
The requested subscription is a duplicate of one that already exists on the device. The subscription request failed and the original callback URL was not overwritten. The callback URL of the original subscription can be captured here for messages and problem diagnosis.

Because this class needs to be thread-safe, this particular response can not be a singleton like the others.

See Also:
ACTIVE, NONE, FAULT, isDuplicate()

isDuplicate

public boolean isDuplicate()
Check if the response indicates that the subscription request was detected as a duplicate.

Returns:
true if it was a duplicate, false otherwise.

equals

public boolean equals(java.lang.Object that)
Compare two objects to see if they are equivalent. You can use this method when testing for equality with ACTIVE, NONE, or FAULT. If you want to test for a duplicate, use isDuplicate().

Overrides:
equals in class java.lang.Object
Parameters:
that - the other object to compare to "this"
Returns:
true if the two objects are equivalent, false otherwise
See Also:
ACTIVE, NONE, FAULT, isDuplicate()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getDuplicateURL

public java.lang.String getDuplicateURL()
Getter for duplicate URL string

Returns:
the duplicate URL string

setDuplicateURL

public void setDuplicateURL(java.lang.String duplicateURL)
Setter for duplicate URL string

Parameters:
duplicateURL - the duplicate URL string to be set

toString

public java.lang.String toString()
Get a human-readable String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a human-readable String representation of this object


© Copyright IBM Corp. 2006, 2010 All Rights Reserved.