Create an identifier
@param raClz The resource adapter class name
@param configProperties The config properties
@param bootstrapContextName The name of the bootstrap context
@return The id
491617
public String createIdentifier(String raClz, Collection<ConfigProperty> configProperties,
         String bootstrapContextName)
   {
      if (defaultBootstrapContext == null)
         throw new IllegalArgumentException("No default BootstrapContext defined");

      StringBuffer sb = new StringBuffer();

      sb.append(raClz);

      if (configProperties != null && configProperties.size() > 0)
      {
         sb.append(";");

         Iterator<ConfigProperty> iterator = configProperties.iterator();
         while (iterator.hasNext())
         {
            ConfigProperty entry = iterator.next();
            sb.append(entry.getConfigPropertyName()).append("=").append(entry.getConfigPropertyValue());

            if (iterator.hasNext())
               sb.append(":");
         }
      }

      sb.append("-");
      if (bootstrapContextName != null && !bootstrapContextName.trim().equals(""))
      {
         sb.append(bootstrapContextName);
      }
      else
      {
         sb.append(defaultBootstrapContext.getName());
      }

      return sb.toString();
   }
579707
protected Optional<ProviderLoginPageConfiguration> buildProviderConfiguration(final IndirectClient client, final WebContext webContext,
                                                                                  final WebApplicationService service) {
        val name = client.getName();
        val matcher = PAC4J_CLIENT_SUFFIX_PATTERN.matcher(client.getClass().getSimpleName());
        val type = matcher.replaceAll(StringUtils.EMPTY).toLowerCase();
        val uriBuilder = UriComponentsBuilder
            .fromUriString(DelegatedClientNavigationController.ENDPOINT_REDIRECT)
            .queryParam(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER, name);

        if (service != null) {
            val sourceParam = service.getSource();
            val serviceParam = service.getOriginalUrl();
            if (StringUtils.isNotBlank(sourceParam) && StringUtils.isNotBlank(serviceParam)) {
                uriBuilder.queryParam(sourceParam, serviceParam);
            }
        }

        val methodParam = webContext.getRequestParameter(CasProtocolConstants.PARAMETER_METHOD);
        if (StringUtils.isNotBlank(methodParam)) {
            uriBuilder.queryParam(CasProtocolConstants.PARAMETER_METHOD, methodParam);
        }
        val localeParam = webContext.getRequestParameter(this.localeParamName);
        if (StringUtils.isNotBlank(localeParam)) {
            uriBuilder.queryParam(this.localeParamName, localeParam);
        }
        val themeParam = webContext.getRequestParameter(this.themeParamName);
        if (StringUtils.isNotBlank(themeParam)) {
            uriBuilder.queryParam(this.themeParamName, themeParam);
        }
        val redirectUrl = uriBuilder.toUriString();
        val autoRedirect = (Boolean) client.getCustomProperties().getOrDefault(ClientCustomPropertyConstants.CLIENT_CUSTOM_PROPERTY_AUTO_REDIRECT, Boolean.FALSE);
        val p = new ProviderLoginPageConfiguration(name, redirectUrl, type, getCssClass(name), autoRedirect);
        return Optional.of(p);
    }
914792
public static DefaultResourceConfig newApplicationConfig(UIContext context)
    {
        final Set<Object> singletons = getSingletons(context);
        final Set<Class<?>> classes = getClasses();

        return new DefaultResourceConfig()
        {
            @Override
            public Set<Class<?>> getClasses()
            {
                return classes;
            }

            @Override
            public Set<Object> getSingletons()
            {
                return singletons;
            }
        };
    }
261373
protected List<ResultConfig> buildResultConfigs(Class<?> clazz, PackageConfig.Builder pcb) {
    List<ResultConfig> configs = CollectUtils.newArrayList();
    // load annotation results
    Result[] results = new Result[0];
    Results rs = clazz.getAnnotation(Results.class);
    if (null == rs) {
      org.beangle.struts2.annotation.Action an = clazz
          .getAnnotation(org.beangle.struts2.annotation.Action.class);
      if (null != an) results = an.results();
    } else {
      results = rs.value();
    }
    Set<String> annotationResults = CollectUtils.newHashSet();
    if (null != results) {
      for (Result result : results) {
        String resultType = result.type();
        if (Strings.isEmpty(resultType)) resultType = "dispatcher";
        ResultTypeConfig rtc = pcb.getResultType(resultType);
        ResultConfig.Builder rcb = new ResultConfig.Builder(result.name(), rtc.getClassName());
        if (null != rtc.getDefaultResultParam()) rcb.addParam(rtc.getDefaultResultParam(), result.location());
        configs.add(rcb.build());
        annotationResults.add(result.name());
      }
    }

    // load ftl convension results
    if (!preloadftl || null == profileService) return configs;
    String extention = profileService.getProfile(clazz.getName()).getViewExtension();
    if (!extention.equals("ftl")) return configs;
    ResultTypeConfig rtc = pcb.getResultType("freemarker");
    for (Method m : clazz.getMethods()) {
      String methodName = m.getName();
      if (!annotationResults.contains(methodName) && shouldGenerateResult(m)) {
        String path = templateFinder.find(clazz, methodName, methodName, extention);
        if (null != path) {
          configs.add(new ResultConfig.Builder(m.getName(), rtc.getClassName())
              .addParam(rtc.getDefaultResultParam(), path).build());
        }
      }
    }
    return configs;
  }
812629
public static synchronized IClient createNamedClient(String name, Class<? extends IClientConfig> configClass) throws ClientException {
    	IClientConfig config = getNamedConfig(name, configClass);
        return registerClientFromProperties(name, config);
    }
868827
public static SimpleFeatureType createGridFeatureType(
            @Nonnull final MapfishMapContext mapContext,
            @Nonnull final Class<? extends Geometry> geomClass) {
        final SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder();
        CoordinateReferenceSystem projection = mapContext.getBounds().getProjection();
        typeBuilder.add(Constants.Style.Grid.ATT_GEOM, geomClass, projection);
        typeBuilder.setName(Constants.Style.Grid.NAME_LINES);

        return typeBuilder.buildFeatureType();
    }
116169
public static LdapIdentityProviderDefinition fromConfig(Map<String, Object> ldapConfig) {
        Assert.notNull(ldapConfig);

        LdapIdentityProviderDefinition definition = new LdapIdentityProviderDefinition();
        if (ldapConfig==null || ldapConfig.isEmpty()) {
            return definition;
        }

        if (ldapConfig.get(LdapIdentityProviderDefinition.LDAP_STORE_CUSTOM_ATTRIBUTES)!=null) {
            definition.setStoreCustomAttributes((boolean) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_STORE_CUSTOM_ATTRIBUTES));
        }

        if (ldapConfig.get(LdapIdentityProviderDefinition.LDAP_EMAIL_DOMAIN)!=null) {
            definition.setEmailDomain((List<String>) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_EMAIL_DOMAIN));
        }

        if (ldapConfig.get(LdapIdentityProviderDefinition.LDAP_EXTERNAL_GROUPS_WHITELIST)!=null) {
            definition.setExternalGroupsWhitelist((List<String>) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_EXTERNAL_GROUPS_WHITELIST));
        }

        if (ldapConfig.get(LdapIdentityProviderDefinition.LDAP_ATTRIBUTE_MAPPINGS)!=null) {
            definition.setAttributeMappings((Map<String, Object>) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_ATTRIBUTE_MAPPINGS));
        }

        if (ldapConfig.get("ldap.addShadowUserOnLogin") != null) {
            definition.setAddShadowUserOnLogin((boolean) ldapConfig.get("ldap.addShadowUserOnLogin"));
        }

        definition.setLdapProfileFile((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_PROFILE_FILE));

        final String profileFile = definition.getLdapProfileFile();
        if (StringUtils.hasText(profileFile)) {
            switch (profileFile) {
                case LdapIdentityProviderDefinition.LDAP_PROFILE_FILE_SIMPLE_BIND: {
                    definition.setUserDNPattern((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_USER_DN_PATTERN));
                    if (ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_USER_DN_PATTERN_DELIMITER) != null) {
                        definition.setUserDNPatternDelimiter((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_USER_DN_PATTERN_DELIMITER));
                    }
                    break;
                }
                case LdapIdentityProviderDefinition.LDAP_PROFILE_FILE_SEARCH_AND_COMPARE:
                case LdapIdentityProviderDefinition.LDAP_PROFILE_FILE_SEARCH_AND_BIND: {
                    definition.setBindUserDn((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_USER_DN));
                    definition.setBindPassword((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_PASSWORD));
                    definition.setUserSearchBase((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_SEARCH_BASE));
                    definition.setUserSearchFilter((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_SEARCH_FILTER));
                    break;
                }
                default:
                    break;
            }
        }

        definition.setBaseUrl((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_URL));
        definition.setSkipSSLVerification((Boolean) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_SSL_SKIPVERIFICATION));
        definition.setTlsConfiguration((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_SSL_TLS));
        definition.setReferral((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_REFERRAL));
        definition.setMailSubstituteOverridesLdap((Boolean)ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_MAIL_SUBSTITUTE_OVERRIDES_LDAP));
        if (StringUtils.hasText((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_MAIL_ATTRIBUTE_NAME))) {
            definition.setMailAttributeName((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_MAIL_ATTRIBUTE_NAME));
        }
        definition.setMailSubstitute((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_MAIL_SUBSTITUTE));
        definition.setPasswordAttributeName((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_PASSWORD_ATTRIBUTE_NAME));
        definition.setPasswordEncoder((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_PASSWORD_ENCODER));
        definition.setLocalPasswordCompare((Boolean)ldapConfig.get(LdapIdentityProviderDefinition.LDAP_BASE_LOCAL_PASSWORD_COMPARE));
        if (StringUtils.hasText((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_FILE))) {
            definition.setLdapGroupFile((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_FILE));
        }
        if (StringUtils.hasText(definition.getLdapGroupFile()) && !LdapIdentityProviderDefinition.LDAP_GROUP_FILE_GROUPS_NULL_XML.equals(definition.getLdapGroupFile())) {
            definition.setGroupSearchBase((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_SEARCH_BASE));
            definition.setGroupSearchFilter((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_GROUP_SEARCH_FILTER));
            definition.setGroupsIgnorePartialResults((Boolean)ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_IGNORE_PARTIAL_RESULT_EXCEPTION));
            if (ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_MAX_SEARCH_DEPTH) != null) {
                definition.setMaxGroupSearchDepth((Integer) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_MAX_SEARCH_DEPTH));
            }
            definition.setGroupSearchSubTree((Boolean) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_SEARCH_SUBTREE));
            definition.setAutoAddGroups((Boolean) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_AUTO_ADD));
            definition.setGroupRoleAttribute((String) ldapConfig.get(LdapIdentityProviderDefinition.LDAP_GROUPS_GROUP_ROLE_ATTRIBUTE));
        }

        //if flat attributes are set in the properties
        final String LDAP_ATTR_MAP_PREFIX = LdapIdentityProviderDefinition.LDAP_ATTRIBUTE_MAPPINGS+".";
        for (Map.Entry<String,Object> entry : ldapConfig.entrySet()) {
            if (!LdapIdentityProviderDefinition.LDAP_PROPERTY_NAMES.contains(entry.getKey()) &&
                entry.getKey().startsWith(LDAP_ATTR_MAP_PREFIX) &&
                entry.getValue() instanceof String) {
                definition.addAttributeMapping(entry.getKey().substring(LDAP_ATTR_MAP_PREFIX.length()), entry.getValue());
            }
        }

        if (ldapConfig.get(LDAP_PREFIX+PROVIDER_DESCRIPTION)!=null && ldapConfig.get(LDAP_PREFIX+PROVIDER_DESCRIPTION) instanceof String) {
            definition.setProviderDescription((String)ldapConfig.get(LDAP_PREFIX+PROVIDER_DESCRIPTION));
        }

        return definition;
    }
851342
public static void executeGrailsBootstraps(GrailsApplication application, WebApplicationContext webContext,
            ServletContext servletContext, GrailsPluginManager grailsPluginManager) {
        configureServletContextAttributes(
                servletContext,
                application,
                grailsPluginManager,
                webContext
        );

        PersistenceContextInterceptor interceptor = null;
        String[] beanNames = webContext.getBeanNamesForType(PersistenceContextInterceptor.class);
        if (beanNames.length > 0) {
            interceptor = (PersistenceContextInterceptor)webContext.getBean(beanNames[0]);
        }

        if (interceptor != null) {
            interceptor.init();
        }
        // init the Grails application
        try {
            GrailsClass[] bootstraps = application.getArtefacts(BootstrapArtefactHandler.TYPE);
            for (GrailsClass bootstrap : bootstraps) {
                final GrailsBootstrapClass bootstrapClass = (GrailsBootstrapClass) bootstrap;
                final Object instance = bootstrapClass.getReferenceInstance();
                webContext.getAutowireCapableBeanFactory().autowireBeanProperties(
                        instance, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, false);
                bootstrapClass.callInit(servletContext);
            }
            if (interceptor != null) {
                interceptor.flush();
            }
        }
        finally {
            if (interceptor != null) {
                interceptor.destroy();
            }
        }
    }
1181141
@SuppressWarnings("unchecked")
    public void raConfigure(ConfigProperties properties) {
        String httpClientFactoryClassName = (String) properties.getProperty(CFG_PROPERTY_HTTP_CLIENT_FACTORY)
                .getValue();
        if (!httpClientFactoryClassName.isEmpty()) {
            try {
                httpClientFactory = ((Class<? extends HttpAsyncClientFactory>) Class
                        .forName(httpClientFactoryClassName)).newInstance();
            } catch (Exception e) {
                tracer.severe("failed to load http client factory class", e);
            }
        } else {
            this.maxTotal = (Integer) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_TOTAL).getValue();
            this.defaultMaxPerRoute = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_MAX_CONNECTIONS_PER_ROUTE)
                    .getValue();
            this.connectTimeout = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_CONNECT_TIMEOUT).getValue();
            this.socketTimeout = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_SOCKET_TIMEOUT).getValue();
        }
    }
473516
protected void updateContextIdentifierTypeFromConfig(ILaunchConfiguration config) {
		final RootContextIdentifierType type = this.accessor.getDefaultContextIdentifier(config);
		assert type != null;
		switch (type) {
		case RANDOM_CONTEXT_ID:
			this.randomContextIdentifierButton.setSelection(true);
			break;
		case BOOT_AGENT_CONTEXT_ID:
			this.bootContextIdentifierButton.setSelection(true);
			break;
		case DEFAULT_CONTEXT_ID:
		default:
			this.defaultContextIdentifierButton.setSelection(true);
			break;
		}
	}
753528
private Map<Metadatas, ArrayList<ConfigProperty>> processConfigProperty(AnnotationRepository annotationRepository,
                                                                             ClassLoader classLoader)
      throws Exception
   {
      Map<Metadatas, ArrayList<ConfigProperty>> valueMap = null;
      Collection<Annotation> values = annotationRepository.getAnnotation(javax.resource.spi.ConfigProperty.class);
      if (values != null)
      {
         valueMap = new HashMap<Annotations.Metadatas, ArrayList<ConfigProperty>>();
         for (Annotation annotation : values)
         {
            javax.resource.spi.ConfigProperty configPropertyAnnotation = (javax.resource.spi.ConfigProperty) annotation
                  .getAnnotation();

            if (trace)
               log.trace("Processing: " + configPropertyAnnotation);

            XsdString configPropertyValue = XsdString.NULL_XSDSTRING;
            if (configPropertyAnnotation.defaultValue() != null && !configPropertyAnnotation.defaultValue().equals(""))
               configPropertyValue = new XsdString(configPropertyAnnotation.defaultValue(), null);

            XsdString configPropertyName = new XsdString(getConfigPropertyName(annotation), null);

            XsdString configPropertyType =
               new XsdString(getConfigPropertyType(annotation, configPropertyAnnotation.type(), classLoader), null);

            Boolean configPropertySupportsDynamicUpdates = configPropertyAnnotation.supportsDynamicUpdates();
            Boolean configPropertyConfidential = configPropertyAnnotation.confidential();
            // Description
            ArrayList<LocalizedXsdString> descriptions = null;
            if (configPropertyAnnotation.description() != null && configPropertyAnnotation.description().length != 0)
            {
               descriptions = new ArrayList<LocalizedXsdString>(configPropertyAnnotation.description().length);
               for (String descriptionAnnoptation : configPropertyAnnotation.description())
               {
                  descriptions.add(new LocalizedXsdString(descriptionAnnoptation, null));
               }
            }

            Boolean configPropertyIgnore = configPropertyAnnotation.ignore();

            String attachedClassName = annotation.getClassName();
            Class attachedClass = Class.forName(attachedClassName, true, classLoader);

            if (hasInterface(attachedClass, "javax.resource.spi.ResourceAdapter"))
            {
               ConfigProperty cfgMeta = new ConfigPropertyImpl(descriptions, configPropertyName,
                                                               configPropertyType,
                                                               configPropertyValue, configPropertyIgnore,
                                                               configPropertySupportsDynamicUpdates,
                                                               configPropertyConfidential, null, false,
                                                               attachedClassName, null, null, null);
               if (valueMap.get(Metadatas.RA) == null)
               {
                  valueMap.put(Metadatas.RA, new ArrayList<ConfigProperty>());
               }
               valueMap.get(Metadatas.RA).add(cfgMeta);
            }
            else
            {
               ConfigProperty cfgMeta = new ConfigPropertyImpl(descriptions, configPropertyName,
                                                               configPropertyType,
                                                               configPropertyValue, configPropertyIgnore,
                                                               configPropertySupportsDynamicUpdates,
                                                               configPropertyConfidential, null, false,
                                                               attachedClassName, null, null, null);
               if (hasInterface(attachedClass, "javax.resource.spi.ManagedConnectionFactory"))
               {
                  if (valueMap.get(Metadatas.MANAGED_CONN_FACTORY) == null)
                  {
                     valueMap.put(Metadatas.MANAGED_CONN_FACTORY, new ArrayList<ConfigProperty>());
                  }
                  valueMap.get(Metadatas.MANAGED_CONN_FACTORY).add(cfgMeta);
               }
               else if (hasInterface(attachedClass, "javax.resource.spi.ActivationSpec"))
               {
                  if (hasNotNull(annotationRepository, annotation))
                  {
                     ((ConfigPropertyImpl)cfgMeta).setMandatory(true);
                  }

                  if (valueMap.get(Metadatas.ACTIVATION_SPEC) == null)
                  {
                     valueMap.put(Metadatas.ACTIVATION_SPEC, new ArrayList<ConfigProperty>());
                  }
                  valueMap.get(Metadatas.ACTIVATION_SPEC).add(cfgMeta);
               }
               else if (hasAnnotation(attachedClass, AdministeredObject.class, annotationRepository))
               {
                  if (valueMap.get(Metadatas.ADMIN_OBJECT) == null)
                  {
                     valueMap.put(Metadatas.ADMIN_OBJECT, new ArrayList<ConfigProperty>());
                  }
                  valueMap.get(Metadatas.ADMIN_OBJECT).add(cfgMeta);
               }
               else
               {
                  if (hasNotNull(annotationRepository, annotation))
                  {
                     ((ConfigPropertyImpl)cfgMeta).setMandatory(true);
                  }

                  if (valueMap.get(Metadatas.PLAIN) == null)
                  {
                     valueMap.put(Metadatas.PLAIN, new ArrayList<ConfigProperty>());
                  }
                  valueMap.get(Metadatas.PLAIN).add(cfgMeta);
               }
            }
         }
         if (valueMap.get(Metadatas.RA) != null)
            valueMap.get(Metadatas.RA).trimToSize();
         if (valueMap.get(Metadatas.MANAGED_CONN_FACTORY) != null)
            valueMap.get(Metadatas.MANAGED_CONN_FACTORY).trimToSize();
         if (valueMap.get(Metadatas.ACTIVATION_SPEC) != null)
            valueMap.get(Metadatas.ACTIVATION_SPEC).trimToSize();
         if (valueMap.get(Metadatas.ADMIN_OBJECT) != null)
            valueMap.get(Metadatas.ADMIN_OBJECT).trimToSize();
         if (valueMap.get(Metadatas.PLAIN) != null)
            valueMap.get(Metadatas.PLAIN).trimToSize();
         return valueMap;
      }

      return valueMap;
   }
996929
protected AuthenticationHandlerExecutionResult createResult(final ClientCredential credentials, final UserProfile profile,
                                                                final BaseClient client) throws GeneralSecurityException {
        if (profile == null) {
            throw new FailedLoginException("Authentication did not produce a user profile for: " + credentials);
        }

        val id = determinePrincipalIdFrom(profile, client);
        if (StringUtils.isBlank(id)) {
            throw new FailedLoginException("No identifier found for this user profile: " + profile);
        }
        credentials.setUserProfile(profile);
        credentials.setTypedIdUsed(isTypedIdUsed);
        val attributes = CoreAuthenticationUtils.convertAttributeValuesToMultiValuedObjects(profile.getAttributes());
        val principal = this.principalFactory.createPrincipal(id, attributes);
        LOGGER.debug("Constructed authenticated principal [{}] based on user profile [{}]", principal, profile);
        return finalizeAuthenticationHandlerResult(credentials, principal, profile, client);
    }
1055177
private Context createContext() throws Exception
   {
      Properties properties = new Properties();
      properties.setProperty("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
      properties.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      return new InitialContext(properties);
   }
769309
public static ContextualLogger getLogger(Class clazz, LoggerContext context) {
    return new ContextualLogger(LoggerFactory.getLogger(clazz), context);
  }
56990
private IJdbcClient createClient(IPolicyContext context, JDBCIdentitySource config) throws Throwable {
        IJdbcComponent jdbcComponent = context.getComponent(IJdbcComponent.class);

        if (config.getType() == JDBCType.datasource || config.getType() == null) {
            DataSource ds = lookupDatasource(config);
            return jdbcComponent.create(ds);
        }
        if (config.getType() == JDBCType.url) {
            JdbcOptionsBean options = new JdbcOptionsBean();
            options.setJdbcUrl(config.getJdbcUrl());
            options.setUsername(config.getUsername());
            options.setPassword(config.getPassword());
            options.setAutoCommit(true);
            return jdbcComponent.createStandalone(options);
        }
        throw new Exception("Unknown JDBC options."); //$NON-NLS-1$
    }
1364767
protected void _generate(SarlClass clazz, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(clazz);
		final PyAppendable appendable = createAppendable(jvmType, context);
		if (generateTypeDeclaration(
				this.qualifiedNameProvider.getFullyQualifiedName(clazz).toString(),
				clazz.getName(), clazz.isAbstract(),
				getSuperTypes(clazz.getExtends(), clazz.getImplements()),
				getTypeBuilder().getDocumentation(clazz),
				true,
				clazz.getMembers(), appendable, context, null)) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(clazz);
			writeFile(name, appendable, context);
		}
	}
80417
public AuthnStatement newAuthnStatement(final String contextClassRef, final ZonedDateTime authnInstant,
                                            final String sessionIndex) {
        LOGGER.trace("Building authentication statement with context class ref [{}] @ [{}] with index [{}]",
            contextClassRef, authnInstant, sessionIndex);
        val stmt = newSamlObject(AuthnStatement.class);
        val ctx = newSamlObject(AuthnContext.class);

        val classRef = newSamlObject(AuthnContextClassRef.class);
        classRef.setAuthnContextClassRef(contextClassRef);

        ctx.setAuthnContextClassRef(classRef);
        stmt.setAuthnContext(ctx);
        stmt.setAuthnInstant(DateTimeUtils.dateTimeOf(authnInstant));
        stmt.setSessionIndex(sessionIndex);
        return stmt;
    }