+ /**
+ * This method returns an accessToken used for the first registration to IoTivity cloud
+ * @return accessToken for sign-up to IoTivity cloud
+ */
+ public String getAccessToken()
+ {
+ if(mRep == null)
+ {
+ return null;
+ }
+
+ try
+ {
+ if (mRep.hasAttribute(ESConstants.OC_RSRVD_ES_ACCESSTOKEN))
+ return mRep.getValue(ESConstants.OC_RSRVD_ES_ACCESSTOKEN);
+ }
+ catch (OcException e)
+ {
+ Log.e(TAG, "getAccessToken is failed.");
+ }
+ return null;
+ }
+
+ /**
+ * This method returns an access token type
+ * @return tokenType of access token
+ */
+ public OAUTH_TOKENTYPE getAccessTokenType()
+ {
+ if(mRep == null)
+ {
+ return null;
+ }
+
+ try
+ {
+ if (mRep.hasAttribute(ESConstants.OC_RSRVD_ES_ACCESSTOKEN_TYPE))
+ return OAUTH_TOKENTYPE.fromInt((int)mRep.getValue(ESConstants.OC_RSRVD_ES_ACCESSTOKEN_TYPE));
+ }
+ catch (OcException e)
+ {
+ Log.e(TAG, "getAccessTokenType is failed.");
+ }
+ return OAUTH_TOKENTYPE.NONE_OAUTH_TOKENTYPE;
+ }
+