com.flowthings.client.Credentials Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flowthings-client-core Show documentation
Show all versions of flowthings-client-core Show documentation
A client library for flowthings.io realtime event processing
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:
*
*
* - Your Master Token
* - A generated Token Object
*
*
*
* 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