/** * Create an instance of {@link CredentialsCapabilityType } * */ public CredentialsCapabilityType createCredentialsCapabilityType() { return new CredentialsCapabilityType(); }
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(); } }
public CredentialsCapabilityType password(PasswordCapabilityType value) { setPassword(value); return this; }
capabilities.add(CAPABILITY_OBJECT_FACTORY.createActivation(activationCap)); CredentialsCapabilityType credentialsCap = new CredentialsCapabilityType(); PasswordCapabilityType passwordCapabilityType = new PasswordCapabilityType(); credentialsCap.setPassword(passwordCapabilityType); capabilities.add(CAPABILITY_OBJECT_FACTORY.createCredentials(credentialsCap));
if (cred.getPassword() == null) { PasswordCapabilityType pc = new PasswordCapabilityType(); cred.setPassword(pc); pc.setEnabled(false); pc.setReturnedByDefault(false); } else { PasswordCapabilityType pc = cred.getPassword(); pc.setEnabled(def(pc.isEnabled(), true)); pc.setReturnedByDefault(def(pc.isReturnedByDefault(), true));
public int hashCode() { final HashCodeStrategy strategy = DomAwareHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public PasswordCapabilityType beginPassword() { PasswordCapabilityType value = new PasswordCapabilityType(); password(value); return value; }
CredentialsCapabilityType capCred = new CredentialsCapabilityType(); PasswordCapabilityType capPass = new PasswordCapabilityType(); if (!passwordAttributeInfo.isReturnedByDefault()) { capPass.setReadable(true); capCred.setPassword(capPass); capabilities.add(CAPABILITY_OBJECT_FACTORY.createCredentials(capCred));
/** * Creates a new {@code CredentialsCapabilityType} instance by deeply copying a given {@code CredentialsCapabilityType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public CredentialsCapabilityType(final CredentialsCapabilityType 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 'CredentialsCapabilityType' from 'null'."); } // CClassInfo: com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.PasswordCapabilityType this.password = ((o.password == null)?null:((o.getPassword() == null)?null:o.getPassword().clone())); }
/** * Create an instance of {@link CredentialsCapabilityType } * */ public CredentialsCapabilityType createCredentialsCapabilityType() { return new CredentialsCapabilityType(); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public CredentialsCapabilityType clone() { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final CredentialsCapabilityType clone = ((CredentialsCapabilityType) super.clone()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.PasswordCapabilityType clone.password = ((this.password == null)?null:((this.getPassword() == null)?null:this.getPassword().clone())); return clone; } }
/** * Create an instance of {@link CredentialsCapabilityType } * */ public CredentialsCapabilityType createCredentialsCapabilityType() { return new CredentialsCapabilityType(); }
public static boolean isPasswordReturnedByDefault(CredentialsCapabilityType capability) { if (capability == null) { return false; } PasswordCapabilityType password = capability.getPassword(); if (password == null) { return false; } if (password.isReturnedByDefault() == null) { return true; } return password.isReturnedByDefault(); }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof CredentialsCapabilityType)) { return false; } if (this == object) { return true; } if (!super.equals(thisLocator, thatLocator, object, strategy)) { return false; } final CredentialsCapabilityType that = ((CredentialsCapabilityType) object); { PasswordCapabilityType lhsPassword; lhsPassword = this.getPassword(); PasswordCapabilityType rhsPassword; rhsPassword = that.getPassword(); if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { return false; } } return true; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); { PasswordCapabilityType thePassword; thePassword = this.getPassword(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); } return currentHashCode; }
private boolean getEvaluateWeak(LensProjectionContext projCtx) { CredentialsCapabilityType credentialsCapabilityType = ResourceTypeUtil.getEffectiveCapability(projCtx.getResource(), CredentialsCapabilityType.class); if (credentialsCapabilityType != null) { PasswordCapabilityType passwordCapabilityType = credentialsCapabilityType.getPassword(); if (passwordCapabilityType != null) { if (passwordCapabilityType.isEnabled() != Boolean.FALSE) { Boolean readable = passwordCapabilityType.isReadable(); if (readable != null && readable) { // If we have readable password then we can evaluate the weak mappings // normally (even if the reads return incomplete values). return true; } } } } // Password not readable. Therefore evaluate weak mappings only during add operaitons. // We do not know whether there is a password already set on the resource. And we do not // want to overwrite it every time. return projCtx.isAdd(); }
protected void assertNativeCredentialsCapability(CredentialsCapabilityType capCred) { PasswordCapabilityType passwordCapabilityType = capCred.getPassword(); assertNotNull("password native capability not present", passwordCapabilityType); Boolean readable = passwordCapabilityType.isReadable(); if (readable != null) { assertFalse("Unexpected 'readable' in password capability", readable); } }
@Override protected void assertNativeCredentialsCapability(CredentialsCapabilityType capCred) { PasswordCapabilityType passwordCapabilityType = capCred.getPassword(); assertNotNull("password native capability not present", passwordCapabilityType); Boolean readable = passwordCapabilityType.isReadable(); assertNotNull("No 'readable' inducation in password capability", readable); assertTrue("Password not 'readable' in password capability", readable); }
@Override public <F extends FocusType> String computeProjectionLifecycle(F focus, ShadowType shadow, ResourceType resource) { if (focus == null || shadow == null) { return null; } if (!(focus instanceof UserType)) { return null; } if (shadow.getKind() != null && shadow.getKind() != ShadowKindType.ACCOUNT) { return null; } ProtectedStringType passwordPs = FocusTypeUtil.getPasswordValue((UserType) focus); if (passwordPs != null && passwordPs.canGetCleartext()) { return null; } CredentialsCapabilityType credentialsCapabilityType = ResourceTypeUtil .getEffectiveCapability(resource, CredentialsCapabilityType.class); if (credentialsCapabilityType == null) { return null; } PasswordCapabilityType passwordCapabilityType = credentialsCapabilityType.getPassword(); if (passwordCapabilityType == null) { return null; } if (passwordCapabilityType.isEnabled() == Boolean.FALSE) { return null; } return SchemaConstants.LIFECYCLE_PROPOSED; }