public static <T extends CapabilityType> boolean hasEffectiveCapability(ResourceType resource, Class<T> capabilityClass) { return getEffectiveCapability(resource, capabilityClass) != null; }
public static boolean isCredentialsCapabilityEnabled(ResourceType resource) { return getEffectiveCapability(resource, CredentialsCapabilityType.class) != null; }
public static boolean isTestConnectionCapabilityEnabled(ResourceType resource) { return getEffectiveCapability(resource, TestConnectionCapabilityType.class) != null; }
public static boolean isAddRemoveAttributesValuesCapabilityEnabled(ResourceType resource){ return getEffectiveCapability(resource, AddRemoveAttributeValuesCapabilityType.class) != null; }
@Override public <T extends CapabilityType> T getEffectiveCapability(Class<T> capabilityClass, ResourceType resourceType) { return ResourceTypeUtil.getEffectiveCapability(resourceType, schemaHandlingObjectTypeDefinitionType, capabilityClass); }
public static boolean isActivationCapabilityEnabled(ResourceType resource) { return getEffectiveCapability(resource, ActivationCapabilityType.class) != null; }
public static boolean isCreateCapabilityEnabled(ResourceType resource){ return getEffectiveCapability(resource, CreateCapabilityType.class) != null; }
public static boolean isCountObjectsCapabilityEnabled(ResourceType resource){ return getEffectiveCapability(resource, CountObjectsCapabilityType.class) != null; }
public static boolean isScriptCapabilityEnabled(ResourceType resource) { return getEffectiveCapability(resource, ScriptCapabilityType.class) != null; }
public static <C extends CapabilityType> boolean isCapabilityEnabled(ResourceType resource, Class<C> type) { return getEffectiveCapability(resource, type) != null; }
public static boolean isPagedSearchCapabilityEnabled(ResourceType resource) { return getEffectiveCapability(resource, PagedSearchCapabilityType.class) != null; }
public static boolean isDeleteCapabilityEnabled(ResourceType resource){ return getEffectiveCapability(resource, DeleteCapabilityType.class) != null; }
/** * Assumes that native capabilities are already cached. */ @Nullable public static <T extends CapabilityType> T getEffectiveCapability(ResourceType resource, Class<T> capabilityClass) { return getEffectiveCapability(resource, null, capabilityClass); }
public static boolean resourceReadIsCachingOnly(ResourceType resource) { ReadCapabilityType readCapabilityType = ResourceTypeUtil.getEffectiveCapability(resource, ReadCapabilityType.class); if (readCapabilityType == null) { return false; // TODO reconsider this } return Boolean.TRUE.equals(readCapabilityType.isCachingOnly()); }
public static boolean isPasswordReturnedByDefault(LensProjectionContext projCtx) { CredentialsCapabilityType credentialsCapabilityType = ResourceTypeUtil.getEffectiveCapability(projCtx.getResource(), CredentialsCapabilityType.class); return CapabilityUtil.isPasswordReturnedByDefault(credentialsCapabilityType); }
public static ActivationValidityCapabilityType getEffectiveActivationValidFromCapability(ResourceType resource) { ActivationCapabilityType act = getEffectiveCapability(resource, ActivationCapabilityType.class); if (act == null || act.getValidFrom() == null || Boolean.FALSE.equals(act.getValidFrom().isEnabled())) { return null; } else { return act.getValidFrom(); } }
public static ActivationStatusCapabilityType getEffectiveActivationStatusCapability(ResourceType resource) { ActivationCapabilityType act = getEffectiveCapability(resource, ActivationCapabilityType.class); if (act == null || act.getStatus() == null || Boolean.FALSE.equals(act.getStatus().isEnabled())) { return null; } else { return act.getStatus(); } }
public static ActivationLockoutStatusCapabilityType getEffectiveActivationLockoutStatusCapability(ResourceType resource) { ActivationCapabilityType act = getEffectiveCapability(resource, ActivationCapabilityType.class); if (act == null || act.getLockoutStatus() == null || Boolean.FALSE.equals(act.getLockoutStatus().isEnabled())) { return null; } else { return act.getLockoutStatus(); } }
public static ActivationValidityCapabilityType getEffectiveActivationValidToCapability(ResourceType resource) { ActivationCapabilityType act = getEffectiveCapability(resource, ActivationCapabilityType.class); if (act == null || act.getValidTo() == null || Boolean.FALSE.equals(act.getValidTo().isEnabled())) { return null; } else { return act.getValidTo(); } }
public static PasswordCapabilityType getEffectivePasswordCapability(ResourceType resource, ResourceObjectTypeDefinitionType def) { CredentialsCapabilityType cct = getEffectiveCapability(resource, def, CredentialsCapabilityType.class); if (cct == null || cct.getPassword() == null || Boolean.FALSE.equals(cct.getPassword().isEnabled())) { return null; } else { return cct.getPassword(); } }