diff options
author | Damian Minkov <damencho@jitsi.org> | 2008-04-10 12:10:01 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2008-04-10 12:10:01 +0000 |
commit | a5e055bff2c3be23a0b256d054bfb92590cf04c2 (patch) | |
tree | 1f8b13b9a95aaa822ebd71b9f209b339ce74d5f8 /src/net/java/sip/communicator/service | |
parent | a6ac92c9b8b2eb3b4c12b2d594974a60fc792852 (diff) | |
download | jitsi-a5e055bff2c3be23a0b256d054bfb92590cf04c2.zip jitsi-a5e055bff2c3be23a0b256d054bfb92590cf04c2.tar.gz jitsi-a5e055bff2c3be23a0b256d054bfb92590cf04c2.tar.bz2 |
Added error code and error reason to SubscritionEvent and metacontact list dispatch subscription failed events
Diffstat (limited to 'src/net/java/sip/communicator/service')
-rw-r--r-- | src/net/java/sip/communicator/service/protocol/event/SubscriptionEvent.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/event/SubscriptionEvent.java b/src/net/java/sip/communicator/service/protocol/event/SubscriptionEvent.java index eb0980f..811563a 100644 --- a/src/net/java/sip/communicator/service/protocol/event/SubscriptionEvent.java +++ b/src/net/java/sip/communicator/service/protocol/event/SubscriptionEvent.java @@ -49,10 +49,17 @@ public class SubscriptionEvent * confirmed by the server (resolved). */ public static final int SUBSCRIPTION_RESOLVED = 4; + + /** + * Error code unknown + */ + public static final int ERROR_UNSPECIFIED = -1; private ProtocolProviderService sourceProvider = null; private ContactGroup parentGroup = null; + private int errorCode = ERROR_UNSPECIFIED; + private String errorReason = null; /** * Creates a new Subscription event according to the specified parameters. @@ -69,10 +76,32 @@ public class SubscriptionEvent ContactGroup parentGroup, int eventID) { + this(source, provider, parentGroup, eventID, ERROR_UNSPECIFIED, null); + } + + /** + * Creates a new Subscription event according to the specified parameters. + * @param source the Contact instance that this subscription pertains to. + * @param provider the ProtocolProviderService instance where this event + * occurred + * @param parentGroup the ContactGroup underwhich the corresponding Contact + * is located + * @param eventID one of the SUBSCRIPTION_XXX static fields indicating the + * nature of the event. + */ + public SubscriptionEvent( Contact source, + ProtocolProviderService provider, + ContactGroup parentGroup, + int eventID, + int errorCode, + String errorReason) + { super(source); this.sourceProvider = provider; this.parentGroup = parentGroup; this.eventID = eventID; + this.errorCode = errorCode; + this.errorReason = errorReason; } /** @@ -130,4 +159,24 @@ public class SubscriptionEvent { return eventID; } + + /** + * If event is SUBSCRIPTION_FAILED, returns the error code + * of the failed event + * @return error code + */ + public int getErrorCode() + { + return errorCode; + } + + /** + * If event is SUBSCRIPTION_FAILED, returns the reason of the error + * for the failed event + * @return the String reason for the error + */ + public String getErrorReason() + { + return errorReason; + } } |