4.32 - Set Dynamic Separation of Duty (DSD) Set Cardinality

SDSet setDsdSetCardinality( SDSet dsdSet, int cardinality ) throws SecurityException;

This command sets the cardinality associated with a given DSD role set.

  • The new cardinality is a natural number greater than or equal to 2 and less than or equal to the number of elements of the DSD role set.
  • The DSD constraint is satisfied after setting the new cardinality.
  • Affects (runtime) role activations.

required parameters:

  • SDSet#name - contains the name for the Set to be modified.
  • cardinality - contains new cardinality setting for DSD.

Throws:

  • SecurityException - thrown in the event of data validation or system error.

setDsdSetCardinality

import org.apache.directory.fortress.core.AdminMgr;
import org.apache.directory.fortress.core.AdminMgrFactory;
import org.apache.directory.fortress.core.model.SDSet;
import org.apache.directory.fortress.core.SecurityException;

@test
public static void testSetDsdSetCardinality()
{
    String szLocation = ".testSetDsdSetCardinality";
    try
    {
        AdminMgr adminMgr = AdminMgrFactory.createInstance();
        SDSet inDsdSet = new SDSet();
        // existing set name:
        inDsdSet.setName( "myDsdSetName" );
        // a number >= 2 and <= number of elements of the DSD role set.
        int cardinality = 2;
        SDSet outDsdSet = am.setDsdSetCardinality( inDsdSet, cardinality );
    }
    catch (SecurityException ex)
    {
        LOG.error(szLocation + " caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
        fail(ex.getMessage());
    }
}