public class Configuration
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
allowInvalidSSLCertificate(boolean allowInvalidSSLCertificate)
Tell the system to trust the SSL certificate of the server (even though the Authority is not valid).
|
java.lang.String |
currentEmailAccount()
Return user email of credentials previously provided with
setApiKey(String, String) , setUserPass(String, String)
or declared in the Android Manifest |
long |
getCacheMaxAge()
Get the maximum age of a cached response.
|
java.lang.String |
getDashboardURL()
Obtains the currently Dashboard url used
|
boolean |
isAllowInvalidSSLCertificate()
Returns true if all SSL certificates are trusted
|
boolean |
setApiKey(java.lang.String email,
java.lang.String apiKey)
Provides your API key to the Situm SDK for Android.
|
boolean |
setCacheMaxAge(long maxAge,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum age of a cached response.
|
void |
setDashboardURL(java.lang.String url)
Set the Dashboard URL used by the SDK
|
boolean |
setUserPass(java.lang.String email,
java.lang.String password)
Provides user's email and password.
|
public boolean setApiKey(java.lang.String email, java.lang.String apiKey)
email
- email that identifies the account. Can't be empty.apiKey
- key obtained at situm.es. Can't be emptyjava.lang.IllegalArgumentException
- if email or apiKey are null or emptypublic java.lang.String currentEmailAccount()
setApiKey(String, String)
, setUserPass(String, String)
or declared in the Android Manifestpublic boolean setUserPass(java.lang.String email, java.lang.String password)
email
- user's email. Can't be empty.password
- user's password. Can't be empty.java.lang.IllegalArgumentException
- if email or password are null or emptypublic boolean allowInvalidSSLCertificate(boolean allowInvalidSSLCertificate)
allowInvalidSSLCertificate
- if true, communications with the server may not be securepublic boolean isAllowInvalidSSLCertificate()
public java.lang.String getDashboardURL()
public void setDashboardURL(java.lang.String url)
url
- the new Dashboard url. It will do nothing if is null.public long getCacheMaxAge()
public boolean setCacheMaxAge(long maxAge, java.util.concurrent.TimeUnit timeUnit)
maxAge
- a non-negative integerjava.lang.IllegalArgumentException
- if timeUnit is null or maxAge is less than zero