Package com.highdeal.hci
Class NotAuthorizedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.highdeal.hci.OperationFailureException
com.highdeal.hci.NotAuthorizedException
- All Implemented Interfaces:
OperationResult,XMLMarshallable,Serializable
Generic exception thrown when the
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 hisrole.CATALOG_RESTRICTION_VIOLATION: the SAP user is associated to apricing catalogand tried to perform an operation on an object from another catalog.
- See Also:
XML API for HCI
The 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>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int1: This constant shows that the required API operation was called on an object which does not belong to thepricing catalogassociated to the SAP CC user.static final int0: This constant shows that the required API operation is not allowed for the SAP CC user. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.Gets the text message corresponding to the server rejection.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 isnull.Returns the name of the operation that has been refused.getOpID()Returns the ID of the operation that has been refused.intReturns the reason why the SAP CC user is rejected; The possible reasons areOPERATION_NOT_ALLOWEDandCATALOG_RESTRICTION_VIOLATION.Returns the ID (login) of thenon authorized SAP CC user.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.intparseReason(String str) Parses the reason string into the related integer.Transforms the reason into an XML attribute string.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
OPERATION_NOT_ALLOWED
public static final int OPERATION_NOT_ALLOWED0: This constant shows that the required API operation is not allowed for the SAP CC user.- See Also:
-
CATALOG_RESTRICTION_VIOLATION
public static final int CATALOG_RESTRICTION_VIOLATION1: This constant shows that the required API operation was called on an object which does not belong to thepricing catalogassociated to the SAP CC user.- See Also:
-
-
Constructor Details
-
NotAuthorizedException
public NotAuthorizedException()Constructs an empty exception. -
NotAuthorizedException
Constructs an exception for an unauthorized operation.- Parameters:
n- The name of the unauthorized operationid- The ID of the unauthorized operation
-
NotAuthorizedException
public NotAuthorizedException(int reasonCode, String opName, String id, String userID, String internalMsg) Constructs an exception for an unauthorized operation.- Parameters:
opName- The name of the unauthorized operationid- The ID of the unauthorized operationuserID- The login of theSAP CC userwho tries to request the operationinternalMsg- The internal message why the authorization is rejected.
-
-
Method Details
-
getOpID
Returns the ID of the operation that has been refused.- Returns:
- The ID of the refused operation
-
getOperationName
Returns the name of the operation that has been refused.- Returns:
- The name of the refused operation
-
getUserID
Returns the ID (login) of thenon authorized SAP CC user.- Returns:
- The user login
-
getReason
public int getReason()Returns the reason why the SAP CC user is rejected; The possible reasons areOPERATION_NOT_ALLOWEDandCATALOG_RESTRICTION_VIOLATION.- Returns:
- The exception related reason
- See Also:
-
getInternalMsg
Gets the text message corresponding to the server rejection.- Returns:
- The exception related text message
-
reasonToString
Transforms the reason into an XML attribute string.- Returns:
- The readable reason
-
parseReason
Parses the reason string into the related integer.- Parameters:
str- The reason code- Returns:
- The reason constant value
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Parameters:
atts- TheXML attributesof the current element
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Parameters:
cData- The character data to be added
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Parameters:
output- TheXML outputto marshal the object into
-
getOperandReference
Description copied from interface:OperationResultGets 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 isnull.- Specified by:
getOperandReferencein interfaceOperationResult- Overrides:
getOperandReferencein classOperationFailureException- Returns:
- The operand reference of the operation result
-
getMessage
- Overrides:
getMessagein classThrowable
-