public SystemConfigurationType defaultObjectPolicyConfiguration(ObjectPolicyConfigurationType value) { getDefaultObjectPolicyConfiguration().add(value); return this; }
public SystemConfigurationType clone() { SystemConfigurationType object = new SystemConfigurationType(); PrismObject value = asPrismObject().clone(); object.setupContainer(value); return object; }
public SystemConfigurationType globalPolicyRule(GlobalPolicyRuleType value) { getGlobalPolicyRule().add(value); return this; }
public static String getDefaultHostname(SystemConfigurationType sysconfig) { if (sysconfig == null) { return null; } else if (sysconfig.getInfrastructure() != null && sysconfig.getInfrastructure().getDefaultHostname() != null) { return sysconfig.getInfrastructure().getDefaultHostname(); } else { return sysconfig.getDefaultHostname(); // deprecated (legacy) } }
public List<ObjectPolicyConfigurationType> createObjectTemplateList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_OBJECT_TEMPLATE); return getObjectTemplate(); }
List<ObjectPolicyConfigurationType> all = new ArrayList<>(); all.addAll(systemConfigurationType.getDefaultObjectPolicyConfiguration()); all.addAll(systemConfigurationType.getObjectTemplate()); // deprecated if (objectClass == UserType.class) { ObjectReferenceType templateRef = systemConfigurationType.getDefaultUserTemplateRef(); if (templateRef != null) { all.add(new ObjectPolicyConfigurationType().objectTemplateRef(templateRef.clone()));
@SuppressWarnings("unchecked") public static void mockGetSystemConfiguration(RepositoryService repository, File file) throws JAXBException, ObjectNotFoundException, SchemaException, IOException { SystemConfigurationType systemConfiguration = (SystemConfigurationType) PrismTestUtil.parseObject(file).asObjectable(); when( repository.getObject(eq(SystemConfigurationType.class), eq(SystemObjectsType.SYSTEM_CONFIGURATION.value()), any(Collection.class), any(OperationResult.class))).thenReturn( systemConfiguration.asPrismObject()); }
public List<ObjectPolicyConfigurationType> createDefaultObjectPolicyConfigurationList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_DEFAULT_OBJECT_POLICY_CONFIGURATION); return getDefaultObjectPolicyConfiguration(); }
public static <T extends NamedConfigurationType> T getTransportConfiguration(String transportName, String baseTransportName, Function<NotificationConfigurationType, List<T>> getter, RepositoryService cacheRepositoryService, OperationResult result) { SystemConfigurationType systemConfiguration = NotificationFunctionsImpl.getSystemConfiguration(cacheRepositoryService, result); if (systemConfiguration == null || systemConfiguration.getNotificationConfiguration() == null) { return null; } String transportConfigName = transportName.length() > baseTransportName.length() ? transportName.substring(baseTransportName.length() + 1) : null; // after e.g. "sms:" or "file:" for (T namedConfiguration: getter.apply(systemConfiguration.getNotificationConfiguration())) { if ((transportConfigName == null && namedConfiguration.getName() == null) || (transportConfigName != null && transportConfigName.equals(namedConfiguration.getName()))) { return namedConfiguration; } } return null; }
@Test public void test000Sanity() throws Exception { final String TEST_NAME = "test000Sanity"; displayTestTitle(TEST_NAME); AccountActivationNotifierType accountActivationNotifier = null; SystemConfigurationType systemConfig = getObject(SystemConfigurationType.class, SystemObjectsType.SYSTEM_CONFIGURATION.value()).asObjectable(); IntegrationTestTools.displayXml("system config", systemConfig.asPrismObject()); for (EventHandlerType handler: systemConfig.getNotificationConfiguration().getHandler()) { display("Handler: ", handler); List<AccountActivationNotifierType> accountActivationNotifiers = handler.getAccountActivationNotifier(); if (!accountActivationNotifiers.isEmpty()) { accountActivationNotifier = accountActivationNotifiers.get(0); } } display("Account activation notifier", accountActivationNotifier); assertNotNull("No accountActivationNotifier", accountActivationNotifier); }
public List<GlobalPolicyRuleType> createGlobalPolicyRuleList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_GLOBAL_POLICY_RULE); return getGlobalPolicyRule(); }
@SuppressWarnings("NullableProblems") public static void setRemoteHostAddressHeaders(SystemConfigurationType config) { List<String> newValue = config != null && config.getInfrastructure() != null ? new ArrayList<>(config.getInfrastructure().getRemoteHostAddressHeader()) : Collections.emptyList(); if (!MiscUtil.unorderedCollectionEquals(remoteHostAddressHeaders, newValue)) { LOGGER.debug("Setting new value for 'remoteHostAddressHeaders': {}", newValue); } remoteHostAddressHeaders = newValue; }
@Test public void testObjectReferenceNullSet() throws Exception { System.out.println("\n\n ===[testObjectReferenceNullSet]===\n"); //GIVEN SystemConfigurationType config = new SystemConfigurationType(); getPrismContext().adopt(config); //WHEN config.setGlobalPasswordPolicyRef(null); //THEN SystemConfigurationType configNew = new SystemConfigurationType(); ObjectReferenceType ref = new ObjectReferenceType(); ref.setOid("1234"); ref.setType(ValuePolicyType.COMPLEX_TYPE); configNew.setGlobalPasswordPolicyRef(ref); configNew.setGlobalPasswordPolicyRef(null); getPrismContext().adopt(configNew); assertTrue(config.equals(configNew)); } }
/** * Create an instance of {@link SystemConfigurationType } * */ public SystemConfigurationType createSystemConfigurationType() { return new SystemConfigurationType(); }
private void assertJaxb(SystemConfigurationType config, boolean isObject) throws SchemaException { assertEquals("Wrong name", PrismTestUtil.createPolyStringType("sysconfig"), config.getName()); List<NotificationMessageAttachmentType> attachments = config .getNotificationConfiguration() .getHandler().get(0) .getSimpleUserNotifier().get(0) .getAttachment(); assertEquals("Wrong # of attachments", 4, attachments.size()); assertAttachmentContent(attachments.get(0), "untyped"); assertAttachmentContent(attachments.get(1), "ABC"); assertAttachmentContent(attachments.get(2), "DEF".getBytes()); assertAttachmentContent(attachments.get(3), new BigInteger("1234567890123456789012345678901234567890")); }
.getGlobalPasswordPolicyRef()); LOGGER.info("system config after modify: {}", repoSystemConfig.debugDump()); AssertJUnit.assertNotNull("global password policy null", repoSystemConfig.asObjectable() .getGlobalPasswordPolicyRef()); AssertJUnit.assertNull("default user template not null", repoSystemConfig.asObjectable() .getDefaultUserTemplateRef());
protected AssignmentPolicyEnforcementType getAssignmentPolicyEnforcementType(SystemConfigurationType systemConfiguration) { ProjectionPolicyType globalAccountSynchronizationSettings = systemConfiguration.getGlobalAccountSynchronizationSettings(); if (globalAccountSynchronizationSettings == null) { return null; } return globalAccountSynchronizationSettings.getAssignmentPolicyEnforcement(); }
private <F extends FocusType> SecurityPolicyType resolveGlobalPasswordPolicy(PrismObject<F> user, SystemConfigurationType systemConfiguration, Task task, OperationResult result) throws CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { ObjectReferenceType globalPasswordPolicyRef = systemConfiguration.getGlobalPasswordPolicyRef(); if (globalPasswordPolicyRef != null) { try { ValuePolicyType globalPasswordPolicyType = objectResolver.resolve(globalPasswordPolicyRef, ValuePolicyType.class, null, "global security policy reference in system configuration", task, result); LOGGER.trace("Using global password policy: {}", globalPasswordPolicyType); SecurityPolicyType policy = postProcessPasswordPolicy(globalPasswordPolicyType); traceSecurityPolicy(policy, user); return policy; } catch (ObjectNotFoundException | SchemaException e) { LOGGER.error(e.getMessage(), e); traceSecurityPolicy(null, user); return null; } } return null; }
public SystemConfigurationType objectTemplate(ObjectPolicyConfigurationType value) { getObjectTemplate().add(value); return this; }
public static <O extends ObjectType> ObjectPolicyConfigurationType determineObjectPolicyConfiguration(Class<O> objectClass, List<String> objectSubtypes, SystemConfigurationType systemConfigurationType) throws ConfigurationException { ObjectPolicyConfigurationType applicablePolicyConfigurationType = null; for (ObjectPolicyConfigurationType aPolicyConfigurationType: systemConfigurationType.getDefaultObjectPolicyConfiguration()) { QName typeQName = aPolicyConfigurationType.getType(); if (typeQName == null) { for (ObjectPolicyConfigurationType aPolicyConfigurationType: systemConfigurationType.getObjectTemplate()) { QName typeQName = aPolicyConfigurationType.getType(); if (typeQName == null) { ObjectReferenceType templateRef = systemConfigurationType.getDefaultUserTemplateRef(); if (templateRef == null) { return null;