/** * Create an instance of {@link PolicyItemDefinitionType } * */ public PolicyItemDefinitionType createPolicyItemDefinitionType() { return new PolicyItemDefinitionType(); }
/** * Creates a new {@code PolicyItemDefinitionType} instance by deeply copying a given {@code PolicyItemDefinitionType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public PolicyItemDefinitionType(final PolicyItemDefinitionType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'PolicyItemDefinitionType' from 'null'."); } // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemTargetType this.target = ((o.target == null)?null:((o.getTarget() == null)?null:o.getTarget().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType this.valuePolicyRef = ((o.valuePolicyRef == null)?null:((o.getValuePolicyRef() == null)?null:o.getValuePolicyRef().clone())); // CBuiltinLeafInfo: java.lang.Object this.value = ((o.value == null)?null:copyOf(o.getValue())); // CBuiltinLeafInfo: java.lang.Boolean this.execute = ((o.execute == null)?null:o.isExecute()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType this.result = ((o.result == null)?null:((o.getResult() == null)?null:o.getResult().clone())); }
public PolicyItemDefinitionType result(OperationResultType value) { setResult(value); return this; }
if (itemsDefinition == null) { itemsDefinition = new PolicyItemsDefinitionType().policyItemDefinition( new PolicyItemDefinitionType() .target(new PolicyItemTargetType().path(new ItemPathType(PATH_CREDENTIALS_PASSWORD_VALUE))) .execute(false));
Object value = policyItemDefinition.getValue(); String valueToValidate; if (value instanceof RawType) { PolicyItemTargetType target = policyItemDefinition.getTarget(); ItemPath path = target != null ? target.getPath().getItemPath() : null; if (StringUtils.isNotEmpty(valueToValidate)) { policyItemDefinition.setResult(parentResult.createOperationResultType());
PolicyItemDefinitionType policyItemDefinitione = new PolicyItemDefinitionType(); policyItemDefinitione.setValue(executeCredentialResetRequest.getUserEntry());
private <O extends ObjectType> void collectDeltasForGeneratedValuesIfNeeded(PrismObject<O> object, PolicyItemDefinitionType policyItemDefinition, Collection<PropertyDelta<?>> deltasToExecute, ItemPath path, PrismPropertyDefinition<?> itemDef, OperationResult result) throws SchemaException { Object value = policyItemDefinition.getValue(); if (itemDef != null){ if (ProtectedStringType.COMPLEX_TYPE.equals(itemDef.getTypeName())) { ProtectedStringType pst = new ProtectedStringType(); pst.setClearValue((String) value); value = pst; } else if (PolyStringType.COMPLEX_TYPE.equals(itemDef.getTypeName())) { value = new PolyString((String) value); } } if (object == null && isExecute(policyItemDefinition)) { LOGGER.warn("Cannot apply generated changes and cannot execute them becasue there is no target object specified."); result.recordFatalError("Cannot apply generated changes and cannot execute them becasue there is no target object specified."); return; } if (object != null) { PropertyDelta<?> propertyDelta = prismContext.deltaFactory().property() .createModificationReplaceProperty(path, object.getDefinition(), value); propertyDelta.applyTo(object); // in bulk actions we need to modify original objects - hope that REST is OK with this if (BooleanUtils.isTrue(policyItemDefinition.isExecute())) { deltasToExecute.add(propertyDelta); } } }
ConfigurationException, SecurityViolationException { PolicyItemTargetType target = policyItemDefinition.getTarget(); if ((target == null || ItemPathTypeUtil.isEmpty(target.getPath())) && isExecute(policyItemDefinition)) { LOGGER.error("Target item path must be defined"); policyItemDefinition.setValue(newValue);
public PolicyItemDefinitionType value(Object value) { setValue(value); return this; }
public PolicyItemTargetType beginTarget() { PolicyItemTargetType value = new PolicyItemTargetType(); target(value); return value; }
private ValuePolicyType resolveValuePolicy(PolicyItemDefinitionType policyItemDefinition, ValuePolicyType defaultPolicy, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { if (policyItemDefinition.getValuePolicyRef() != null) { LOGGER.trace("Trying to resolve value policy {} for policy item definition", policyItemDefinition); return objectResolver.resolve(policyItemDefinition.getValuePolicyRef(), ValuePolicyType.class, null, "valuePolicyRef in policyItemDefinition", task, result); } return defaultPolicy; }
private ItemPath getPath(PolicyItemDefinitionType policyItemDefinition) { PolicyItemTargetType target = policyItemDefinition.getTarget(); if (target == null) { return null; } ItemPathType itemPathType = target.getPath(); return itemPathType != null ? itemPathType.getItemPath() : null; }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public PolicyItemDefinitionType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final PolicyItemDefinitionType clone = ((PolicyItemDefinitionType) super.clone()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemTargetType clone.target = ((this.target == null)?null:((this.getTarget() == null)?null:this.getTarget().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType clone.valuePolicyRef = ((this.valuePolicyRef == null)?null:((this.getValuePolicyRef() == null)?null:this.getValuePolicyRef().clone())); // CBuiltinLeafInfo: java.lang.Object clone.value = ((this.value == null)?null:copyOf(this.getValue())); // CBuiltinLeafInfo: java.lang.Boolean clone.execute = ((this.execute == null)?null:this.isExecute()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType clone.result = ((this.result == null)?null:((this.getResult() == null)?null:this.getResult().clone())); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
/** * Create an instance of {@link PolicyItemDefinitionType } * */ public PolicyItemDefinitionType createPolicyItemDefinitionType() { return new PolicyItemDefinitionType(); }
LOGGER.error("Failed to generate value for {} ", policyItemDefinition, e); generateValueResult.recordFatalError("Failed to generate value for " + policyItemDefinition + ". Reason: " + e.getMessage(), e); policyItemDefinition.setResult(generateValueResult.createOperationResultType()); continue;
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { PolicyItemTargetType theTarget; theTarget = this.getTarget(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "target", theTarget), currentHashCode, theTarget); } { ObjectReferenceType theValuePolicyRef; theValuePolicyRef = this.getValuePolicyRef(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "valuePolicyRef", theValuePolicyRef), currentHashCode, theValuePolicyRef); } { Object theValue; theValue = this.getValue(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); } { Boolean theExecute; theExecute = this.isExecute(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "execute", theExecute), currentHashCode, theExecute); } { OperationResultType theResult; theResult = this.getResult(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "result", theResult), currentHashCode, theResult); } return currentHashCode; }
/** * Create an instance of {@link PolicyItemDefinitionType } * */ public PolicyItemDefinitionType createPolicyItemDefinitionType() { return new PolicyItemDefinitionType(); }
lhsTarget = this.getTarget(); PolicyItemTargetType rhsTarget; rhsTarget = that.getTarget(); if (!strategy.equals(LocatorUtils.property(thisLocator, "target", lhsTarget), LocatorUtils.property(thatLocator, "target", rhsTarget), lhsTarget, rhsTarget)) { return false; lhsValuePolicyRef = this.getValuePolicyRef(); ObjectReferenceType rhsValuePolicyRef; rhsValuePolicyRef = that.getValuePolicyRef(); if (!strategy.equals(LocatorUtils.property(thisLocator, "valuePolicyRef", lhsValuePolicyRef), LocatorUtils.property(thatLocator, "valuePolicyRef", rhsValuePolicyRef), lhsValuePolicyRef, rhsValuePolicyRef)) { return false; lhsValue = this.getValue(); Object rhsValue; rhsValue = that.getValue(); if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { return false; lhsExecute = this.isExecute(); Boolean rhsExecute; rhsExecute = that.isExecute(); if (!strategy.equals(LocatorUtils.property(thisLocator, "execute", lhsExecute), LocatorUtils.property(thatLocator, "execute", rhsExecute), lhsExecute, rhsExecute)) { return false; lhsResult = this.getResult(); OperationResultType rhsResult; rhsResult = that.getResult(); if (!strategy.equals(LocatorUtils.property(thisLocator, "result", lhsResult), LocatorUtils.property(thatLocator, "result", rhsResult), lhsResult, rhsResult)) { return false;
public PolicyItemDefinitionType beginPolicyItemDefinition() { PolicyItemDefinitionType value = new PolicyItemDefinitionType(); policyItemDefinition(value); return value; }