private static boolean visit(List<? extends AbstractPolicyConstraintType> constraints, QName name, ConstraintVisitor visitor) { for (AbstractPolicyConstraintType constraint : constraints) { if (!visitor.visit(name, constraint)) { return false; } } return true; }
private static <T extends PrismValue> Collection<T> getValuesFromFilter(List<? extends ObjectFilter> conditions, QName propertyName, PrismContext prismContext) throws SchemaException { for (ObjectFilter f : conditions) { Collection<T> values = getValuesFromFilter(f, propertyName, prismContext); if (values != null) { return values; } } return null; }
/** * Assumes that native capabilities are already cached. */ public static List<Object> getAllCapabilities(ResourceType resource) throws SchemaException { return getEffectiveCapabilities(resource, true); }
@Override public String toString() { return "ResourceOperationDescription(objectDelta=" + objectDelta + ", currentShadow=" + SchemaDebugUtil.prettyPrint(currentShadow) + ", sourceChannel=" + sourceChannel + ", resource=" + resource + (asynchronous ? ", ASYNC" : "") + (attemptNumber != 0 ? ", attemptNumber="+attemptNumber : "") + ", result=" + result + ")"; }
@Override public String toString() { return toShortString(object); } };
private static FilterComponents factorOutFilter(PrismContext prismContext, ObjectFilter filter, List<FilterExtractor> extractors, ItemPath... paths) { FilterComponents components = new FilterComponents(); factorOutFilter(components, simplify(filter, prismContext), extractors, Arrays.asList(paths), true); return components; }
@Override public <T extends CapabilityType> T getEffectiveCapability(Class<T> capabilityClass, ResourceType resourceType) { return ResourceTypeUtil.getEffectiveCapability(resourceType, schemaHandlingObjectTypeDefinitionType, capabilityClass); }
public static void resolveReferences(List<PolicyRuleType> rules, Collection<? extends PolicyRuleType> otherRules, PrismContext prismContext) throws SchemaException, ObjectNotFoundException { LazyMapConstraintsResolver resolver = new LazyMapConstraintsResolver(prismContext, createConstraintsSupplier(rules), createConstraintsSupplier(otherRules)); for (PolicyRuleType rule : rules) { resolveReferences(rule.getPolicyConstraints(), resolver); } }
public static AbstractAuthenticationPolicyType getAuthenticationPolicy(String authPolicyName, SecurityPolicyType securityPolicy) throws SchemaException { MailAuthenticationPolicyType mailAuthPolicy = getMailAuthenticationPolicy( authPolicyName, securityPolicy); SmsAuthenticationPolicyType smsAuthPolicy = getSmsAuthenticationPolicy( authPolicyName, securityPolicy); return checkAndGetAuthPolicyConsistence(mailAuthPolicy, smsAuthPolicy); }
private static Visitor createNormalizingVisitor(RelationRegistry relationRegistry) { return v -> { if (v instanceof PrismReferenceValue) { normalizeRelation((PrismReferenceValue) v, relationRegistry); } }; }
@Override public <T extends PolicyActionType> List<T> getEnabledActions(Class<T> clazz) { return PolicyRuleTypeUtil.filterActions(enabledActions, clazz); }
private void validateSchema(ProvisioningContext ctx, PrismObject<ShadowType> shadow, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, ExpressionEvaluationException { if (ResourceTypeUtil.isValidateSchema(ctx.getResource())) { ShadowUtil.validateAttributeSchema(shadow, ctx.getObjectClassDefinition()); } }
private static boolean accept(List<PolicyConstraintsType> constraintsList, ConstraintVisitor matcher, boolean alsoRoots, QName rootElementName, boolean ignoreRefs) { for (PolicyConstraintsType constraints : constraintsList) { if (!accept(constraints, matcher, true, alsoRoots, rootElementName, ignoreRefs)) { return false; } } return true; }
public static boolean contains(Collection<ObjectReferenceType> collection, ObjectReferenceType item) { for (ObjectReferenceType collectionItem: collection) { if (matches(collectionItem, item)) { return true; } } return false; }
private boolean hasMatchingProjection(ShadowType cprojection, List<ShadowType> projections) { for (ShadowType projection: projections) { if (ShadowUtil.isConflicting(projection, cprojection)) { return true; } } return false; }
private static void getExclusionTriggersFromRules(List<EvaluatedExclusionTriggerType> rv, List<EvaluatedPolicyRuleType> rules) { for (EvaluatedPolicyRuleType rule : rules) { getExclusionTriggersFromRule(rv, rule); } }
@Override public String toString() { return "ResourceObjectShadowChangeDescription(objectDelta=" + objectDelta + ", currentShadow=" + SchemaDebugUtil.prettyPrint(currentShadow) + ", oldShadow=" + SchemaDebugUtil.prettyPrint(oldShadow) + ", sourceChannel=" + sourceChannel + ", resource=" + resource + (unrelatedChange ? " UNRELATED" : "") + (simulate ? " SIMULATE" : "") +")"; }
/** * Assumes that native capabilities are already cached. */ public static List<Object> getEffectiveCapabilities(ResourceType resource) throws SchemaException { return getEffectiveCapabilities(resource, false); }
@Override public String toString() { return "ResourceEventDescription(delta=" + delta + ", currentShadow=" + SchemaDebugUtil.prettyPrint(currentShadow) + ", oldShadow=" + SchemaDebugUtil.prettyPrint(oldShadow) + ", sourceChannel=" + sourceChannel + ")"; }
@Override public String toString() { return "ConstructionPack(" + SchemaDebugUtil.prettyPrint(constructions) + (forceRecon ? ", forceRecon" : "") + ")"; }