@Override public boolean equals(Object object) { if (!(object instanceof PasswordType)) { return false; } PasswordType other = ((PasswordType) object); return asPrismContainerValue().equivalent(other.asPrismContainerValue()); }
@Override public String toString() { return asPrismContainerValue().toString(); }
@Override public int hashCode() { return asPrismContainerValue().hashCode(); }
@XmlElement(name = "value") public ProtectedStringType getValue() { return PrismForJAXBUtil.getPropertyValue(asPrismContainerValue(), F_VALUE, ProtectedStringType.class); }
public void setValue(ProtectedStringType value) { PrismForJAXBUtil.setPropertyValue(asPrismContainerValue(), F_VALUE, value); }
@XmlElement(name = "historyEntry") public List<PasswordHistoryEntryType> getHistoryEntry() { PrismContainerValue pcv = asPrismContainerValue(); PrismContainer container = PrismForJAXBUtil.getContainer(pcv, F_HISTORY_ENTRY); return new PasswordType.AnonHistoryEntry(container, pcv); }
public void setPassword(PasswordType value) { PrismContainerValue fieldContainerValue = ((value!= null)?value.asPrismContainerValue():null); PrismForJAXBUtil.setFieldContainerValue(asPrismContainerValue(), F_PASSWORD, fieldContainerValue); }
public List<PasswordHistoryEntryType> createHistoryEntryList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_HISTORY_ENTRY); return getHistoryEntry(); }
public PasswordType clone() { PasswordType object = new PasswordType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
public<X >X end() { return ((X)((PrismContainerValue)((PrismContainer) asPrismContainerValue().getParent()).getParent()).asContainerable()); }
public static void setPasswordIncomplete(ShadowType shadowType) throws SchemaException { CredentialsType credentialsType = shadowType.getCredentials(); if (credentialsType == null) { credentialsType = new CredentialsType(); shadowType.setCredentials(credentialsType); } PasswordType passwordType = credentialsType.getPassword(); if (passwordType == null) { passwordType = new PasswordType(); credentialsType.setPassword(passwordType); } PrismContainerValue<PasswordType> passwordContainer = passwordType.asPrismContainerValue(); PrismProperty<ProtectedStringType> valueProperty = passwordContainer.findOrCreateProperty(PasswordType.F_VALUE); valueProperty.setIncomplete(true); }
@Override protected void checkAccountWill(PrismObject<ShadowType> shadow, OperationResult result, XMLGregorianCalendar startTs, XMLGregorianCalendar endTs) throws SchemaException, EncryptionException { super.checkAccountWill(shadow, result, startTs, endTs); CredentialsType credentials = shadow.asObjectable().getCredentials(); assertNotNull("No credentials in "+shadow, credentials); PasswordType password = credentials.getPassword(); assertNotNull("No password in "+shadow, password); PrismContainerValue<PasswordType> passwordContainerValue = password.asPrismContainerValue(); PrismProperty<ProtectedStringType> valueProperty = passwordContainerValue.findProperty(PasswordType.F_VALUE); assertTrue("Unexpected password value in "+shadow+": "+valueProperty, valueProperty.getValues().isEmpty()); assertTrue("No incompleteness in password value in "+shadow+": "+valueProperty, valueProperty.isIncomplete()); }
@Override protected void assertShadowPassword(ShadowType provisioningShadow) { CredentialsType credentials = provisioningShadow.getCredentials(); if (credentials == null) { return; } PasswordType passwordType = credentials.getPassword(); if (passwordType == null) { return; } ProtectedStringType passwordValue = passwordType.getValue(); assertNull("Unexpected password value in "+provisioningShadow+": "+passwordValue, passwordValue); PrismContainerValue<PasswordType> passwordContainer = passwordType.asPrismContainerValue(); PrismProperty<ProtectedStringType> valueProp = passwordContainer.findProperty(PasswordType.F_VALUE); assertTrue("Incomplete flag is NOT set for password value in "+provisioningShadow, valueProp.isIncomplete()); } }
currentPasswordType.asPrismContainerValue().findContainer(PasswordType.F_HISTORY_ENTRY), false); int i = 1; for (PasswordHistoryEntryType historyEntry: sortedHistoryList) {
@Override protected void assertShadowPassword(ShadowType provisioningShadow) throws Exception { CredentialsType credentials = provisioningShadow.getCredentials(); if (credentials == null) { return; } PasswordType passwordType = credentials.getPassword(); if (passwordType == null) { return; } ProtectedStringType passwordValue = passwordType.getValue(); assertNotNull("Missing password value in "+provisioningShadow, passwordValue); assertFalse("Empty password value in "+provisioningShadow, passwordValue.isEmpty()); String clearPassword = protector.decryptString(passwordValue); display("Clear password of "+provisioningShadow+": "+clearPassword); PrismContainerValue<PasswordType> passwordContainer = passwordType.asPrismContainerValue(); PrismProperty<ProtectedStringType> valueProp = passwordContainer.findProperty(PasswordType.F_VALUE); assertFalse("Incomplete password value in "+provisioningShadow, valueProp.isIncomplete()); } }