public static RefinedResourceSchema getRefinedSchema(ResourceType resourceType) throws SchemaException, ConfigurationException { RefinedResourceSchema refinedSchema = RefinedResourceSchemaImpl.getRefinedSchema(resourceType); if (refinedSchema == null) { throw new ConfigurationException("No schema for "+resourceType); } return refinedSchema; }
private LifecycleStateModelType getLifecycleModel(PrismObject<UserType> user, PrismObject<SystemConfigurationType> systemConfiguration) { if (systemConfiguration == null) { return null; } try { return ModelUtils.determineLifecycleModel(user, systemConfiguration.asObjectable()); } catch (ConfigurationException e) { throw new SystemException(e.getMessage(), e); } }
+ " resolution in " + contextDescription + ": " + e.getMessage(), e); } catch (ConfigurationException e) { throw new ConfigurationException("Configuration error during variable " + varDesc + " resolution in " + contextDescription + ": " + e.getMessage(), e); } catch (SecurityViolationException e) { throw new SecurityViolationException("Security violation during variable " + varDesc
"("+dumpSourceValues(sourceVariables)+") in "+contextDescription,e)); } catch (ConfigurationException e) { throw new TunnelException(new ConfigurationException(e.getMessage()+ "("+dumpSourceValues(sourceVariables)+") in "+contextDescription,e)); } catch (SecurityViolationException e) {
public static RefinedResourceSchema getRefinedSchema(PrismObject<ResourceType> resource) throws SchemaException, ConfigurationException { RefinedResourceSchema refinedSchema = RefinedResourceSchemaImpl.getRefinedSchema(resource); if (refinedSchema == null) { throw new ConfigurationException("No schema for "+resource); } return refinedSchema; }
} catch (ConfigurationException ex) { result.recordFatalError( "Configuration error in connector " + connector + ": " + ex.getMessage(), ex); throw new ConfigurationException("Configuration error in connector " + connector + ": " + ex.getMessage(), ex); } catch (ExpressionEvaluationException ex) { result.recordFatalError(
private ObjectPolicyConfigurationType determineObjectPolicyConfiguration(PrismObject<UserType> user, PrismObject<SystemConfigurationType> systemConfiguration) throws SchemaException { ObjectPolicyConfigurationType policyConfigurationType; try { policyConfigurationType = ModelUtils.determineObjectPolicyConfiguration(user, systemConfiguration.asObjectable()); } catch (ConfigurationException e) { throw new SchemaException(e.getMessage(), e); } if (LOGGER.isTraceEnabled()) { LOGGER.trace("Selected policy configuration from subtypes {}:\n{}", FocusTypeUtil.determineSubTypes(user), policyConfigurationType==null?null:policyConfigurationType.asPrismContainerValue().debugDump(1)); } return policyConfigurationType; }
@Override protected void throwException(Exception cause, ProvisioningOperationState<? extends AsynchronousOperationResult> opState, OperationResult result) throws ConfigurationException { recordCompletionError(cause, opState, result); if (cause instanceof ConfigurationException) { throw (ConfigurationException)cause; } else { throw new ConfigurationException(cause.getMessage(), cause); } }
throw new CommunicationException("Evaluation of "+shortDesc+" failed: "+e.getMessage(), e); } catch (ConfigurationException e) { LOGGER.error("Evaluation of {} failed: {}", shortDesc, e.getMessage(), e); throw new ConfigurationException("Evaluation of "+shortDesc+" failed: "+e.getMessage(), e); } catch (SecurityViolationException e) { LOGGER.error("Evaluation of {} failed: {}", shortDesc, e.getMessage(), e);
return null; } catch (ConfigurationException ex) { LOGGER.error("Import: Error getting {} {}: {}", typeName, objectOid, ex.getMessage(), ex); opResult.recordFatalError("Error getting "+typeName+" " + objectOid+": "+ex.getMessage(), ex); runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); return null;
public PrismObject<ShadowType> lookupShadowBySecondaryIdentifiers( ProvisioningContext ctx, Collection<ResourceAttribute<?>> secondaryIdentifiers, OperationResult parentResult) throws SchemaException, ConfigurationException, ObjectNotFoundException, CommunicationException, ExpressionEvaluationException { List<PrismObject<ShadowType>> shadows = lookupShadowsBySecondaryIdentifiers(ctx, secondaryIdentifiers, parentResult); if (shadows == null || shadows.isEmpty()) { return null; } if (shadows.size() > 1) { LOGGER.error("Too many shadows ({}) for secondary identifiers {}: {}", shadows.size(), secondaryIdentifiers, shadows); throw new ConfigurationException("Too many shadows ("+shadows.size()+") for secondary identifiers "+secondaryIdentifiers); } return shadows.get(0); }
throw new SchemaException(e.getMessage(), e); } catch (ConfigurationException e) { ProvisioningUtil.recordFatalError(LOGGER, result, "Couldn't delete object: configuration problem: " + e.getMessage(), e); throw e; } catch (SecurityViolationException e) {
private MergeConfigurationType selectConfiguration( PrismObject<SystemConfigurationType> systemConfiguration, String mergeConfigurationName) throws ConfigurationException { if (StringUtils.isBlank(mergeConfigurationName)) { throw new IllegalArgumentException("Merge configuration name not specified"); } for (MergeConfigurationType mergeConfiguration: systemConfiguration.asObjectable().getMergeConfiguration()) { if (mergeConfigurationName.equals(mergeConfiguration.getName())) { return mergeConfiguration; } } throw new ConfigurationException("Merge configuration with name '"+mergeConfigurationName+"' was not found"); }
result.muteLastSubresultError(); ProvisioningUtil.logWarning(LOGGER, result, "Configuration problem: " + ex.getMessage(), ex);
private <O extends ObjectType, I extends Item> Collection<PrismValue> getValuesToTake(PrismObject<O> objectLeft, PrismObject<O> objectRight, String side, I origItem, MergeStrategyType strategy, Expression<PrismValue, ItemDefinition> valueExpression, Task task, OperationResult result) throws ConfigurationException, SchemaException, ExpressionEvaluationException, ObjectNotFoundException, CommunicationException, SecurityViolationException { if (origItem == null) { return new ArrayList<>(0); } if (strategy == MergeStrategyType.TAKE) { return cleanContainerIds(origItem.getClonedValues()); } else if (strategy == MergeStrategyType.EXPRESSION) { if (valueExpression == null) { throw new ConfigurationException("Expression strategy specified but no expression present"); } List<PrismValue> origValues = origItem.getValues(); Collection<PrismValue> valuesToTake = new ArrayList<>(origValues.size()); for (PrismValue origValue: origValues) { Collection<PrismValue> expressionOutput = evaluateValueExpression(objectLeft, objectRight, side, origValue, valueExpression, task, result); if (expressionOutput != null) { valuesToTake.addAll(expressionOutput); } } return cleanContainerIds(valuesToTake); } else { throw new ConfigurationException("Unknown strategy "+strategy); } }
return false; } catch (ConfigurationException e) { objResult.recordFatalError("Configuration error: " + e.getMessage(), e); LOGGER.error("Configuration error: {}", e.getMessage(), e); return false; } catch (ObjectNotFoundException | ObjectAlreadyExistsException | CommunicationException
private void applyConfigurationToConfigurationClass(PrismContainerValue<?> configurationContainer) throws ConfigurationException { BeanWrapper connectorBean = new BeanWrapperImpl(this); PropertyDescriptor connectorConfigurationProp = UcfUtil.findAnnotatedProperty(connectorBean, ManagedConnectorConfiguration.class); if (connectorConfigurationProp == null) { return; } Class<?> configurationClass = connectorConfigurationProp.getPropertyType(); Object configurationObject; try { configurationObject = configurationClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new ConfigurationException("Cannot instantiate configuration "+configurationClass); } BeanWrapper configurationClassBean = new BeanWrapperImpl(configurationObject); for (Item<?, ?> configurationItem: configurationContainer.getItems()) { if (! (configurationItem instanceof PrismProperty<?>)) { throw new ConfigurationException("Only properties are supported for now"); } PrismProperty<?> configurationProperty = (PrismProperty<?>)configurationItem; Object realValue = configurationProperty.getRealValue(); configurationClassBean.setPropertyValue(configurationProperty.getElementName().getLocalPart(), realValue); } connectorBean.setPropertyValue(connectorConfigurationProp.getName(), configurationObject); } }
} catch (ConfigurationException e) { modifyResourceAvailabilityStatus(resource, AvailabilityStatusType.BROKEN, parentResult); schemaResult.recordFatalError("Configuration error: " + e.getMessage(), e); return; } catch (ObjectNotFoundException e) { } catch (ConfigurationException e) { modifyResourceAvailabilityStatus(resource, AvailabilityStatusType.BROKEN, parentResult); schemaResult.recordFatalError("Configuration error: " + e.getMessage(), e); return; } catch (ExpressionEvaluationException e) {
ObjectTypes objectType = ObjectTypes.getObjectTypeFromTypeQName(typeQName); if (objectType == null) { throw new ConfigurationException( "Unknown type " + typeQName + " in default object policy definition or object template definition in system configuration");
opResult.recordFatalError("Configuration error: "+ex.getMessage(),ex); runResult.setRunResultStatus(TaskRunResultStatus.TEMPORARY_ERROR); return runResult;