当前位置: 首页>>代码示例>>Java>>正文


Java DatabaseClientConfig类代码示例

本文整理汇总了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;
}
 
开发者ID:marklogic-community,项目名称:ml-app-deployer,代码行数:12,代码来源:AppConfig.java

示例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);
}
 
开发者ID:marklogic-community,项目名称:ml-app-deployer,代码行数:13,代码来源:AppConfig.java

示例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;
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:13,代码来源:AbstractSpringBatchTest.java

示例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);
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:9,代码来源:MarkLogicBatchConfiguration.java

示例6: markLogicJobRepositoryDatabaseClientProvider

import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Bean
@Qualifier("markLogicJobRepositoryDatabaseClientProvider")
public DatabaseClientProvider markLogicJobRepositoryDatabaseClientProvider(
        @Qualifier("markLogicJobRepositoryDatabaseClientConfig")
                DatabaseClientConfig marklogicJobRepositoryClientConfig) {
    return new SimpleDatabaseClientProvider(marklogicJobRepositoryClientConfig);
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:8,代码来源:MarkLogicBatchConfiguration.java

示例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);
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:9,代码来源:MarkLogicConfiguration.java

示例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;
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:9,代码来源:InvokeModuleItemWriterTest.java

示例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"));
}
 
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:10,代码来源:MarkLogicApplicationContext.java

示例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());
}
 
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:13,代码来源:SpringConfigurationTest.java

示例12: setDatabaseClientConfig

import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Autowired
public void setDatabaseClientConfig(DatabaseClientConfig databaseClientConfig) {
    this.databaseClientConfig = databaseClientConfig;
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:5,代码来源:AbstractJobRunnerTest.java

示例13: databaseClientProvider

import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
@Bean
@Qualifier("targetDatabaseClientProvider")
public DatabaseClientProvider databaseClientProvider(DatabaseClientConfig databaseClientConfig) {
    return new SimpleDatabaseClientProvider(databaseClientConfig);
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:6,代码来源:MarkLogicConfiguration.java

示例14: SimpleDatabaseClientProvider

import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
public SimpleDatabaseClientProvider(DatabaseClientConfig config) {
    this.config = config;
}
 
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:4,代码来源:SimpleDatabaseClientProvider.java

示例15: DatabaseClientManager

import com.marklogic.client.ext.DatabaseClientConfig; //导入依赖的package包/类
public DatabaseClientManager(DatabaseClientConfig config) {
	this();
	this.config = config;
}
 
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:5,代码来源:DatabaseClientManager.java


注:本文中的com.marklogic.client.ext.DatabaseClientConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。