Search in sources :

Example 1 with Contextable

use of eu.bcvsolutions.idm.core.api.domain.Contextable in project CzechIdMng by bcvsolutions.

the class AbstractProvisioningExecutor method getRoleRequestIdFromContext.

/**
 * Return ID of role-request from DTO's context. If context or value missing,
 * then return null.
 *
 * @param dto
 * @return
 */
private UUID getRoleRequestIdFromContext(AbstractDto dto) {
    if (dto instanceof Contextable) {
        Contextable contextable = (Contextable) dto;
        Map<String, Object> context = contextable.getContext();
        if (context != null && context.containsKey(IdmRoleRequestService.ROLE_REQUEST_ID_KEY)) {
            Object value = context.get(IdmRoleRequestService.ROLE_REQUEST_ID_KEY);
            if (value instanceof UUID) {
                return (UUID) value;
            }
        }
    }
    return null;
}
Also used : Contextable(eu.bcvsolutions.idm.core.api.domain.Contextable) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) UUID(java.util.UUID)

Aggregations

Contextable (eu.bcvsolutions.idm.core.api.domain.Contextable)1 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)1 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)1 UUID (java.util.UUID)1