@Test(enabled = true, dependsOnMethods = { "testCreateUser" }) public void testUpdateUser() { Uid uid = new Uid("AAA0001"); Set<Attribute> replaceAttributes = new HashSet<Attribute>(); replaceAttributes.add(AttributeBuilder.build(PredefinedAttributes.GROUPS_NAME, "AAB0001")); OperationOptions oo = null; Uid result = facade.update(ObjectClass.ACCOUNT, uid, replaceAttributes, oo); Assert.assertEquals(uid, result); }
public Uid update(ObjectClass objClass, Uid uid, Set<Attribute> replaceAttributes, OperationOptions options) { final String method = "update"; LOG.info("Entry {0}", method); if (ObjectClass.ACCOUNT.is(objClass.getObjectClassValue())) { try { PDMessages msgs = new PDMessages(); GuardedString password = AttributeUtil.getPasswordValue(replaceAttributes); if (null != password) { GuardedStringAccessor accessor = new GuardedStringAccessor(); password.access(accessor); if (LOG.isInfo()) { LOG.info("PDUser.setPassword(ctxt,{0},Password,msgs)", uid.getUidValue()); } PDUser.setPassword(ctxt, uid.getUidValue(), accessor.getArray(), msgs); processMessages(method, msgs); if (configuration.isSyncGSOCredentials()) { updateGSOCredentialPasswords(uid.getUidValue(), accessor); } } Attribute firstNameAttr = AttributeUtil.find(ATTR_FIRST_NAME, replaceAttributes); if (null != firstNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the firstName update."); } Attribute lastNameAttr = AttributeUtil.find(ATTR_LAST_NAME, replaceAttributes); if (null != lastNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the lastName update."); } Attribute descriptionAttr = AttributeUtil.find(PredefinedAttributes.DESCRIPTION, replaceAttributes); if (null != descriptionAttr) { String description = AttributeUtil.getStringValue(descriptionAttr); if (StringUtil.isNotBlank(description)) { if (LOG.isInfo()) { LOG.info("PDUser.setDescription(ctxt,{0},{1},msgs)", uid.getUidValue(), description); } PDUser.setDescription(ctxt, uid.getUidValue(), description, msgs); processMessages(method, msgs); } } Attribute enableAttr = AttributeUtil.find(OperationalAttributes.ENABLE_NAME, replaceAttributes); if (null != enableAttr) { Boolean enable = AttributeUtil.getBooleanValue(enableAttr); if (LOG.isInfo()) { LOG.info("PDUser.setPasswordValid(ctxt,{0},{1},msgs)", uid.getUidValue(), enable); } PDUser.setPasswordValid(ctxt, uid.getUidValue(), enable, msgs); processMessages(method, msgs); } Attribute ssoUserAttr = AttributeUtil.find(ATTR_SSO_USER, replaceAttributes); if (null != ssoUserAttr) { Boolean ssoUser = AttributeUtil.getBooleanValue(ssoUserAttr); if (LOG.isInfo()) { LOG.info("PDUser.setSSOUser(ctxt,{0},{1},msgs)", uid.getUidValue(), ssoUser); } PDUser.setSSOUser(ctxt, uid.getUidValue(), ssoUser, msgs); processMessages(method, msgs); } Attribute groupsAttr = AttributeUtil.find(PredefinedAttributes.GROUPS_NAME, replaceAttributes); if (null != groupsAttr) { updateTAMGroups(groupsAttr.getValue(), uid.getUidValue(), msgs); } Attribute gsoWebCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoWebCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCE, gsoWebCredentialsAttr, msgs); } Attribute gsoGroupCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoGroupCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCEGROUP, gsoGroupCredentialsAttr, msgs); } } catch (PDException e) { convertPDExceptionToConnectorException(e); } catch (Exception e) { throw new ConnectorException(e); } } else if (ObjectClass.GROUP.is(objClass.getObjectClassValue())) { } else { LOG.error("Failed to update: Unsupported objectClass={0}, id={1}", objClass, uid); } LOG.info("Exit {0}", method); return uid; }
TAMConnector implements PoolableConnector, AuthenticateOp, CreateOp, SchemaOp, TestOp,
        DeleteOp, UpdateOp, SearchOp<String> { public Uid update(ObjectClass objClass, Uid uid, Set<Attribute> replaceAttributes, OperationOptions options) { final String method = "update"; LOG.info("Entry {0}", method); if (ObjectClass.ACCOUNT.is(objClass.getObjectClassValue())) { try { PDMessages msgs = new PDMessages(); GuardedString password = AttributeUtil.getPasswordValue(replaceAttributes); if (null != password) { GuardedStringAccessor accessor = new GuardedStringAccessor(); password.access(accessor); if (LOG.isInfo()) { LOG.info("PDUser.setPassword(ctxt,{0},Password,msgs)", uid.getUidValue()); } PDUser.setPassword(ctxt, uid.getUidValue(), accessor.getArray(), msgs); processMessages(method, msgs); if (configuration.isSyncGSOCredentials()) { updateGSOCredentialPasswords(uid.getUidValue(), accessor); } } Attribute firstNameAttr = AttributeUtil.find(ATTR_FIRST_NAME, replaceAttributes); if (null != firstNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the firstName update."); } Attribute lastNameAttr = AttributeUtil.find(ATTR_LAST_NAME, replaceAttributes); if (null != lastNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the lastName update."); } Attribute descriptionAttr = AttributeUtil.find(PredefinedAttributes.DESCRIPTION, replaceAttributes); if (null != descriptionAttr) { String description = AttributeUtil.getStringValue(descriptionAttr); if (StringUtil.isNotBlank(description)) { if (LOG.isInfo()) { LOG.info("PDUser.setDescription(ctxt,{0},{1},msgs)", uid.getUidValue(), description); } PDUser.setDescription(ctxt, uid.getUidValue(), description, msgs); processMessages(method, msgs); } } Attribute enableAttr = AttributeUtil.find(OperationalAttributes.ENABLE_NAME, replaceAttributes); if (null != enableAttr) { Boolean enable = AttributeUtil.getBooleanValue(enableAttr); if (LOG.isInfo()) { LOG.info("PDUser.setPasswordValid(ctxt,{0},{1},msgs)", uid.getUidValue(), enable); } PDUser.setPasswordValid(ctxt, uid.getUidValue(), enable, msgs); processMessages(method, msgs); } Attribute ssoUserAttr = AttributeUtil.find(ATTR_SSO_USER, replaceAttributes); if (null != ssoUserAttr) { Boolean ssoUser = AttributeUtil.getBooleanValue(ssoUserAttr); if (LOG.isInfo()) { LOG.info("PDUser.setSSOUser(ctxt,{0},{1},msgs)", uid.getUidValue(), ssoUser); } PDUser.setSSOUser(ctxt, uid.getUidValue(), ssoUser, msgs); processMessages(method, msgs); } Attribute groupsAttr = AttributeUtil.find(PredefinedAttributes.GROUPS_NAME, replaceAttributes); if (null != groupsAttr) { updateTAMGroups(groupsAttr.getValue(), uid.getUidValue(), msgs); } Attribute gsoWebCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoWebCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCE, gsoWebCredentialsAttr, msgs); } Attribute gsoGroupCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoGroupCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCEGROUP, gsoGroupCredentialsAttr, msgs); } } catch (PDException e) { convertPDExceptionToConnectorException(e); } catch (Exception e) { throw new ConnectorException(e); } } else if (ObjectClass.GROUP.is(objClass.getObjectClassValue())) { } else { LOG.error("Failed to update: Unsupported objectClass={0}, id={1}", objClass, uid); } LOG.info("Exit {0}", method); return uid; } }
TAMConnector implements PoolableConnector, AuthenticateOp, CreateOp, SchemaOp, TestOp,
        DeleteOp, UpdateOp, SearchOp<String> { public Uid update(ObjectClass objClass, Uid uid, Set<Attribute> replaceAttributes, OperationOptions options) { final String method = "update"; LOG.info("Entry {0}", method); if (ObjectClass.ACCOUNT.is(objClass.getObjectClassValue())) { try { PDMessages msgs = new PDMessages(); GuardedString password = AttributeUtil.getPasswordValue(replaceAttributes); if (null != password) { GuardedStringAccessor accessor = new GuardedStringAccessor(); password.access(accessor); if (LOG.isInfo()) { LOG.info("PDUser.setPassword(ctxt,{0},Password,msgs)", uid.getUidValue()); } PDUser.setPassword(ctxt, uid.getUidValue(), accessor.getArray(), msgs); processMessages(method, msgs); if (configuration.isSyncGSOCredentials()) { updateGSOCredentialPasswords(uid.getUidValue(), accessor); } } Attribute firstNameAttr = AttributeUtil.find(ATTR_FIRST_NAME, replaceAttributes); if (null != firstNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the firstName update."); } Attribute lastNameAttr = AttributeUtil.find(ATTR_LAST_NAME, replaceAttributes); if (null != lastNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the lastName update."); } Attribute descriptionAttr = AttributeUtil.find(PredefinedAttributes.DESCRIPTION, replaceAttributes); if (null != descriptionAttr) { String description = AttributeUtil.getStringValue(descriptionAttr); if (StringUtil.isNotBlank(description)) { if (LOG.isInfo()) { LOG.info("PDUser.setDescription(ctxt,{0},{1},msgs)", uid.getUidValue(), description); } PDUser.setDescription(ctxt, uid.getUidValue(), description, msgs); processMessages(method, msgs); } } Attribute enableAttr = AttributeUtil.find(OperationalAttributes.ENABLE_NAME, replaceAttributes); if (null != enableAttr) { Boolean enable = AttributeUtil.getBooleanValue(enableAttr); if (LOG.isInfo()) { LOG.info("PDUser.setPasswordValid(ctxt,{0},{1},msgs)", uid.getUidValue(), enable); } PDUser.setPasswordValid(ctxt, uid.getUidValue(), enable, msgs); processMessages(method, msgs); } Attribute ssoUserAttr = AttributeUtil.find(ATTR_SSO_USER, replaceAttributes); if (null != ssoUserAttr) { Boolean ssoUser = AttributeUtil.getBooleanValue(ssoUserAttr); if (LOG.isInfo()) { LOG.info("PDUser.setSSOUser(ctxt,{0},{1},msgs)", uid.getUidValue(), ssoUser); } PDUser.setSSOUser(ctxt, uid.getUidValue(), ssoUser, msgs); processMessages(method, msgs); } Attribute groupsAttr = AttributeUtil.find(PredefinedAttributes.GROUPS_NAME, replaceAttributes); if (null != groupsAttr) { updateTAMGroups(groupsAttr.getValue(), uid.getUidValue(), msgs); } Attribute gsoWebCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoWebCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCE, gsoWebCredentialsAttr, msgs); } Attribute gsoGroupCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoGroupCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCEGROUP, gsoGroupCredentialsAttr, msgs); } } catch (PDException e) { convertPDExceptionToConnectorException(e); } catch (Exception e) { throw new ConnectorException(e); } } else if (ObjectClass.GROUP.is(objClass.getObjectClassValue())) { } else { LOG.error("Failed to update: Unsupported objectClass={0}, id={1}", objClass, uid); } LOG.info("Exit {0}", method); return uid; }  }
TAMConnector implements PoolableConnector, AuthenticateOp, CreateOp, SchemaOp, TestOp,
        DeleteOp, UpdateOp, SearchOp<String> { public Uid update(ObjectClass objClass, Uid uid, Set<Attribute> replaceAttributes, OperationOptions options) { final String method = "update"; LOG.info("Entry {0}", method); if (ObjectClass.ACCOUNT.is(objClass.getObjectClassValue())) { try { PDMessages msgs = new PDMessages(); GuardedString password = AttributeUtil.getPasswordValue(replaceAttributes); if (null != password) { GuardedStringAccessor accessor = new GuardedStringAccessor(); password.access(accessor); if (LOG.isInfo()) { LOG.info("PDUser.setPassword(ctxt,{0},Password,msgs)", uid.getUidValue()); } PDUser.setPassword(ctxt, uid.getUidValue(), accessor.getArray(), msgs); processMessages(method, msgs); if (configuration.isSyncGSOCredentials()) { updateGSOCredentialPasswords(uid.getUidValue(), accessor); } } Attribute firstNameAttr = AttributeUtil.find(ATTR_FIRST_NAME, replaceAttributes); if (null != firstNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the firstName update."); } Attribute lastNameAttr = AttributeUtil.find(ATTR_LAST_NAME, replaceAttributes); if (null != lastNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the lastName update."); } Attribute descriptionAttr = AttributeUtil.find(PredefinedAttributes.DESCRIPTION, replaceAttributes); if (null != descriptionAttr) { String description = AttributeUtil.getStringValue(descriptionAttr); if (StringUtil.isNotBlank(description)) { if (LOG.isInfo()) { LOG.info("PDUser.setDescription(ctxt,{0},{1},msgs)", uid.getUidValue(), description); } PDUser.setDescription(ctxt, uid.getUidValue(), description, msgs); processMessages(method, msgs); } } Attribute enableAttr = AttributeUtil.find(OperationalAttributes.ENABLE_NAME, replaceAttributes); if (null != enableAttr) { Boolean enable = AttributeUtil.getBooleanValue(enableAttr); if (LOG.isInfo()) { LOG.info("PDUser.setPasswordValid(ctxt,{0},{1},msgs)", uid.getUidValue(), enable); } PDUser.setPasswordValid(ctxt, uid.getUidValue(), enable, msgs); processMessages(method, msgs); } Attribute ssoUserAttr = AttributeUtil.find(ATTR_SSO_USER, replaceAttributes); if (null != ssoUserAttr) { Boolean ssoUser = AttributeUtil.getBooleanValue(ssoUserAttr); if (LOG.isInfo()) { LOG.info("PDUser.setSSOUser(ctxt,{0},{1},msgs)", uid.getUidValue(), ssoUser); } PDUser.setSSOUser(ctxt, uid.getUidValue(), ssoUser, msgs); processMessages(method, msgs); } Attribute groupsAttr = AttributeUtil.find(PredefinedAttributes.GROUPS_NAME, replaceAttributes); if (null != groupsAttr) { updateTAMGroups(groupsAttr.getValue(), uid.getUidValue(), msgs); } Attribute gsoWebCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoWebCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCE, gsoWebCredentialsAttr, msgs); } Attribute gsoGroupCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoGroupCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCEGROUP, gsoGroupCredentialsAttr, msgs); } } catch (PDException e) { convertPDExceptionToConnectorException(e); } catch (Exception e) { throw new ConnectorException(e); } } else if (ObjectClass.GROUP.is(objClass.getObjectClassValue())) { } else { LOG.error("Failed to update: Unsupported objectClass={0}, id={1}", objClass, uid); } LOG.info("Exit {0}", method); return uid; }  Configuration getConfiguration(); void init(Configuration config); void dispose(); void checkAlive(); Uid create(final ObjectClass objClass, final Set<Attribute> attributes,
            final OperationOptions options); FilterTranslator<String> createFilterTranslator(ObjectClass objClass,
            OperationOptions options); void executeQuery(ObjectClass objClass, String query, ResultsHandler handler,
            OperationOptions options); void test(); Uid update(ObjectClass objClass, Uid uid, Set<Attribute> replaceAttributes,
            OperationOptions options); void delete(final ObjectClass objClass, final Uid uid, final OperationOptions options); Schema schema(); Uid authenticate(ObjectClass oc, String user, GuardedString gs, OperationOptions oo); }
TAMConnector implements PoolableConnector, AuthenticateOp, CreateOp, SchemaOp, TestOp,
        DeleteOp, UpdateOp, SearchOp<String> { public Uid update(ObjectClass objClass, Uid uid, Set<Attribute> replaceAttributes, OperationOptions options) { final String method = "update"; LOG.info("Entry {0}", method); if (ObjectClass.ACCOUNT.is(objClass.getObjectClassValue())) { try { PDMessages msgs = new PDMessages(); GuardedString password = AttributeUtil.getPasswordValue(replaceAttributes); if (null != password) { GuardedStringAccessor accessor = new GuardedStringAccessor(); password.access(accessor); if (LOG.isInfo()) { LOG.info("PDUser.setPassword(ctxt,{0},Password,msgs)", uid.getUidValue()); } PDUser.setPassword(ctxt, uid.getUidValue(), accessor.getArray(), msgs); processMessages(method, msgs); if (configuration.isSyncGSOCredentials()) { updateGSOCredentialPasswords(uid.getUidValue(), accessor); } } Attribute firstNameAttr = AttributeUtil.find(ATTR_FIRST_NAME, replaceAttributes); if (null != firstNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the firstName update."); } Attribute lastNameAttr = AttributeUtil.find(ATTR_LAST_NAME, replaceAttributes); if (null != lastNameAttr && LOG.isInfo()) { LOG.info("PDAdmin API does not support the lastName update."); } Attribute descriptionAttr = AttributeUtil.find(PredefinedAttributes.DESCRIPTION, replaceAttributes); if (null != descriptionAttr) { String description = AttributeUtil.getStringValue(descriptionAttr); if (StringUtil.isNotBlank(description)) { if (LOG.isInfo()) { LOG.info("PDUser.setDescription(ctxt,{0},{1},msgs)", uid.getUidValue(), description); } PDUser.setDescription(ctxt, uid.getUidValue(), description, msgs); processMessages(method, msgs); } } Attribute enableAttr = AttributeUtil.find(OperationalAttributes.ENABLE_NAME, replaceAttributes); if (null != enableAttr) { Boolean enable = AttributeUtil.getBooleanValue(enableAttr); if (LOG.isInfo()) { LOG.info("PDUser.setPasswordValid(ctxt,{0},{1},msgs)", uid.getUidValue(), enable); } PDUser.setPasswordValid(ctxt, uid.getUidValue(), enable, msgs); processMessages(method, msgs); } Attribute ssoUserAttr = AttributeUtil.find(ATTR_SSO_USER, replaceAttributes); if (null != ssoUserAttr) { Boolean ssoUser = AttributeUtil.getBooleanValue(ssoUserAttr); if (LOG.isInfo()) { LOG.info("PDUser.setSSOUser(ctxt,{0},{1},msgs)", uid.getUidValue(), ssoUser); } PDUser.setSSOUser(ctxt, uid.getUidValue(), ssoUser, msgs); processMessages(method, msgs); } Attribute groupsAttr = AttributeUtil.find(PredefinedAttributes.GROUPS_NAME, replaceAttributes); if (null != groupsAttr) { updateTAMGroups(groupsAttr.getValue(), uid.getUidValue(), msgs); } Attribute gsoWebCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoWebCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCE, gsoWebCredentialsAttr, msgs); } Attribute gsoGroupCredentialsAttr = AttributeUtil.find(ATTR_GSO_WEB_CREDENTIALS, replaceAttributes); if (null != gsoGroupCredentialsAttr) { updateGSOCredentials(uid.getUidValue(), PDSSOCred.PDSSOCRED_SSORESOURCEGROUP, gsoGroupCredentialsAttr, msgs); } } catch (PDException e) { convertPDExceptionToConnectorException(e); } catch (Exception e) { throw new ConnectorException(e); } } else if (ObjectClass.GROUP.is(objClass.getObjectClassValue())) { } else { LOG.error("Failed to update: Unsupported objectClass={0}, id={1}", objClass, uid); } LOG.info("Exit {0}", method); return uid; }  Configuration getConfiguration(); void init(Configuration config); void dispose(); void checkAlive(); Uid create(final ObjectClass objClass, final Set<Attribute> attributes,
            final OperationOptions options); FilterTranslator<String> createFilterTranslator(ObjectClass objClass,
            OperationOptions options); void executeQuery(ObjectClass objClass, String query, ResultsHandler handler,
            OperationOptions options); void test(); Uid update(ObjectClass objClass, Uid uid, Set<Attribute> replaceAttributes,
            OperationOptions options); void delete(final ObjectClass objClass, final Uid uid, final OperationOptions options); Schema schema(); Uid authenticate(ObjectClass oc, String user, GuardedString gs, OperationOptions oo); static final String ATTR_REGISTRY_NAME; static final String ATTR_FIRST_NAME; static final String ATTR_LAST_NAME; static final String ATTR_SSO_USER; static final String ATTR_PASSWORD_POLICY; static final String ATTR_EXPIRE_PASSWORD; static final String ATTR_DELETE_FROM_REGISTRY; static final String ATTR_SYNC_GSO_CREDENTIALS; static final String ATTR_IMPORT_FROM_REGISTRY; static final String ATTR_GROUP_MEMBERS; static final String ATTR_GSO_WEB_CREDENTIALS; static final String ATTR_GSO_GROUP_CREDENTIALS; static final String TYPE_GSO_GROUP_RESOURCE; static final String TYPE_GSO_RESOURCE; static final String TOKEN_GSO_RESOURCE; }