private String getShadowIdentifier(Collection<? extends ResourceAttribute<?>> identifiers){ try { Object[] shadowIdentifiers = identifiers.toArray(); return ((ResourceAttribute)shadowIdentifiers[0]).getValue().getValue().toString(); } catch (NullPointerException e){ return ""; } }
throw new SchemaException("Could not determine shadow name."); return nameAttribute.getValue(String.class).getValue();
.findAttribute(new QName(ResourceTypeUtil.getResourceNamespace(resourceType), "employeeNumber")).getValue(String.class) .getValue(); String changedSn = resObj.findAttribute(new QName(ResourceTypeUtil.getResourceNamespace(resourceType), "sn"))
private String getEntryUuid(Collection<ResourceAttribute<?>> identifiers) { for (ResourceAttribute<?> identifier : identifiers) { if (identifier.getElementName().equals(new QName(ResourceTypeUtil.getResourceNamespace(resourceType), OpenDJController.RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME))) { return identifier.getValue(String.class).getValue(); } } return null; }
for (ResourceAttribute<?> attr : identifiers) { if (objectClass.isPrimaryIdentifier(attr.getElementName())) { uidValue = ((ResourceAttribute<String>) attr).getValue().getValue(); String frameworkAttributeName = attrDef.getFrameworkAttributeName(); if (Name.NAME.equals(frameworkAttributeName)) { nameValue = ((ResourceAttribute<String>) attr).getValue().getValue(); return new Uid(((ResourceAttribute<String>) attr).getValue().getValue());
@Test public void test100AddDeleteObject() throws Exception { final String TEST_NAME = "test100AddDeleteObject"; TestUtil.displayTestTitle(this, TEST_NAME); OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME); Collection<ResourceAttribute<?>> identifiers = addSampleResourceObject("john", "John", "Smith"); String uid = null; for (ResourceAttribute<?> resourceAttribute : identifiers) { if (SchemaConstants.ICFS_UID.equals(resourceAttribute.getElementName())) { uid = resourceAttribute.getValue(String.class).getValue(); System.out.println("uuuuid:" + uid); assertNotNull(uid); } } ObjectClassComplexTypeDefinition accountDefinition = resourceSchema.findObjectClassDefinition(OpenDJController.OBJECT_CLASS_INETORGPERSON_NAME); cc.deleteObject(accountDefinition, null, null, identifiers, null, result); ResourceObjectIdentification identification = ResourceObjectIdentification.createFromAttributes( accountDefinition, identifiers); PrismObject<ShadowType> resObj = null; try { resObj = cc.fetchObject(identification, null, null, result); Assert.fail(); } catch (ObjectNotFoundException ex) { AssertJUnit.assertNull(resObj); } }
attributesContainer.add(activationSimulateAttribute); } else{ attributesContainer.findItem(activationSimulateAttribute.getElementName()).replace(activationSimulateAttribute.getValue());