本文整理汇总了Java中com.marklogic.client.ext.DatabaseClientConfig类的典型用法代码示例。如果您正苦于以下问题:Java DatabaseClientConfig类的具体用法?Java DatabaseClientConfig怎么用?Java DatabaseClientConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseClientConfig类属于com.marklogic.client.ext包,在下文中一共展示了DatabaseClientConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildCertificateAuthContent
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
protected DatabaseClientFactory.SecurityContext buildCertificateAuthContent(DatabaseClientConfig config) {
String certFile = config.getCertFile();
if (certFile != null) {
try {
if (config.getCertPassword() != null) {
return new DatabaseClientFactory.CertificateAuthContext(certFile, config.getCertPassword());
}
return new DatabaseClientFactory.CertificateAuthContext(certFile);
} catch (Exception ex) {
throw new RuntimeException("Unable to build CertificateAuthContext: " + ex.getMessage(), ex);
}
}
DatabaseClientFactory.SSLHostnameVerifier verifier = config.getSslHostnameVerifier();
if (verifier != null) {
return new DatabaseClientFactory.CertificateAuthContext(config.getSslContext(), verifier);
}
return new DatabaseClientFactory.CertificateAuthContext(config.getSslContext());
}
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:19,代码来源:DefaultConfiguredDatabaseClientFactory.java
示例2: newRestDatabaseClientConfig
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
public DatabaseClientConfig newRestDatabaseClientConfig(int port) {
DatabaseClientConfig config = new DatabaseClientConfig(getHost(), port, getRestAdminUsername(), getRestAdminPassword());
config.setAuthentication(getRestAuthentication());
config.setSecurityContextType(restSecurityContextType);
config.setSslHostnameVerifier(getRestSslHostnameVerifier());
config.setSslContext(getRestSslContext());
config.setCertFile(getRestCertFile());
config.setCertPassword(getRestCertPassword());
config.setExternalName(getRestExternalName());
return config;
}
示例3: newAppServicesDatabaseClient
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
public DatabaseClient newAppServicesDatabaseClient(String databaseName) {
DatabaseClientConfig config = new DatabaseClientConfig(getHost(), getAppServicesPort(), getAppServicesUsername(), getAppServicesPassword());
config.setDatabase(databaseName);
config.setAuthentication(getAppServicesAuthentication());
config.setSecurityContextType(appServicesSecurityContextType);
config.setSslHostnameVerifier(getAppServicesSslHostnameVerifier());
config.setSslContext(getAppServicesSslContext());
config.setCertFile(getAppServicesCertFile());
config.setCertPassword(getAppServicesCertPassword());
config.setExternalName(getAppServicesExternalName());
return configuredDatabaseClientFactory.newDatabaseClient(config);
}
示例4: xccTemplate
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Autowired
public XccTemplate xccTemplate(DatabaseClientConfig batchDatabaseClientConfig,
@Value("${marklogic.database:Documents}") String databaseName) {
this.xccTemplate = new XccTemplate(
String.format("xcc://%s:%[email protected]%s:%s/%s",
batchDatabaseClientConfig.getUsername(),
batchDatabaseClientConfig.getPassword(),
batchDatabaseClientConfig.getHost(),
batchDatabaseClientConfig.getPort(),
databaseName));
return xccTemplate;
}
示例5: markLogicJobRepositoryDatabaseClientConfig
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Bean(name = "markLogicJobRepositoryDatabaseClientConfig")
public DatabaseClientConfig markLogicJobRepositoryDatabaseClientConfig(
@Value("#{'${marklogic.jobrepo.host:localhost}'.split(',')}") List<String> hosts,
@Value("${marklogic.jobrepo.port:8201}") int port,
@Value("${marklogic.jobrepo.username:admin}") String username,
@Value("${marklogic.jobrepo.password:admin}") String password) {
return new DatabaseClientConfig(hosts.get(0), port, username, password);
}
示例6: markLogicJobRepositoryDatabaseClientProvider
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Bean
@Qualifier("markLogicJobRepositoryDatabaseClientProvider")
public DatabaseClientProvider markLogicJobRepositoryDatabaseClientProvider(
@Qualifier("markLogicJobRepositoryDatabaseClientConfig")
DatabaseClientConfig marklogicJobRepositoryClientConfig) {
return new SimpleDatabaseClientProvider(marklogicJobRepositoryClientConfig);
}
示例7: databaseClientConfig
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Bean
public DatabaseClientConfig databaseClientConfig(
@Value("#{'${marklogic.host:localhost}'.split(',')}") List<String> hosts,
@Value("${marklogic.port:8000}") int port,
@Value("${marklogic.username:admin}") String username,
@Value("${marklogic.password:admin}") String password) {
return new DatabaseClientConfig(hosts.get(0), port, username, password);
}
示例8: setClientTestHelper
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Autowired
public void setClientTestHelper(DatabaseClientConfig batchDatabaseClientConfig) {
clientTestHelper = new ClientTestHelper();
DatabaseClientProvider databaseClientProvider = new SimpleDatabaseClientProvider(batchDatabaseClientConfig);
clientTestHelper.setDatabaseClientProvider(databaseClientProvider);
clientTestHelper.setNamespaceProvider(new SpringBatchNamespaceProvider());
return;
}
示例9: determineSecurityContextType
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
/**
* The Authentication shouldn't be set on the DatabaseClientConfig, but if it is, it's used instead of the value
* of securityContextType.
*
* @param config
* @return
*/
protected SecurityContextType determineSecurityContextType(DatabaseClientConfig config) {
DatabaseClientFactory.Authentication auth = config.getAuthentication();
if (auth != null) {
if (DatabaseClientFactory.Authentication.BASIC.equals(auth)) {
return SecurityContextType.BASIC;
} else if (DatabaseClientFactory.Authentication.CERTIFICATE.equals(auth)) {
return SecurityContextType.CERTIFICATE;
} else if (DatabaseClientFactory.Authentication.KERBEROS.equals(auth)) {
return SecurityContextType.KERBEROS;
}
return SecurityContextType.DIGEST;
}
return config.getSecurityContextType();
}
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:22,代码来源:DefaultConfiguredDatabaseClientFactory.java
示例10: xccTemplate
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Bean
public XccTemplate xccTemplate(DatabaseClientConfig databaseClientConfig) {
return new XccTemplate(
String.format("xcc://%s:%[email protected]%s:8000/%s",
databaseClientConfig.getUsername(),
databaseClientConfig.getPassword(),
databaseClientConfig.getHost(),
mlAppName + "-content"));
}
示例11: getDatabaseClient
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Test
public void getDatabaseClient() {
for (String beanName : ctx.getBeanDefinitionNames()) {
System.out.println(beanName);
}
Assert.assertTrue(ctx.containsBeanDefinition("com.marklogic.client.ext.spring.SpringDatabaseClientConfig"));
Assert.assertTrue(ctx.containsBeanDefinition("databaseClientProvider"));
Assert.assertTrue(ctx.containsBeanDefinition("xccTemplate"));
DatabaseClientConfig config = (DatabaseClientConfig) ctx.getBean("com.marklogic.client.ext.spring.SpringDatabaseClientConfig");
Assert.assertEquals("localhost", config.getHost());
Assert.assertEquals(8000, config.getPort());
}
示例12: setDatabaseClientConfig
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Autowired
public void setDatabaseClientConfig(DatabaseClientConfig databaseClientConfig) {
this.databaseClientConfig = databaseClientConfig;
}
示例13: databaseClientProvider
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Bean
@Qualifier("targetDatabaseClientProvider")
public DatabaseClientProvider databaseClientProvider(DatabaseClientConfig databaseClientConfig) {
return new SimpleDatabaseClientProvider(databaseClientConfig);
}
示例14: SimpleDatabaseClientProvider
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
public SimpleDatabaseClientProvider(DatabaseClientConfig config) {
this.config = config;
}
示例15: DatabaseClientManager
import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
public DatabaseClientManager(DatabaseClientConfig config) {
this();
this.config = config;
}