All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.flowthings.client.Credentials Maven / Gradle / Ivy

There is a newer version: 0.9.3.2
Show newest version
package com.flowthings.client;

import java.util.List;

/**
 * Holds credentials necessary to authenticate with flowthings.io any of our
 * APIs.
 * 
 * 

* Credentials consist of an "account" and "token". The account is your * flowthings.io username. The token is either: *

* * *

* This class also gives a convenience method for retrieving credentials from IBM Bluemix *

* *
 * {@code
 *  
 *  // Using vanilla credentials
 *  Credentials creds = new Credentials("matt", "SSOjDZ4VMHS2JcwT1sIpE8x91QfG");
 *  
 *  // Or get from Bluemix, or revert to provided if not available
 *  Credentials bluemixCreds = Credentials.fromBluemixOrDefault(creds);
 *  
 *  RestApi api = new RestApi(bluemixCreds);
 * }}
 * 
* * @author matt */ public class Credentials { public String account; public String token; public Credentials(String account, String token) { this.account = account; this.token = token; } public Credentials() { } public boolean masterTokenSupplied(){ return token != null && token.length() == 32; } @Override public String toString() { return "Credentials [account=" + account + ", token=" + token + "]"; } } class VcapServices { public List flowthings; } class Service { public String boop; public String label; public String plan; public Credentials credentials; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy