public static String getHumanReadableName(ShadowType shadowType) { if (shadowType == null) { return "null"; } return getHumanReadableName(shadowType.asPrismObject()); }
public static <T extends ShadowType> PolyString determineShadowName(ShadowType shadow) throws SchemaException { return determineShadowName(shadow.asPrismObject()); }
public static String getSingleStringAttributeValue(ShadowType shadow, QName attrName) { return getSingleStringAttributeValue(shadow.asPrismObject(), attrName); }
public static String getMultiStringAttributeValueAsSingle(ShadowType shadow, QName attrName) { return getMultiStringAttributeValueAsSingle(shadow.asPrismObject(), attrName); }
protected void assertShadowName(ShadowType shadowType, String expectedName) { assertShadowName(shadowType.asPrismObject(), expectedName); }
public static <T> void assertAttribute(ShadowType shadowType, QName name, T... expectedValues) { assertAttribute(shadowType.asPrismObject(), name, expectedValues); }
public static Collection<ResourceAttribute<?>> getPrimaryIdentifiers(ShadowType shadowType) { return getPrimaryIdentifiers(shadowType.asPrismObject()); }
public static ResourceAttribute<String> getNamingAttribute(ShadowType shadow){ return getNamingAttribute(shadow.asPrismObject()); }
protected void assertShadowName(ShadowType shadowType, String expectedName) { assertShadowName(shadowType.asPrismObject(), expectedName); }
public static Collection<ResourceAttribute<?>> getAttributes(ShadowType shadowType) { return getAttributes(shadowType.asPrismObject()); }
public static String getResourceOid(ShadowType shadowType) { return getResourceOid(shadowType.asPrismObject()); }
public static <T> T getAttributeValue(ShadowType shadowType, QName attrName) throws SchemaException { return (T) getAttributeValue(shadowType.asPrismObject(), attrName); }
public static void applyResourceSchema(ShadowType accountType, ResourceType resourceType, PrismContext prismContext) throws SchemaException { ResourceSchema resourceSchema = RefinedResourceSchemaImpl.getResourceSchema(resourceType, prismContext); ShadowUtil.applyResourceSchema(accountType.asPrismObject(), resourceSchema); }
public ShadowType clone() { ShadowType object = new ShadowType(); PrismObject value = asPrismObject().clone(); object.setupContainer(value); return object; }
protected String getIcfUid(ShadowType shadowType) { return getIcfUid(shadowType.asPrismObject()); }
@Override protected String getBody(Event event, GeneralNotifierType generalNotifierType, String transport, Task task, OperationResult result) throws SchemaException { String message = "Your accounts was successfully created. To activate your accounts, please click on the link bellow."; String accountsToActivate = "Shadow to be activated: \n"; for (ShadowType shadow : getShadowsToActivate((ModelEvent) event)) { accountsToActivate = accountsToActivate + shadow.asPrismObject().debugDump() + "\n"; } String body = message + "\n\n" + createConfirmationLink(getUser(event), generalNotifierType, result) + "\n\n" + accountsToActivate; return body; }
protected void assertNoAttribute(PrismObject<ResourceType> resource, ShadowType shadow, ItemName attrQname) { PrismContainer<?> attributesContainer = shadow.asPrismObject().findContainer(ShadowType.F_ATTRIBUTES); if (attributesContainer == null || attributesContainer.isEmpty()) { return; } PrismProperty attribute = attributesContainer.findProperty(attrQname); assertNull("Unexpected attribute "+attrQname+" in "+shadow+": "+attribute, attribute); }
protected void assertNoAttribute(PrismObject<ResourceType> resource, ShadowType shadow, QName attrQname) { PrismContainer<?> attributesContainer = shadow.asPrismObject().findContainer(ShadowType.F_ATTRIBUTES); if (attributesContainer == null || attributesContainer.isEmpty()) { return; } PrismProperty attribute = attributesContainer.findProperty(ItemName.fromQName(attrQname)); assertNull("Unexpected attribute "+attrQname+" in "+shadow+": "+attribute, attribute); }
@Override protected void assertPrismContainerValueLocal(PrismContainerValue<ShadowType> value) throws SchemaException { PrismObject object = value.asContainerable().asPrismObject(); object.checkConsistence(); assertPrism(object, false); assertJaxb(value.asContainerable(), false); }
private String testIterationToken(String token) throws Exception { PrismObjectDefinition accDef = prismContext.getSchemaRegistry() .findObjectDefinitionByCompileTimeClass(ShadowType.class); PrismObject<ShadowType> shadow = accDef.instantiate(); ShadowType shadowType = shadow.asObjectable(); shadowType.setName(new PolyStringType("testIterationToken")); shadowType.setIterationToken(token); OperationResult result = new OperationResult("sync desc test"); final String oid = repositoryService.addObject(shadowType.asPrismObject(), null, result); shadow = repositoryService.getObject(ShadowType.class, oid, null, result); shadowType = shadow.asObjectable(); token = shadowType.getIterationToken(); repositoryService.deleteObject(ShadowType.class, oid, result); return token; }