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


Java CloudantClient.database方法代码示例

本文整理汇总了Java中com.cloudant.client.api.CloudantClient.database方法的典型用法代码示例。如果您正苦于以下问题:Java CloudantClient.database方法的具体用法?Java CloudantClient.database怎么用?Java CloudantClient.database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.cloudant.client.api.CloudantClient的用法示例。


在下文中一共展示了CloudantClient.database方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Helper

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Autowired
public Helper(final CloudantClient cloudantClient,
              WolframRepository wolframRepository,
              @Value("${cloudant.chatDB}") String chatDBName,
              @Value("${cloudant.feedbackDB}") String feedbackDBName,
              @Value("${cloudant.explorerDB}") String explorerDBName,
              @Value("${tmdb.apiKey}") String tmdbApiKey) {
    try {
        chatDB = cloudantClient.database(chatDBName, true);
        feedbackDB = cloudantClient.database(feedbackDBName, true);
        explorerDB = cloudantClient.database(explorerDBName, true);
    }
    catch(Exception e) {
        logger.info("ERROR HERE");
        e.printStackTrace();
    }
    finally {
        this.tmdbApiKey = tmdbApiKey;
        this.wolframRepository = wolframRepository;

        riveScriptBot = new RiveScriptBot();
        eliza = new ElizaMain();
        eliza.readScript(true, "src/main/resources/eliza/script");

        sparql = new SPARQL(explorerDB);
        languageTool = new JLanguageTool(new AmericanEnglish());
        for (Rule rule : languageTool.getAllActiveRules()) {
            if (rule instanceof SpellingCheckRule) {
                List<String> wordsToIgnore = Arrays.asList("nlp");
                ((SpellingCheckRule) rule).addIgnoreTokens(wordsToIgnore);
            }
        }
    }
}
 
开发者ID:dbpedia,项目名称:chatbot,代码行数:35,代码来源:Application.java

示例2: connect

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
/**
 * Create the connection to the Cloudant database that we'll use for this
 * service.
 */
private void connect() {
	CloudantClient cloudant = new CloudantClient(
			AppPropertiesReader.getStringProperty(Constants.CLOUDANT_ACCOUNT),
			AppPropertiesReader.getStringProperty(Constants.CLOUDANT_USERNAME),
			AppPropertiesReader.getStringProperty(Constants.CLOUDANT_PASSWORD));
	db = cloudant.database(AppPropertiesReader.getStringProperty(Constants.CLOUDANT_DB_NAME), true);
	
}
 
开发者ID:IBM-MIL,项目名称:IBM-Ready-App-for-Telecommunications,代码行数:13,代码来源:CloudantService.java

示例3: CloudantLocationStore

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
public CloudantLocationStore(){
	CloudantClient cloudant = createClient();
	if(cloudant!=null){
	 db = cloudant.database(databaseName, true);
	}
}
 
开发者ID:IBM,项目名称:liberty-outage-reporter,代码行数:7,代码来源:CloudantLocationStore.java

示例4: hrsDb

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Bean
public Database hrsDb(CloudantClient cloudant) {
	return cloudant.database("hrs", true);
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:5,代码来源:CouchDbConfig.java

示例5: database

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Bean
public Database database(CloudantClient client) {
	Database db = client.database(config.getDb(), true);
	return db;
}
 
开发者ID:IBM,项目名称:greeting-cloudant-spring,代码行数:6,代码来源:CloudantConfiguration.java

示例6: CloudantVisitorStore

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
public CloudantVisitorStore(){
	CloudantClient cloudant = createClient();
	if(cloudant!=null){
	 db = cloudant.database(databaseName, true);
	}
}
 
开发者ID:IBM-Cloud,项目名称:get-started-java,代码行数:7,代码来源:CloudantVisitorStore.java

示例7: database

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Bean
@ConditionalOnProperty(name = "cloudant.db")
public Database database(CloudantClient client) {
    Database db = client.database(config.getDb(), true);
    return db;
}
 
开发者ID:cloudant-labs,项目名称:cloudant-spring,代码行数:7,代码来源:CloudantAutoConfiguration.java

示例8: account

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Bean
public Database account(CloudantClient cloudant) throws MalformedURLException {
	return cloudant.database("account", true);
}
 
开发者ID:IBM,项目名称:spring-boot-continuous-delivery,代码行数:5,代码来源:Application.java

示例9: prepare

import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
/**
 * Connect to Cloundant NoSQL DB based on the authentication credentials provided as
 * user inputs in the DMDeviceSample.properties file. 
 * 
 **/
@Override
public void prepare(String propertiesFile) {

	/**
	 * Load device properties file
	 */
	Properties props = new Properties();
	try {
		props.load(DeviceInitiatedHandlerSample.class.getResourceAsStream(propertiesFile));
	} catch (IOException e1) {
		System.err.println("Not able to read the properties file, exiting..");
		System.exit(-1);
	}
	
	/**
	 * Read individual parameter values from device properties file
	 */
		
	String username = trimedValue(props.getProperty("User-Name"));
	String password = trimedValue(props.getProperty("Password"));
	
	currentFirmwareVersion = (props.getProperty("DeviceInfo.fwVersion"));

	StringBuilder sb = new StringBuilder();
	sb.append("https://")
	.append(username)
	.append(":")
	.append(password)
	.append("@")
	.append(username)
	.append(".cloudant.com");
		
	System.out.println(sb);
	
	CloudantClient client = new CloudantClient(sb.toString(), username, password);
		
	System.out.println("Connected to Cloudant");
	System.out.println("Server Version: " + client.serverVersion());

	/**
	 * Pass the name of the Cloudant NoSQL Database to 'firmwareDB'
	 * To create the Cloudant NoSQL Database 'firmware_repository', replace 'false' with 'true'
	 */
	
	firmwareDB = client.database("firmware_repository", false);
	
	// Create update task
	updateTask = new DebianFirmwareUpdate(false);
	
	Thread t = new Thread(this);
	t.start();
}
 
开发者ID:ibm-watson-iot,项目名称:iot-device-samples,代码行数:58,代码来源:DeviceInitiatedHandlerSample.java


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