public class GatewayAPI
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<GatewayAPI> |
CREATOR |
Modifier | Constructor and Description |
---|---|
protected |
GatewayAPI(android.os.Parcel in) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
java.lang.String |
getAccessToken()
Get Access Token
|
KiiApp |
getApp()
Get Kii App
|
java.lang.String |
getAppID()
Get AppID
|
java.lang.String |
getAppKey()
Get AppKey
|
android.net.Uri |
getGatewayAddress()
Get GatewayAddress
|
java.lang.String |
getGatewayID()
Get Gateway ID
|
GatewayInformation |
getGatewayInformation()
Get information of the Gateway.
|
java.lang.String |
getTag()
Get a tag.
|
boolean |
isLoggedIn()
Check If user is logged in to the Gateway.
|
java.util.List<EndNode> |
listOnboardedEndNodes()
List connected end nodes which has been onboarded.
|
java.util.List<PendingEndNode> |
listPendingEndNodes()
List connected end nodes which has not been onboarded.
|
static GatewayAPI |
loadFromStoredInstance(android.content.Context context)
Try to load the instance of GatewayAPI using stored serialized instance.
|
static GatewayAPI |
loadFromStoredInstance(android.content.Context context,
java.lang.String tag)
Try to load the instance of GatewayAPI using stored serialized instance.
|
void |
login(java.lang.String username,
java.lang.String password)
Login to the Gateway.
|
protected java.util.Map<java.lang.String,java.lang.String> |
newHeader() |
void |
notifyOnboardingCompletion(EndNode endNode)
Notify Onboarding completion
Call this api when the End Node onboarding is done.
|
Gateway |
onboardGateway()
Let the Gateway Onboard.
|
static void |
removeAllStoredInstances()
Clear all saved instances in the SharedPreferences.
|
static void |
removeStoredInstance(java.lang.String tag)
Remove saved specified instance in the SharedPreferences.
|
void |
replaceEndNode(java.lang.String endNodeThingID,
java.lang.String endNodeVenderThingID)
Replace end-node by new vendorThingID for end node thingID.
|
void |
restore()
Restore the Gateway.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<GatewayAPI> CREATOR
protected java.util.Map<java.lang.String,java.lang.String> newHeader()
public void login(java.lang.String username, java.lang.String password) throws ThingIFException
username
- Username of the Gateway.password
- Password of the Gateway.ThingIFException
- Thrown when gateway returns error response.public Gateway onboardGateway() throws ThingIFException
ThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.
See login(String, String)
public java.lang.String getGatewayID() throws ThingIFException
ThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.
See login(String, String)
public java.util.List<EndNode> listOnboardedEndNodes() throws ThingIFException
ThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.
See login(String, String)
public java.util.List<PendingEndNode> listPendingEndNodes() throws ThingIFException
ThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.
See login(String, String)
public void notifyOnboardingCompletion(EndNode endNode) throws ThingIFException
endNode
- Onboarded EndNodeThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.
See login(String, String)
public void restore() throws ThingIFException
ThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.
See login(String, String)
public void replaceEndNode(java.lang.String endNodeThingID, java.lang.String endNodeVenderThingID) throws ThingIFException
endNodeThingID
- ID of the end-node assigned by Kii Cloud.endNodeVenderThingID
- ID of the end-node assigned by End Node vendor.ThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.
See login(String, String)
public GatewayInformation getGatewayInformation() throws ThingIFException
ThingIFException
- Thrown when gateway returns error response.java.lang.IllegalStateException
- Thrown when user is not logged in.public boolean isLoggedIn()
public java.lang.String getTag()
public KiiApp getApp()
public java.lang.String getAppID()
public java.lang.String getAppKey()
public android.net.Uri getGatewayAddress()
public java.lang.String getAccessToken()
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public static GatewayAPI loadFromStoredInstance(android.content.Context context) throws StoredGatewayAPIInstanceNotFoundException
login(String, String)
is called.
api
.context
- contextStoredGatewayAPIInstanceNotFoundException
- when the instance has not stored yet.public static GatewayAPI loadFromStoredInstance(android.content.Context context, java.lang.String tag) throws StoredGatewayAPIInstanceNotFoundException
loadFromStoredInstance(Context)
document.context
- contexttag
- specified when the ThingIFAPI has been built.StoredGatewayAPIInstanceNotFoundException
- when the instance has not stored yet.public static void removeAllStoredInstances()
public static void removeStoredInstance(java.lang.String tag)
tag
- tag to specify removing stored instance.Copyright 2015 Kii Corporation. All rights reserved. (Last updated on 2016-10-13 08:55 UTC)