All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.security.ams.dcl.spi.pdp.PolicyDecisionPointSpi Maven / Gradle / Ivy

There is a newer version: 0.22.0
Show newest version
/************************************************************************
 * © 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();

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy