本文整理汇总了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);
}
}
}
}
示例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);
}
示例3: CloudantLocationStore
import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
public CloudantLocationStore(){
CloudantClient cloudant = createClient();
if(cloudant!=null){
db = cloudant.database(databaseName, true);
}
}
示例4: hrsDb
import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Bean
public Database hrsDb(CloudantClient cloudant) {
return cloudant.database("hrs", true);
}
示例5: database
import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Bean
public Database database(CloudantClient client) {
Database db = client.database(config.getDb(), true);
return db;
}
示例6: CloudantVisitorStore
import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
public CloudantVisitorStore(){
CloudantClient cloudant = createClient();
if(cloudant!=null){
db = cloudant.database(databaseName, true);
}
}
示例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;
}
示例8: account
import com.cloudant.client.api.CloudantClient; //导入方法依赖的package包/类
@Bean
public Database account(CloudantClient cloudant) throws MalformedURLException {
return cloudant.database("account", true);
}
示例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();
}