SAP NetWeaver '04

com.sapportals.wcm.repository.service.subscription
Class SubscriptionException

[contained in: com.sap.km.cm.repository.service.par - km.shared.repository.service.app.subscription_api.jar]
java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.sapportals.wcm.WcmException
                    |
                    +--com.sapportals.wcm.repository.service.subscription.SubscriptionException
All Implemented Interfaces:
java.io.Serializable

public class SubscriptionException
extends WcmException

The exception thrown by the subscription service.

Each SubscriptionException has a type associated with it that represents the reason why the exception was thrown.
This information can be accessed using a SubscriptionException:
- message describing the exception's root cause
- type containing the exception's root cause
(see Field Description)

Copyright (c) SAP AG

See Also:
ISubscriptionManager, ISubscription, WcmException, IRecipientList, Serialized Form

Field Summary
static int ANNOTATION_TO_LONG
          Create Subscription or set Subscription failed, because the annotation exeeds the length limit.
static int CREATE_EXISTS
          Create failed because a subscription with this name already exists for this owner (owner/name must be unique for each manager)
static int EVENT_MISMATCH
          Deprecated. as of NW04. An INVALID_CONDITION is thrown instead.
static int INVALID_CHANNEL
          Create or addfailed because the channel of the subscription and the recipient/channel combinations do not match (e.g. the channel says SMS, but for a newly added recipient no SMS channel is available).
static int INVALID_CONDITION
          Create or add failed because the condition of the subscription and the resource/event combinations do not match (e.g. the condition says ALWAYS, but for a newly added resource no events are sent by the repository).
static int INVALID_OWNER
          The owner given for this subscription is not valid.
protected  int m_FieldLength
          Maximum length of a field (default)
protected  IRecipientList m_InvalidRecipientsForChannel
          Internal list of all invalid recipients for a channel
protected  int m_Type
          Internal type of exception
static int NAME_TOO_LONG
          Create Subscription or set Subscription failed, because the name exeeds the length limit.
static int NO_EVENTMAPPER_FOR_REPOSITORY
          Repository has no SubscriptionEventMapping configured.
static int NO_VALID_OWNER
          Deprecated. as of NW04. An INVALID_OWNER is thrown instead.
static int NOACCESS
          Access error, for example, the user is not the owner of the subscription but is trying to delete it.
static int SUBSCRIPTION_ALREADY_DELETED
          Repository has no SubscriptionEventMapping configured.
static int SUBSCRIPTION_MANAGER_UNAVAILABLE
          A SubscriptionManager is requested for a resource, but the repository of this resource does not implement a subscription service.
static int UNKNOWN_ID
          The subscription's ID is not known to the manager.
 
Fields inherited from class com.sapportals.wcm.WcmException
ex
 
Constructor Summary
SubscriptionException(int type)
          Creates a subscription exception for a given type.
SubscriptionException(int type, boolean log)
          Creates a subscription exception for a given type with defined logging settings.
SubscriptionException(int type, boolean log, int maxLength)
          Creates a subscription exception for a given type with defined logging settings.
SubscriptionException(int type, java.lang.String message)
          Creates a subscription exception for a given type with an additional message.
SubscriptionException(int type, java.lang.String message, IRecipientList invalids)
          Creates a subscription exception for a given type with an additional message and an IRecipientList containing invalid recipients.
 
Method Summary
 IRecipientList getInvalidRecipientsForChannel()
          Gets the list of invalid recipients for a channel.
 int getMaxAnnotationLength()
          Deprecated. as of NW04. Use SubscriptionException.getMaxFieldLength() instead
 int getMaxFieldLength()
          Gets the maximum field length.
 java.lang.String getMessage()
          Returns the message for this SubscriptionException.
protected  java.lang.String getMessageForType(int type)
          Gets the default message for the exception type.
 int getType()
          Gets the type of this SubscriptionException.
 
Methods inherited from class com.sapportals.wcm.WcmException
getContainedException, isLogged
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOACCESS

public static final int NOACCESS
Access error, for example, the user is not the owner of the subscription but is trying to delete it. Also, not having read access for a get...() method can cause this error.

UNKNOWN_ID

public static final int UNKNOWN_ID
The subscription's ID is not known to the manager.

CREATE_EXISTS

public static final int CREATE_EXISTS
Create failed because a subscription with this name already exists for this owner (owner/name must be unique for each manager)

EVENT_MISMATCH

public static final int EVENT_MISMATCH
Deprecated. as of NW04. An INVALID_CONDITION is thrown instead.


SUBSCRIPTION_MANAGER_UNAVAILABLE

public static final int SUBSCRIPTION_MANAGER_UNAVAILABLE
A SubscriptionManager is requested for a resource, but the repository of this resource does not implement a subscription service.

NO_VALID_OWNER

public static final int NO_VALID_OWNER
Deprecated. as of NW04. An INVALID_OWNER is thrown instead.


INVALID_OWNER

public static final int INVALID_OWNER
The owner given for this subscription is not valid.

INVALID_CONDITION

public static final int INVALID_CONDITION
Create or add failed because the condition of the subscription and the resource/event combinations do not match (e.g. the condition says ALWAYS, but for a newly added resource no events are sent by the repository).

INVALID_CHANNEL

public static final int INVALID_CHANNEL
Create or addfailed because the channel of the subscription and the recipient/channel combinations do not match (e.g. the channel says SMS, but for a newly added recipient no SMS channel is available).

ANNOTATION_TO_LONG

public static final int ANNOTATION_TO_LONG
Create Subscription or set Subscription failed, because the annotation exeeds the length limit. Try to have a smaller annotation.

NAME_TOO_LONG

public static final int NAME_TOO_LONG
Create Subscription or set Subscription failed, because the name exeeds the length limit. Try to have a shorter name.

NO_EVENTMAPPER_FOR_REPOSITORY

public static final int NO_EVENTMAPPER_FOR_REPOSITORY
Repository has no SubscriptionEventMapping configured. Set EventMapping for Repository

SUBSCRIPTION_ALREADY_DELETED

public static final int SUBSCRIPTION_ALREADY_DELETED
Repository has no SubscriptionEventMapping configured. Set EventMapping for Repository

m_Type

protected int m_Type
Internal type of exception

m_FieldLength

protected int m_FieldLength
Maximum length of a field (default)

m_InvalidRecipientsForChannel

protected IRecipientList m_InvalidRecipientsForChannel
Internal list of all invalid recipients for a channel
Constructor Detail

SubscriptionException

public SubscriptionException(int type)
Creates a subscription exception for a given type.
Parameters:
type - an int with the exception's type

SubscriptionException

public SubscriptionException(int type,
                             java.lang.String message)
Creates a subscription exception for a given type with an additional message.
Parameters:
type - an int with the exception's type
message - a String with the exception's message

SubscriptionException

public SubscriptionException(int type,
                             boolean log)
Creates a subscription exception for a given type with defined logging settings.

Exception logging can be enabled by passing false as second parameter
Parameters:
message - an int with the exception's type
log - a boolean false if no logging is to be done.

SubscriptionException

public SubscriptionException(int type,
                             boolean log,
                             int maxLength)
Creates a subscription exception for a given type with defined logging settings.

Exception logging can be enabled by passing false as second parameter.
Maximum length of a field can be passed as additional parameter.
Normally this message gets used by a SubscriptionException of type = ANNOTATION_TO_LONG or NAME_TOO_LONG.
Parameters:
message - an int with the exception's type
log - a boolean false if no logging is to be done.
maxLength - a int with the maximum length of the field.

SubscriptionException

public SubscriptionException(int type,
                             java.lang.String message,
                             IRecipientList invalids)
Creates a subscription exception for a given type with an additional message and an IRecipientList containing invalid recipients.

Typically, this constructor is called for type = INVALID_CHANNEL.
Parameters:
type - an int with the exception's type.
message - a String with the exception's message
invalids - an IRecipientList with all invalid recipients for a channel
Method Detail

getMessageForType

protected java.lang.String getMessageForType(int type)
Gets the default message for the exception type.
Parameters:
type - an int with the exception type
Returns:
a String with a message text for this type

getType

public int getType()
Gets the type of this SubscriptionException.
Returns:
an int with the exception's type

getMaxFieldLength

public int getMaxFieldLength()
Gets the maximum field length.
Returns:
an int with the exception's type

getMaxAnnotationLength

public int getMaxAnnotationLength()
Deprecated. as of NW04. Use SubscriptionException.getMaxFieldLength() instead

Gets the maximum annotation message length.
Returns:
an int with the exception's type

getInvalidRecipientsForChannel

public IRecipientList getInvalidRecipientsForChannel()
Gets the list of invalid recipients for a channel.

This method can only be called if type = INVALID_CHANNEL.
Returns:
an IRecipientList with all invalid recipients for a channel

getMessage

public java.lang.String getMessage()
Returns the message for this SubscriptionException.
Overrides:
getMessage in class java.lang.Throwable
Returns:
a String with the exception's message

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.