use of com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType in project midpoint by Evolveum.
the class SystemConfigurationDto method loadSecurityPolicy.
private ObjectViewDto<SecurityPolicyType> loadSecurityPolicy(SystemConfigurationType config) {
ObjectReferenceType securityPolicy = config.getGlobalSecurityPolicyRef();
if (securityPolicy != null) {
securityPolicyDto = new ObjectViewDto<SecurityPolicyType>(securityPolicy.getOid(), WebComponentUtil.getName(securityPolicy));
} else {
securityPolicyDto = new ObjectViewDto<SecurityPolicyType>();
}
securityPolicyDto.setType(SecurityPolicyType.class);
return securityPolicyDto;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType in project midpoint by Evolveum.
the class SystemConfigurationDto method getNewObject.
public SystemConfigurationType getNewObject() throws DatatypeConfigurationException {
SystemConfigurationType newObject = oldObject.clone();
if (StringUtils.isNotBlank(getPassPolicyDto().getOid())) {
ObjectReferenceType globalPassPolicyRef = ObjectTypeUtil.createObjectRef(getPassPolicyDto().getOid(), ObjectTypes.PASSWORD_POLICY);
newObject.setGlobalPasswordPolicyRef(globalPassPolicyRef);
} else {
newObject.setGlobalPasswordPolicyRef(null);
}
if (StringUtils.isNotBlank(getSecurityPolicyDto().getOid())) {
ObjectReferenceType globalSecurityPolicyRef = ObjectTypeUtil.createObjectRef(getSecurityPolicyDto().getOid(), WebComponentUtil.createPolyFromOrigString(getSecurityPolicyDto().getName()), ObjectTypes.SECURITY_POLICY);
newObject.setGlobalSecurityPolicyRef(globalSecurityPolicyRef);
} else {
newObject.setGlobalSecurityPolicyRef(null);
}
AssignmentPolicyEnforcementType globalAEP = AEPlevel.toAEPValueType(getAepLevel());
if (globalAEP != null) {
ProjectionPolicyType projectionPolicy = new ProjectionPolicyType();
projectionPolicy.setAssignmentPolicyEnforcement(globalAEP);
newObject.setGlobalAccountSynchronizationSettings(projectionPolicy);
}
Duration auditCleanupDuration = DatatypeFactory.newInstance().newDuration(getAuditCleanupValue());
Duration cleanupTaskDuration = DatatypeFactory.newInstance().newDuration(getTaskCleanupValue());
CleanupPolicyType auditCleanup = new CleanupPolicyType();
CleanupPolicyType taskCleanup = new CleanupPolicyType();
auditCleanup.setMaxAge(auditCleanupDuration);
taskCleanup.setMaxAge(cleanupTaskDuration);
CleanupPoliciesType cleanupPolicies = new CleanupPoliciesType();
cleanupPolicies.setAuditRecords(auditCleanup);
cleanupPolicies.setClosedTasks(taskCleanup);
newObject.setCleanupPolicy(cleanupPolicies);
SystemConfigurationTypeUtil.setEnableExperimentalCode(newObject, getEnableExperimentalCode());
newObject.setLogging(loggingConfig.getNewObject());
newObject.setNotificationConfiguration(notificationConfig.getNewObject(newObject));
newObject.setProfilingConfiguration(profilingDto.getNewObject());
ClassLoggerConfigurationType profilingClassLogger = profilingDto.getProfilingClassLogerConfig();
if (newObject.getLogging() != null) {
newObject.getLogging().getClassLogger().add(profilingClassLogger);
} else {
LoggingConfigurationType profLogging = new LoggingConfigurationType();
profLogging.getClassLogger().add(profilingClassLogger);
newObject.setLogging(profLogging);
}
return newObject;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType in project midpoint by Evolveum.
the class TestLoggingConfiguration method test021JulLoggingEnabled.
@Test
public void test021JulLoggingEnabled() throws Exception {
final String TEST_NAME = "test021JulLoggingEnabled";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
LogfileTestTailer tailer = new LogfileTestTailer(LoggingConfigurationManager.AUDIT_LOGGER_NAME);
java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger(JUL_LOGGER_NAME);
Task task = taskManager.createTaskInstance(TestLoggingConfiguration.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// Setup
PrismObject<SystemConfigurationType> systemConfiguration = PrismTestUtil.parseObject(AbstractInitializedModelIntegrationTest.SYSTEM_CONFIGURATION_FILE);
LoggingConfigurationType logging = systemConfiguration.asObjectable().getLogging();
applyTestLoggingConfig(logging);
ClassLoggerConfigurationType classLogerCongif = new ClassLoggerConfigurationType();
classLogerCongif.setPackage(JUL_LOGGER_NAME);
classLogerCongif.setLevel(LoggingLevelType.ALL);
logging.getClassLogger().add(classLogerCongif);
ObjectDelta<SystemConfigurationType> systemConfigDelta = ObjectDelta.createModificationReplaceProperty(SystemConfigurationType.class, AbstractInitializedModelIntegrationTest.SYSTEM_CONFIGURATION_OID, SystemConfigurationType.F_LOGGING, prismContext, logging);
Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(systemConfigDelta);
modelService.executeChanges(deltas, null, task, result);
// WHEN
julLogger.severe(LogfileTestTailer.MARKER + " JULsevere");
julLogger.warning(LogfileTestTailer.MARKER + " JULwarning");
julLogger.info(LogfileTestTailer.MARKER + " JULinfo");
julLogger.fine(LogfileTestTailer.MARKER + " JULfine");
julLogger.finer(LogfileTestTailer.MARKER + " JULfiner");
julLogger.finest(LogfileTestTailer.MARKER + " JULfinest");
tailer.tail();
tailer.assertMarkerLogged(LogfileTestTailer.LEVEL_ERROR, "JULsevere");
tailer.assertMarkerLogged(LogfileTestTailer.LEVEL_WARN, "JULwarning");
tailer.assertMarkerLogged(LogfileTestTailer.LEVEL_INFO, "JULinfo");
tailer.assertMarkerLogged(LogfileTestTailer.LEVEL_DEBUG, "JULfine");
tailer.assertMarkerLogged(LogfileTestTailer.LEVEL_DEBUG, "JULfiner");
tailer.assertMarkerLogged(LogfileTestTailer.LEVEL_TRACE, "JULfinest");
tailer.close();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType in project midpoint by Evolveum.
the class TestLoggingConfiguration method test001CreateSystemConfiguration.
@Test
public void test001CreateSystemConfiguration() throws Exception {
final String TEST_NAME = "test001CreateSystemConfiguration";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
LogfileTestTailer tailer = new LogfileTestTailer(LoggingConfigurationManager.AUDIT_LOGGER_NAME);
PrismObject<SystemConfigurationType> systemConfiguration = PrismTestUtil.parseObject(SYSTEM_CONFIGURATION_FILE);
Task task = taskManager.createTaskInstance(TestLoggingConfiguration.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectDelta<SystemConfigurationType> systemConfigurationAddDelta = ObjectDelta.createAddDelta(systemConfiguration);
Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(systemConfigurationAddDelta);
// WHEN
modelService.executeChanges(deltas, null, task, result);
// THEN
tailer.logAndTail();
assertBasicLogging(tailer);
// TODO: more asserts
tailer.close();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method getConfiguration.
protected SystemConfigurationType getConfiguration() throws FaultMessage {
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();
modelPort.getObject(ModelClientUtil.getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), options, objectHolder, resultHolder);
return (SystemConfigurationType) objectHolder.value;
}
Aggregations