/** * Create an instance of {@link ActivationStatusCapabilityType } * */ public ActivationStatusCapabilityType createActivationStatusCapabilityType() { return new ActivationStatusCapabilityType(); }
/** * Creates a new {@code ActivationStatusCapabilityType} instance by deeply copying a given {@code ActivationStatusCapabilityType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ActivationStatusCapabilityType(final ActivationStatusCapabilityType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(o); if (o == null) { throw new NullPointerException("Cannot create a copy of 'ActivationStatusCapabilityType' from 'null'."); } // CBuiltinLeafInfo: java.lang.Boolean this.returnedByDefault = ((o.returnedByDefault == null)?null:o.isReturnedByDefault()); // CBuiltinLeafInfo: javax.xml.namespace.QName this.attribute = ((o.attribute == null)?null:o.getAttribute()); // 'EnableValue' collection. if (o.enableValue!= null) { copyEnableValue(o.getEnableValue(), this.getEnableValue()); } // 'DisableValue' collection. if (o.disableValue!= null) { copyDisableValue(o.getDisableValue(), this.getDisableValue()); } // CBuiltinLeafInfo: java.lang.Boolean this.ignoreAttribute = ((o.ignoreAttribute == null)?null:o.isIgnoreAttribute()); }
public ActivationStatusCapabilityType returnedByDefault(Boolean value) { setReturnedByDefault(value); return this; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); { Boolean theReturnedByDefault; theReturnedByDefault = this.isReturnedByDefault(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "returnedByDefault", theReturnedByDefault), currentHashCode, theReturnedByDefault); } { QName theAttribute; theAttribute = this.getAttribute(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attribute", theAttribute), currentHashCode, theAttribute); } { List<String> theEnableValue; theEnableValue = (((this.enableValue!= null)&&(!this.enableValue.isEmpty()))?this.getEnableValue():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "enableValue", theEnableValue), currentHashCode, theEnableValue); } { List<String> theDisableValue; theDisableValue = (((this.disableValue!= null)&&(!this.disableValue.isEmpty()))?this.getDisableValue():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "disableValue", theDisableValue), currentHashCode, theDisableValue); } { Boolean theIgnoreAttribute; theIgnoreAttribute = this.isIgnoreAttribute(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "ignoreAttribute", theIgnoreAttribute), currentHashCode, theIgnoreAttribute); } return currentHashCode; }
ActivationCapabilityType act = ((ActivationCapabilityType) capability); if (act.getStatus() == null) { ActivationStatusCapabilityType st = new ActivationStatusCapabilityType(); act.setStatus(st); st.setEnabled(false); // TODO check if all midPoint code honors this flag! st.setReturnedByDefault(false); st.setIgnoreAttribute(true); } else { ActivationStatusCapabilityType st = act.getStatus(); st.setEnabled(def(st.isEnabled(), true)); st.setReturnedByDefault(def(st.isReturnedByDefault(), true)); st.setIgnoreAttribute(def(st.isIgnoreAttribute(), true));
capAct = new ActivationCapabilityType(); ActivationStatusCapabilityType capActStatus = new ActivationStatusCapabilityType(); capAct.setStatus(capActStatus); if (!enableAttributeInfo.isReturnedByDefault()) { capActStatus.setReturnedByDefault(false);
if (statusCapabilityType.getAttribute() != null) { simulatedStatusAttribute = attributesContainer.findAttribute(statusCapabilityType.getAttribute()); SchemaDebugUtil.prettyPrint(statusCapabilityType.getAttribute()), ObjectTypeUtil.toShortString(resource), simulatedStatusAttributeValues, activationType == null ? "null" : activationType.getAdministrativeStatus()); if (statusCapabilityType.isIgnoreAttribute() == null || statusCapabilityType.isIgnoreAttribute()) { if (simulatedStatusAttribute != null) { attributesContainer.remove(simulatedStatusAttribute);
private boolean getTransformedValue(ProvisioningContext ctx, ActivationCapabilityType activationCapabilityType, ShadowType shadow, Object simulatedValue, OperationResult result) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, ExpressionEvaluationException{ ActivationStatusCapabilityType capActStatus = getActivationAdministrativeStatusFromSimulatedActivation(ctx, activationCapabilityType, shadow, result); String simulatedAttributeStringValue = String.valueOf(simulatedValue); // TODO MID-3374: implement correctly (convert value list to native objects before comparison) List<String> disableValues = capActStatus.getDisableValue(); for (String disable : disableValues) { if (disable.equals(simulatedAttributeStringValue)) { return false; } } List<String> enableValues = capActStatus.getEnableValue(); for (String enable : enableValues) { if (enable.equals(simulatedAttributeStringValue)) { return true; } } throw new SchemaException("Could not map value for simulated activation: " + simulatedValue + " neither to enable nor disable values."); }
private void checkOpenDjSchema(ResourceType resource, String source) throws SchemaException { ResourceSchema schema = RefinedResourceSchemaImpl.getResourceSchema(resource, prismContext); ObjectClassComplexTypeDefinition accountDefinition = schema.findObjectClassDefinition(RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS); assertNotNull("Schema does not define any account (resource from " + source + ")", accountDefinition); Collection<? extends ResourceAttributeDefinition> identifiers = accountDefinition.getPrimaryIdentifiers(); assertFalse("No account identifiers (resource from " + source + ")", identifiers == null || identifiers.isEmpty()); // TODO: check for naming attributes and display names, etc ActivationCapabilityType capActivation = ResourceTypeUtil.getEffectiveCapability(resource, ActivationCapabilityType.class); if (capActivation != null && capActivation.getStatus() != null && capActivation.getStatus().getAttribute() != null) { // There is simulated activation capability, check if the attribute is in schema. QName enableAttrName = capActivation.getStatus().getAttribute(); ResourceAttributeDefinition enableAttrDef = accountDefinition.findAttributeDefinition(enableAttrName); display("Simulated activation attribute definition", enableAttrDef); assertNotNull("No definition for enable attribute " + enableAttrName + " in account (resource from " + source + ")", enableAttrDef); assertTrue("Enable attribute " + enableAttrName + " is not ignored (resource from " + source + ")", enableAttrDef.isIgnored()); } }
public ActivationStatusCapabilityType disableValue(String value) { getDisableValue().add(value); return this; }
public ActivationStatusCapabilityType enableValue(String value) { getEnableValue().add(value); return this; }
lhsReturnedByDefault = this.isReturnedByDefault(); Boolean rhsReturnedByDefault; rhsReturnedByDefault = that.isReturnedByDefault(); if (!strategy.equals(LocatorUtils.property(thisLocator, "returnedByDefault", lhsReturnedByDefault), LocatorUtils.property(thatLocator, "returnedByDefault", rhsReturnedByDefault), lhsReturnedByDefault, rhsReturnedByDefault)) { return false; lhsAttribute = this.getAttribute(); QName rhsAttribute; rhsAttribute = that.getAttribute(); if (!strategy.equals(LocatorUtils.property(thisLocator, "attribute", lhsAttribute), LocatorUtils.property(thatLocator, "attribute", rhsAttribute), lhsAttribute, rhsAttribute)) { return false; lhsEnableValue = (((this.enableValue!= null)&&(!this.enableValue.isEmpty()))?this.getEnableValue():null); List<String> rhsEnableValue; rhsEnableValue = (((that.enableValue!= null)&&(!that.enableValue.isEmpty()))?that.getEnableValue():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "enableValue", lhsEnableValue), LocatorUtils.property(thatLocator, "enableValue", rhsEnableValue), lhsEnableValue, rhsEnableValue)) { return false; lhsDisableValue = (((this.disableValue!= null)&&(!this.disableValue.isEmpty()))?this.getDisableValue():null); List<String> rhsDisableValue; rhsDisableValue = (((that.disableValue!= null)&&(!that.disableValue.isEmpty()))?that.getDisableValue():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "disableValue", lhsDisableValue), LocatorUtils.property(thatLocator, "disableValue", rhsDisableValue), lhsDisableValue, rhsDisableValue)) { return false; lhsIgnoreAttribute = this.isIgnoreAttribute(); Boolean rhsIgnoreAttribute; rhsIgnoreAttribute = that.isIgnoreAttribute(); if (!strategy.equals(LocatorUtils.property(thisLocator, "ignoreAttribute", lhsIgnoreAttribute), LocatorUtils.property(thatLocator, "ignoreAttribute", rhsIgnoreAttribute), lhsIgnoreAttribute, rhsIgnoreAttribute)) { return false;
.getCapabilities().getConfigured().getAny(), ActivationCapabilityType.class); if (CapabilityUtil.getEffectiveActivationStatus(activationCapability) != null) { QName attributeName = activationCapability.getStatus().getAttribute(); Boolean ignore = activationCapability.getStatus().isIgnoreAttribute(); if (attributeName != null) {
ResourceType resource, Collection<Object> simulatedStatusAttributeValues, OperationResult parentResult) { List<String> disableValues = statusCapabilityType.getDisableValue(); List<String> enableValues = statusCapabilityType.getEnableValue();
private <T> ResourceAttribute<T> getSimulatedActivationAdministrativeStatusAttribute(ProvisioningContext ctx, ShadowType shadow, ActivationStatusCapabilityType capActStatus, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, ExpressionEvaluationException { if (capActStatus == null){ return null; } ResourceType resource = ctx.getResource(); QName enableAttributeName = capActStatus.getAttribute(); LOGGER.trace("Simulated attribute name: {}", enableAttributeName); if (enableAttributeName == null) { result.recordWarning("Resource " + ObjectTypeUtil.toShortString(resource) + " does not have attribute specification for simulated activation status capability. Processing of activation for "+ shadow +" was skipped"); shadow.setFetchResult(result.createOperationResultType()); return null; } ResourceAttributeDefinition<T> enableAttributeDefinition = ctx.getObjectClassDefinition() .findAttributeDefinition(enableAttributeName); if (enableAttributeDefinition == null) { result.recordWarning("Resource " + ObjectTypeUtil.toShortString(resource) + " attribute for simulated activation/enableDisable capability" + enableAttributeName + " in not present in the schema for objeclass " + ctx.getObjectClassDefinition()+". Processing of activation for "+ ObjectTypeUtil.toShortString(shadow)+" was skipped"); shadow.setFetchResult(result.createOperationResultType()); return null; } return enableAttributeDefinition.instantiate(enableAttributeName); }
private <T> T getDisableValue(ActivationStatusCapabilityType capActStatus, Class<T> clazz) { //TODO some checks Object value = capActStatus.getDisableValue().iterator().next(); return JavaTypeConverter.convert(clazz, value); }
private <T> T getEnableValue(ActivationStatusCapabilityType capActStatus, Class<T> clazz) { String value = capActStatus.getEnableValue().iterator().next(); return JavaTypeConverter.convert(clazz, value); }
clone.returnedByDefault = ((this.returnedByDefault == null)?null:this.isReturnedByDefault()); clone.attribute = ((this.attribute == null)?null:this.getAttribute()); copyEnableValue(this.getEnableValue(), clone.getEnableValue()); copyDisableValue(this.getDisableValue(), clone.getDisableValue()); clone.ignoreAttribute = ((this.ignoreAttribute == null)?null:this.isIgnoreAttribute()); return clone;
/** * Create an instance of {@link ActivationStatusCapabilityType } * */ public ActivationStatusCapabilityType createActivationStatusCapabilityType() { return new ActivationStatusCapabilityType(); }
/** * Create an instance of {@link ActivationStatusCapabilityType } * */ public ActivationStatusCapabilityType createActivationStatusCapabilityType() { return new ActivationStatusCapabilityType(); }