/** * Returns the enumerated value for the case-insensitive name. * @param name the name of the enumerated value * @return the enumerated value */ static public Authentication valueOfUncased(String name) { return Authentication.valueOf(name.toUpperCase()); } }
/** * Fetches connection properties from the Spring environment, which presumably has had command line * options added to it as properties. * * @return */ @Bean public DatabaseClientProvider databaseClientProvider() { DatabaseClientConfig config = new DatabaseClientConfig( env.getProperty(Options.HOST), Integer.parseInt(env.getProperty(Options.PORT)), env.getProperty(Options.USERNAME), env.getProperty(Options.PASSWORD) ); String db = env.getProperty(Options.DATABASE); if (db != null) { config.setDatabase(db); } String auth = env.getProperty(Options.AUTHENTICATION); if (auth != null) { config.setAuthentication(DatabaseClientFactory.Authentication.valueOfUncased(auth)); } logger.info("Connecting to MarkLogic via: " + config); return new BatchDatabaseClientProvider(config); }
stagingAuthMethod = Authentication.valueOf(auth.toUpperCase()); finalAuthMethod = Authentication.valueOf(auth.toUpperCase()); jobAuthMethod = Authentication.valueOf(auth.toUpperCase()); if(jobAuthMethod.equals(Authentication.CERTIFICATE) && stagingAuthMethod.equals(Authentication.CERTIFICATE)) { setCertAuth(true);
} else { throw new MarkLogicInternalException( "Internal error - unknown authentication type: " + authenType.name());
/** * Conditionally instantiated bean that will be used by the MarkLogic JobRepository implementation * for connecting to MarkLogic. Defaults to using the "main" connection properties, in the likely * case that the JobRepository data should be stored in the same database that batch-processed * data is being stored in. * * @return */ @Bean @Conditional(MarkLogicJobRepositoryCondition.class) public DatabaseClientProvider jobRepositoryDatabaseClientProvider() { DatabaseClientConfig config = new DatabaseClientConfig( selectProperty(Options.JOB_REPOSITORY_HOST, Options.HOST), Integer.parseInt(selectProperty(Options.JOB_REPOSITORY_PORT, Options.PORT)), selectProperty(Options.JOB_REPOSITORY_USERNAME, Options.USERNAME), selectProperty(Options.JOB_REPOSITORY_PASSWORD, Options.PASSWORD) ); String db = env.getProperty(Options.JOB_REPOSITORY_DATABASE); if (db != null) { config.setDatabase(db); } String auth = env.getProperty(Options.JOB_REPOSITORY_AUTHENTICATION); if (auth != null) { config.setAuthentication(DatabaseClientFactory.Authentication.valueOfUncased(auth)); } logger.info("Connecting to MarkLogic JobRepository via: " + config); return new BatchDatabaseClientProvider(config); }
/** * Specifies the authentication type for clients created with a * DatabaseClientFactory.Bean object based on a string value. * @param authentication the authentication type * @deprecated (as of 4.0.1) use constructor for any SecurityContext */ @Deprecated public void setAuthenticationValue(String authentication) { this.authentication = Authentication.valueOfUncased(authentication); } /**
/** * Specifies the authentication type for clients created with a * DatabaseClientFactory.Bean object based on a string value. * @param authentication the authentication type */ public void setAuthenticationValue(String authentication) { this.authentication = Authentication.valueOfUncased(authentication); } /**
/** * Returns the enumerated value for the case-insensitive name. * @param name the name of the enumerated value * @return the enumerated value */ static public Authentication valueOfUncased(String name) { return Authentication.valueOf(name.toUpperCase()); } }