public class NotAuthorizedException extends OperationFailureException
SAP CC user is not allowed to request an operation for
one of the following reasons:
Operation not allowed: the SAP CC user is not allowed to call this operation according to his role.CATALOG_RESTRICTION_VIOLATION: the SAP user is associated to a pricing catalog and tried to perform
an operation on an object from another catalog. UserModel,
CatalogEntryModel,
Serialized FormThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="notAuthorizedFault">
<xs:complexType>
<xs:attribute name="internalMsg" type="xs:string"/>
<xs:attribute name="opID" type="xs:string"/>
<xs:attribute name="message" type="xs:string"/>
<xs:attribute name="opName" type="xs:string"/>
<xs:attribute name="userID" type="xs:string"/>
<xs:attribute name="reason" type="RefusualType"/>
</xs:complexType>
</xs:element><xs:simpleType name="RefusualType">
<xs:restriction base="xs:string">
<xs:enumeration value="operationNotAllowed"/> <!-- the user is not allowed to use the API -->
<xs:enumeration value="catalogRestrictionViolation"/>
</xs:restriction>
</xs:simpleType>
| Modifier and Type | Field and Description |
|---|---|
static int |
CATALOG_RESTRICTION_VIOLATION
1: This constant shows that the required API operation was called on an object
which does not belong to the
pricing catalog associated to the SAP CC user. |
static int |
OPERATION_NOT_ALLOWED
0: This constant shows that the required API operation is not
allowed for the SAP CC user.
|
| Constructor and Description |
|---|
NotAuthorizedException()
Constructs an empty exception.
|
NotAuthorizedException(int reasonCode,
String opName,
String id,
String userID,
String internalMsg)
Constructs an exception for an unauthorized operation.
|
NotAuthorizedException(String n,
String id)
Constructs an exception for an unauthorized operation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
String |
getInternalMsg()
Gets the text message corresponding to the
server rejection.
|
String |
getMessage() |
String |
getOperandReference()
Gets the code or the reference (if no code exists) that identifies the operand of the operation request;
If the operation is not auditable, the operand reference is
null. |
String |
getOperationName()
Returns the name of the operation that has been refused.
|
String |
getOpID()
Returns the ID of the operation that has been refused.
|
int |
getReason()
Returns the reason why the SAP CC user is rejected; The possible reasons are
OPERATION_NOT_ALLOWED and CATALOG_RESTRICTION_VIOLATION. |
String |
getUserID()
Returns the ID (login) of the
non authorized SAP CC user. |
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
int |
parseReason(String str)
Parses the reason string into the related integer.
|
String |
reasonToString()
Transforms the reason into an XML attribute string.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic static final int OPERATION_NOT_ALLOWED
public static final int CATALOG_RESTRICTION_VIOLATION
pricing catalog associated to the SAP CC user.public NotAuthorizedException()
public NotAuthorizedException(String n, String id)
n - The name of the unauthorized operationid - The ID of the unauthorized operationpublic NotAuthorizedException(int reasonCode,
String opName,
String id,
String userID,
String internalMsg)
opName - The name of the unauthorized operationid - The ID of the unauthorized operationuserID - The login of the SAP CC user who tries to request the operationinternalMsg - The internal message why the authorization is rejected.public String getOpID()
public String getOperationName()
public String getUserID()
non authorized SAP CC user.public int getReason()
OPERATION_NOT_ALLOWED and CATALOG_RESTRICTION_VIOLATION.OPERATION_NOT_ALLOWED,
CATALOG_RESTRICTION_VIOLATIONpublic String getInternalMsg()
public String reasonToString()
public int parseReason(String str)
str - The reason codepublic void setAttributes(XMLAttributes atts)
XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(String cData)
XMLMarshallablecData - The character data to be addedpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.tagName - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output)
XMLMarshallableoutput - The XML output to marshal the object intopublic String getOperandReference()
OperationResultnull.getOperandReference in interface OperationResultgetOperandReference in class OperationFailureExceptionpublic String getMessage()
getMessage in class Throwable