com.sapportals.wcm.repository.service.subscription

Class SubscriptionException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.sapportals.wcm.WcmException
              extended bycom.sapportals.wcm.repository.service.subscription.SubscriptionException
All Implemented Interfaces:
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, String message)
          Creates a subscription exception for a given type with an additional message.
SubscriptionException(int type, 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.
 String getMessage()
          Returns the message for this SubscriptionException.
protected  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, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, 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.

See Also:
Constant Field Values

UNKNOWN_ID

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

See Also:
Constant Field Values

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)

See Also:
Constant Field Values

EVENT_MISMATCH

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

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

NO_VALID_OWNER

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

See Also:
Constant Field Values

INVALID_OWNER

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

See Also:
Constant Field Values

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).

See Also:
Constant Field Values

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).

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

NO_EVENTMAPPER_FOR_REPOSITORY

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

See Also:
Constant Field Values

SUBSCRIPTION_ALREADY_DELETED

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

See Also:
Constant Field Values

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,
                             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:
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:
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,
                             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 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 String getMessage()
Returns the message for this SubscriptionException.

Returns:
a String with the exception's message


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.