com.sap.cloud.security.ams.dcl.spi.pdp.PolicyDecisionPointSpi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spi Show documentation
Show all versions of spi Show documentation
DCL Service Provider Interface
/************************************************************************
* © 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
************************************************************************/
package com.sap.cloud.security.ams.dcl.spi.pdp;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.sap.cloud.security.ams.dcl.client.pdp.PolicyDecisionPoint;
import com.sap.cloud.security.ams.dcl.client.pdp.PolicyEvaluationKind;
/**
* Every valid PolicyDecisionPoint must implement this interface.
*/
public interface PolicyDecisionPointSpi extends PolicyDecisionPoint {
String DEFAULT_PACKAGE = "dcr._default_";
String ALLOW = "allow"; // NOSONAR
String ALLOW_PARTIAL = "allowPartial";
String PING = "ping"; // NOSONAR
String PRINCIPAL2POLICIES = "principal2policies"; // Retrieve all assignments (internal)
String DEFAULT_PING = DEFAULT_PACKAGE + "." + PING;
String DEFAULT_ALLOW = DEFAULT_PACKAGE + "." + ALLOW;
String DEFAULT_ALLOW_PARTIAL = DEFAULT_PACKAGE + "." + ALLOW_PARTIAL;
Set ALL_DEFAULT_OPERATIONS = Collections
.unmodifiableSet(new HashSet<>(Arrays.asList(DEFAULT_PING, DEFAULT_ALLOW, DEFAULT_ALLOW_PARTIAL)));
//
Statistics getStatistics();
Statistics getStatistics(PolicyEvaluationKind kind);
void resetStatistics();
interface Statistics {
long getRequestCount();
long getFailureCount();
long getOverallTime();
long getEngineTime();
}
}