public static String getResourceOid(ShadowType shadowType) { return getResourceOid(shadowType.asPrismObject()); }
public AssociationSearchQueryResult(List<PrismContainerValue<ShadowAssociationType>> resultingList, List<PrismObject<ShadowType>> rawResultsList) { super(resultingList); Validate.isTrue(rawResultsList != null && !rawResultsList.isEmpty()); ShadowType shadow = rawResultsList.get(0).asObjectable(); resourceOid = ShadowUtil.getResourceOid(shadow); kind = shadow.getKind(); }
public static <F extends FocusType> LensProjectionContext getProjectionContext(LensContext<F> context, PrismObject<ShadowType> equivalentAccount, ProvisioningService provisioningService, PrismContext prismContext, Task task, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { ShadowType equivalentAccountType = equivalentAccount.asObjectable(); ShadowKindType kind = ShadowUtil.getKind(equivalentAccountType); return getProjectionContext(context, ShadowUtil.getResourceOid(equivalentAccountType), kind, equivalentAccountType.getIntent(), provisioningService, prismContext, task, result); }
public ProvisioningContext create(PrismObject<ShadowType> shadow, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException { ProvisioningContext ctx = new ProvisioningContext(resourceManager, parentResult); ctx.setTask(task); ctx.setOriginalShadow(shadow); String resourceOid = ShadowUtil.getResourceOid(shadow.asObjectable()); ctx.setResourceOid(resourceOid); return ctx; }
public ProvisioningContext create(PrismObject<ShadowType> shadow, Collection<QName> additionalAuxiliaryObjectClassQNames, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException { ProvisioningContext ctx = new ProvisioningContext(resourceManager, parentResult); ctx.setTask(task); ctx.setOriginalShadow(shadow); ctx.setAdditionalAuxiliaryObjectClassQNames(additionalAuxiliaryObjectClassQNames); String resourceOid = ShadowUtil.getResourceOid(shadow.asObjectable()); ctx.setResourceOid(resourceOid); return ctx; }
private <F extends ObjectType, T extends ObjectType> String addProvisioningObject(PrismObject<T> object, LensContext<F> context, LensElementContext<T> objectContext, ProvisioningOperationOptions options, ResourceType resource, Task task, OperationResult result) throws ObjectNotFoundException, ObjectAlreadyExistsException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException, PolicyViolationException { if (object.canRepresent(ShadowType.class)) { ShadowType shadow = (ShadowType) object.asObjectable(); String resourceOid = ShadowUtil.getResourceOid(shadow); if (resourceOid == null) { throw new IllegalArgumentException("Resource OID is null in shadow"); } } OperationProvisioningScriptsType scripts = null; if (object.canRepresent(ShadowType.class)) { scripts = prepareScripts(object, context, objectContext, ProvisioningOperationTypeType.ADD, resource, task, result); } ModelImplUtils.setRequestee(task, context); String oid = provisioning.addObject(object, scripts, options, task, result); ModelImplUtils.clearRequestee(task); return oid; }
private static ObjectQuery createShadowQuery(ShadowType resourceShadow, ObjectClassComplexTypeDefinition objectClassDef, MatchingRule<String> uidMatchingRule, PrismContext prismContext) throws SchemaException { PrismContainer<?> attributesContainer = resourceShadow.asPrismObject().findContainer(ShadowType.F_ATTRIBUTES); QName identifierName = objectClassDef.getPrimaryIdentifiers().iterator().next().getName(); PrismProperty<String> identifier = attributesContainer.findProperty(ItemName.fromQName(identifierName)); if (identifier == null) { throw new SchemaException("No identifier in "+resourceShadow); } String identifierValue = identifier.getRealValue(); if (uidMatchingRule != null) { identifierValue = uidMatchingRule.normalize(identifierValue); } PrismPropertyDefinition<String> identifierDef = identifier.getDefinition(); return prismContext.queryFor(ShadowType.class) .item(ShadowType.F_RESOURCE_REF).ref(ShadowUtil.getResourceOid(resourceShadow)) .and().item(ItemPath.create(ShadowType.F_ATTRIBUTES, identifierDef.getName()), identifierDef).eq(identifierValue) .build(); }
PrismObject<ResourceType> resource = provisioningService.getObject(ResourceType.class, ShadowUtil.getResourceOid(shadow), null, task, parentResult);
@Override protected String createTicketAdd(PrismObject<? extends ShadowType> object, Collection<Operation> additionalOperations, OperationResult result) throws CommunicationException, GenericFrameworkException, SchemaException, ObjectAlreadyExistsException, ConfigurationException { LOGGER.debug("Creating case to add account\n{}", object.debugDump(1)); ObjectDelta<? extends ShadowType> objectDelta = DeltaFactory.Object.createAddDelta(object); ObjectDeltaType objectDeltaType = DeltaConvertor.toObjectDeltaType(objectDelta); String shadowName; if (object.getName() != null) { shadowName = object.getName().toString(); } else { shadowName = getShadowIdentifier(ShadowUtil.getPrimaryIdentifiers(object)); } String description = "Please create resource account: "+shadowName; PrismObject<CaseType> acase = addCase(description, ShadowUtil.getResourceOid(object.asObjectable()), shadowName, objectDeltaType, result); return acase.getOid(); }
String resourceOid = ShadowUtil.getResourceOid(shadowType); assertNotNull("No resource OID in "+shadowType, resourceOid); String repoResourceOid = ShadowUtil.getResourceOid(repoShadow.asObjectable()); assertNotNull("No resource OID in the repository shadow "+repoShadow); assertEquals("Resource OID mismatch", resourceOid, repoResourceOid);
private <F extends FocusType> LensProjectionContext createProjectionContext(LensContext<F> context, PrismObject<ShadowType> account, Task task, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { ShadowType shadowType = account.asObjectable(); String resourceOid = ShadowUtil.getResourceOid(shadowType); if (resourceOid == null) { throw new SchemaException("The " + account + " has null resource reference OID"); } String intent = ShadowUtil.getIntent(shadowType); ShadowKindType kind = ShadowUtil.getKind(shadowType); ResourceType resource = LensUtil.getResourceReadOnly(context, resourceOid, provisioningService, task, result); String accountIntent = LensUtil.refineProjectionIntent(kind, intent, resource, prismContext); ResourceShadowDiscriminator rsd = new ResourceShadowDiscriminator(resourceOid, kind, accountIntent); LensProjectionContext accountSyncContext = context.findProjectionContext(rsd); if (accountSyncContext != null) { throw new SchemaException("Attempt to add "+account+" to a user that already contains account of type '"+accountIntent+"' on "+resource); } accountSyncContext = context.createProjectionContext(rsd); accountSyncContext.setResource(resource); accountSyncContext.setOid(account.getOid()); return accountSyncContext; }
resourceOid = ShadowUtil.getResourceOid((ShadowType) projectionContext.getObjectCurrent().asObjectable()); resourceOid = ShadowUtil.getResourceOid((ShadowType) projectionContext.getObjectNew().asObjectable());
String resourceOid = ShadowUtil.getResourceOid(shadow.asObjectable()); if (resourceOid == null) { throw new IllegalArgumentException("No resource OID in " + shadow);
String resourceOid = ShadowUtil.getResourceOid(currentShadowType); assertFalse("No resource OID in current shadow "+currentShadowType, StringUtils.isBlank(resourceOid)); try {
String resourceOid = ShadowUtil.getResourceOid(shadow); if (resourceOid != null) { Collection<SelectorOptions<GetOperationOptions>> options = createCollection(GetOperationOptions.createReadOnly());
if (projectionObject != null) { ShadowType shadowType = projectionObject.asObjectable(); resourceOid = ShadowUtil.getResourceOid(shadowType); } else if (projContext.getResourceShadowDiscriminator() != null) { resourceOid = projContext.getResourceShadowDiscriminator().getResourceOid();
String resourceOid = ShadowUtil.getResourceOid(currentShadowType); assertFalse("No resource OID in current shadow "+currentShadowType, StringUtils.isBlank(resourceOid)); try {
CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, PolicyViolationException, ExpressionEvaluationException { ShadowType accountType = projection.asObjectable(); String resourceOid = ShadowUtil.getResourceOid(accountType); if (resourceOid == null) { throw new SchemaException("The " + projection + " has null resource reference OID");
if (objectToDetermineDetailsForAudit.asObjectable() instanceof ShadowType) { ShadowType shadow = (ShadowType) objectToDetermineDetailsForAudit.asObjectable(); odoToAudit.setResourceOid(ShadowUtil.getResourceOid(shadow)); odoToAudit.setResourceName(ShadowUtil.getResourceName(shadow));