|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.kii.sdk.photocolle.AuthenticationContext
public class AuthenticationContext
Context of an authentication.
Method Summary | |
---|---|
String |
getAccessToken()
Get access token. |
long |
getRemainingTime(TimeUnit timeUnit)
Remaining time of this AuthenticationContext. |
static boolean |
hasSaved(Context context,
String key)
Check whether AuthenticationContext has
stored or not. |
static AuthenticationContext |
loadFrom(Context context,
String key)
Deprecated. authenticate()
loads AuthenticationContext
automatically if saved. Applications should use authenticate() . If applications need to
load AuthenticationContext by itself, Applications should use
loadFrom(Context, String, String, String) instead of this method.. |
static AuthenticationContext |
loadFrom(Context context,
String key,
String clientId,
String clientSecret)
Load AuthenticationContext object. |
static void |
removeAll(Context context)
Remove all stored AuthenticationContext objects. |
static void |
removeFrom(Context context,
String key)
Remove an AuthenticationContext object. |
void |
saveTo(Context context,
String key)
Save AuthenticationContext object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean hasSaved(Context context, String key) throws AuthenticationContextAccessException
AuthenticationContext
has
stored or not.
This method uses SharedPreferences. If you access this method from main thread, you will see the disk read violation on StrictMode.
context
- context of an application. must not be null.key
- a key to specify an AuthenticationContext
object to check. must not be null or empty.
AuthenticationContext
object
exists or not.
AuthenticationContextAccessException
- fail to access stored
AuthenticationContext
.
ParameterException
- One or more arguments are invalid.@Deprecated public static AuthenticationContext loadFrom(Context context, String key) throws AuthenticationContextAccessException, AuthenticationContextNotFoundException
authenticate()
loads AuthenticationContext
automatically if saved. Applications should use authenticate()
. If applications need to
load AuthenticationContext
by itself, Applications should use
loadFrom(Context, String, String, String)
instead of this method..
AuthenticationContext
object.
This method uses SharedPreferences. If you access this method from main thread, you will see the disk read violation on StrictMode.
context
- context of an application. must not be null.key
- a key to specify an AuthenticationContext
object to load. must not be null or empty.
AuthenticationContext
object.
AuthenticationContextAccessException
- fail to access stored
AuthenticationContext
AuthenticationContextNotFoundException
- target data does not
exist.
ParameterException
- One or more arguments are invalid.public static AuthenticationContext loadFrom(Context context, String key, String clientId, String clientSecret) throws AuthenticationContextAccessException, AuthenticationContextNotFoundException
AuthenticationContext
object.
This method uses SharedPreferences. If you access this method from main thread, you will see the disk read violation on StrictMode.
context
- context of an application. must not be null.key
- a key to specify an AuthenticationContext
object to load. must not be null or emptyclientId
- A client ID issued by docomo Developer support. must
not be null or empty.clientSecret
- A client secret issued by docomo Developer
support. must not be null or empty.
AuthenticationContext
object.
AuthenticationContextAccessException
- fail to access stored
AuthenticationContext
.
AuthenticationContextNotFoundException
- target data does not
exist.
ParameterException
- One or more arguments are invalid.public static void removeFrom(Context context, String key) throws AuthenticationContextAccessException
AuthenticationContext
object.
The AuthenticationContext
object which
is removed by this method can not load by the loadFrom()
.
This method uses SharedPreferences. If you access this method from main thread, you will see the disk read violation or disk write violation on StrictMode.
context
- context of an application. must not be null.key
- a key to specify an AuthenticationContext
object to remove. must not be null or empty.
AuthenticationContextAccessException
- fail to access stored
AuthenticationContext
.
ParameterException
- One or more arguments are invalid.public static void removeAll(Context context) throws AuthenticationContextAccessException
AuthenticationContext
objects.
This method uses SharedPreferences. If you access this method from main thread, you will see the disk read violation or disk write violation on StrictMode.
context
- context of an application. must not be null or empty.
AuthenticationContextAccessException
- fail to access stored
ParameterException
- One or more arguments are invalid.public void saveTo(Context context, String key) throws AuthenticationContextAccessException
AuthenticationContext
object.
This method uses SharedPreferences. If you access this method from main thread, you will see the disk read violation or disk write violation on StrictMode.
After calling this method, PhotoColleSDK automatically saves AuthenticationContext
with the storeKey
provided to this method. The timing to save AuthenticationContext
is when new access toekn
is received by refresh token.
If this method is called several times with different storeKey, the storeKey which is provided at last call is used to automatically save.
context
- context of an application. must not be null.key
- a key to save an AuthenticationContext
object. must not be null or empty.
AuthenticationContextAccessException
- fail to store
AuthenticationContext
.
ParameterException
- One or more arguments are invalid.public long getRemainingTime(TimeUnit timeUnit) throws ParameterException
timeUnit
- time unit of returning value. must not be null.
ParameterException
- an argument is invalid.public String getAccessToken()
Applications should get access token by this method every time applications use access token because access token is expired after a period of time.
PhotoColleSDK get new access token by using PhotoColle
methods
accessing to PhotoColle network if access token is expired.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |