com.sap.cloud.security.ams.dcl.client.pdp.PolicyEvaluationException Maven / Gradle / Ivy
The newest version!
/************************************************************************
* © 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
************************************************************************/
package com.sap.cloud.security.ams.dcl.client.pdp;
public class PolicyEvaluationException extends RuntimeException {
private static final long serialVersionUID = -5707720596939165774L;
/**
* Consumers can throw own errors with a number greater or equal
*/
public static final int CLIENT_ERROR_CUSTOM = 1000;
/**
* Generic client processing error
*/
public static final int CLIENT_ERROR = 100;
/**
* The response does does not contain required elements or is malformed.
*/
public static final int CLIENT_RESULT_STRUCTURE_ERROR = 101;
/**
* The response data is null or of unexpected type
*/
public static final int CLIENT_WRONG_RESULT_TYPE = 102;
/**
* Generic error in runtime
*/
public static final int RUNTIME_ERROR = -100; //
/**
* Context structure in attributes missing
*/
public static final int RUNTIME_NO_DCL_CONTEXT = -101;
/**
* Cannot determine assigned policies
*/
public static final int RUNTIME_NO_POLICIES = -102;
/**
* Invalid arguments for operation
*/
public static final int RUNTIME_INVALID_ARGUMENTS = -103;
public static final int ENGINE_ERROR = -200; // Generic error in engine / communication to engine
/**
* Issues with calling into engine. Can include preparation steps like serialization, or url calculation.
*/
public static final int ENGINE_COMMUNICATION_FAILED = -201;
public static final int ENGINE_WAIT_TIMEOUT = -202; // Timeout in waiting for engine access
public static final int ENGINE_WAIT_INTERRUPTED = -203; // Thread was interrupted while waiting for engine access
public static final int ENGINE_STARTUP_CHECK_ERROR = -204; // Initial bundle download failed
//
//
//
private final int code;
public PolicyEvaluationException(int code, String message, Throwable cause) {
super(message, cause);
this.code = code;
}
public PolicyEvaluationException(int code, String message) {
super(message);
this.code = code;
}
public int getCode() {
return code;
}
}