/** * Create an instance of {@link PasswordCapabilityType } * */ public PasswordCapabilityType createPasswordCapabilityType() { return new PasswordCapabilityType(); }
/** * Creates a new {@code PasswordCapabilityType} instance by deeply copying a given {@code PasswordCapabilityType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public PasswordCapabilityType(final PasswordCapabilityType 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 'PasswordCapabilityType' from 'null'."); } // CBuiltinLeafInfo: java.lang.Boolean this.returnedByDefault = ((o.returnedByDefault == null)?null:o.isReturnedByDefault()); // CBuiltinLeafInfo: java.lang.Boolean this.readable = ((o.readable == null)?null:o.isReadable()); }
public PasswordCapabilityType readable(Boolean value) { setReadable(value); return this; }
CredentialsCapabilityType cred = ((CredentialsCapabilityType) capability); 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));
PasswordCapabilityType capPass = new PasswordCapabilityType(); if (!passwordAttributeInfo.isReturnedByDefault()) { capPass.setReturnedByDefault(false); capPass.setReadable(true);
protected void assertPasswordCapability(PasswordCapabilityType capPassword) { assertTrue("Wrong password capability readable flag: "+capPassword.isReadable(), capPassword.isReadable() != Boolean.TRUE); }
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(); }
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 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 PasswordCapabilityType returnedByDefault(Boolean value) { setReturnedByDefault(value); return this; }
@Override protected void assertPasswordCapability(PasswordCapabilityType capPassword) { assertTrue("Wrong password capability readable flag: "+capPassword.isReadable(), capPassword.isReadable() == Boolean.TRUE); }
@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; }
@Test public void test001Connection() throws Exception { final String TEST_NAME = "test001Connection"; TestUtil.displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); // WHEN OperationResult testResult = provisioningService.testResource(RESOURCE_DERBY_OID, task); display("Test result",testResult); TestUtil.assertSuccess("Test resource failed (result)", testResult); ResourceType resource = repositoryService.getObject(ResourceType.class, RESOURCE_DERBY_OID, null, result).asObjectable(); display("Resource after test",resource); display("Resource after test (XML)", PrismTestUtil.serializeObjectToString(resource.asPrismObject(), PrismContext.LANG_XML)); List<Object> nativeCapabilities = resource.getCapabilities().getNative().getAny(); CredentialsCapabilityType credentialsCapabilityType = CapabilityUtil.getCapability(nativeCapabilities, CredentialsCapabilityType.class); assertNotNull("No credentials capability", credentialsCapabilityType); PasswordCapabilityType passwordCapabilityType = credentialsCapabilityType.getPassword(); assertNotNull("No password in credentials capability", passwordCapabilityType); assertEquals("Wrong password capability ReturnedByDefault", Boolean.FALSE, passwordCapabilityType.isReturnedByDefault()); }
/** * Create an instance of {@link PasswordCapabilityType } * */ public PasswordCapabilityType createPasswordCapabilityType() { return new PasswordCapabilityType(); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public PasswordCapabilityType clone() { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final PasswordCapabilityType clone = ((PasswordCapabilityType) super.clone()); // CBuiltinLeafInfo: java.lang.Boolean clone.returnedByDefault = ((this.returnedByDefault == null)?null:this.isReturnedByDefault()); // CBuiltinLeafInfo: java.lang.Boolean clone.readable = ((this.readable == null)?null:this.isReadable()); return clone; } }
@Override protected void assertPasswordCapability(PasswordCapabilityType capPassword) { assertTrue("Wrong password capability readable flag: "+capPassword.isReadable(), capPassword.isReadable() == Boolean.TRUE); }
/** * Create an instance of {@link PasswordCapabilityType } * */ public PasswordCapabilityType createPasswordCapabilityType() { return new PasswordCapabilityType(); }
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); } { Boolean theReadable; theReadable = this.isReadable(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "readable", theReadable), currentHashCode, theReadable); } return currentHashCode; }
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); } }
public PasswordCapabilityType beginPassword() { PasswordCapabilityType value = new PasswordCapabilityType(); password(value); return value; }