|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.engine.BaseEngine com.vodafone360.people.engine.identities.IdentityEngine
public class IdentityEngine
Engine responsible for handling retrieval and validation of Identities (e.g. 3rd party/web accounts). The Identities engine can fetch a list of available accounts, and set required capabilities and validate credentials for specified accounts.
Nested Class Summary | |
---|---|
private static class |
IdentityEngine.IdentityStatusRequest
Container class for Identity Capability Status request. |
private static class |
IdentityEngine.IdentityValidateCredentialsRequest
Container class encapsulating an Identity validation request containing: dry-run flag, network, user-name, password, set of required capabilities. |
private static class |
IdentityEngine.State
States for IdentitiesEngine. |
Nested classes/interfaces inherited from class com.vodafone360.people.engine.BaseEngine |
---|
BaseEngine.IEngineEventCallback |
Field Summary | |
---|---|
static java.lang.String |
KEY_DATA
|
private static java.lang.String |
KEY_DATA_CHATABLE_IDENTITIES
|
private static java.lang.String |
LOG_STATUS_MSG
|
private java.util.ArrayList<Identity> |
mIdentityList
List array of Identities retrieved from Server. |
private java.lang.Object |
mMutex
Mutex for thread synchronisation |
private java.util.ArrayList<java.lang.String> |
mMyChatableIdentityList
List array of Identities supporting chat retrieved from Server. |
private IdentityEngine.State |
mState
|
private java.util.ArrayList<StatusMsg> |
mStatusList
|
private static java.lang.String |
TYPE_IDENTITY
Definitions for expected data-types returned from Server. |
private static java.lang.String |
TYPE_STATUS_MSG
|
Fields inherited from class com.vodafone360.people.engine.BaseEngine |
---|
mActiveUiRequest, mCurrentTimeout, mEngineId, mEventCallback |
Constructor Summary | |
---|---|
IdentityEngine(BaseEngine.IEngineEventCallback eventCallback)
Constructor |
Method Summary | |
---|---|
void |
addUiFetchIdentities(Bundle filter)
Add request to fetch available identities. |
void |
addUiGetMyIdentities(Bundle filter)
Add request to fetch the current user's identities. |
void |
addUiSetIdentityStatus(java.lang.String network,
java.lang.String identityId,
boolean identityStatus)
Add request to set the capabilities we wish to support for the specified identity (such as support sync of contacts, receipt of status updates, chat etc.) |
void |
addUiValidateIdentityCredentials(boolean dryRun,
java.lang.String network,
java.lang.String username,
java.lang.String password,
Bundle identityCapabilityStatus)
Add request to validate user credentials for a specified identity. |
private boolean |
checkConnectivity()
Get Connectivity status from NetworkAgent. |
void |
getMyChatableIdentities()
Add request to fetch the current user's 'chat-able' identities. |
long |
getNextRunTime()
Return the next run-time for the IdentitiesEngine. |
private void |
handleServerGetAvailableIdentitiesResponse(java.util.List<BaseDataType> data)
Handle Server response to request for available Identities. |
private void |
handleSetIdentityCapabilityStatus(java.util.List<BaseDataType> data)
Handle Server response to set capability status request. |
private void |
handleValidateIdentityCredentials(java.util.List<BaseDataType> data)
Handle Server response to set validate credentials request. |
private void |
makeChatableIdentitiesCache(java.util.List<Identity> list)
Create cache of 'chat-able' identities. |
private void |
newState(IdentityEngine.State newState)
Change current IdentityEngine state. |
void |
onCreate()
This will be called immediately after creation. |
void |
onDestroy()
This will be called just before the engine is shutdown. |
protected void |
onRequestComplete()
This function must be implemented in the derived engine implementation. |
protected void |
onTimeoutEvent()
The derived engine implementation must call the processTimeout() function (normally from within the run() implementation), otherwise this will not be called. |
private static java.util.Map<java.lang.String,java.lang.Object> |
prepareBoolFilter(Bundle filter)
Generate Map containing boolean capability filters for supplied Bundle. |
private static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
prepareStringFilter(Bundle filter)
Generate Map containing String capability filters for m supplied Bundle. |
protected void |
processCommsResponse(ResponseQueue.Response resp)
Process a response received from Server. |
protected void |
processUiRequest(ServiceUiRequest requestType,
java.lang.Object data)
Issue any outstanding UI request. |
void |
run()
Run function called via EngineManager. |
private void |
startFetchIdentities(java.lang.Object data)
Issue request to retrieve available Identities. |
private void |
startGetMyChatableIdentities()
Issue request to retrieve 'My chat-able' Identities. |
private void |
startGetMyIdentities(java.lang.Object data)
Issue request to retrieve 'My' Identities. |
private void |
startSetIdentityStatus(java.lang.Object data)
Issue request to set capabilities for a given Identity. |
private void |
startValidateIdentityCredentials(java.lang.Object data)
Issue request to validate the user credentials for an Identity. |
Methods inherited from class com.vodafone360.people.engine.BaseEngine |
---|
addUiRequestToQueue, clearTimeout, completeUiRequest, completeUiRequest, deactivateEngine, emptyUiRequestQueue, engineId, genericHandleResponseType, getCurrentTimeout, isCommsResponseOutstanding, isDeactivated, isUiRequestOutstanding, onCommsInMessage, onReset, processCommsInQueue, processTimeout, processUiQueue, setReqId, setTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.Object mMutex
private IdentityEngine.State mState
private final java.util.ArrayList<Identity> mIdentityList
private java.util.ArrayList<java.lang.String> mMyChatableIdentityList
private final java.util.ArrayList<StatusMsg> mStatusList
private static final java.lang.String TYPE_IDENTITY
private static final java.lang.String TYPE_STATUS_MSG
public static final java.lang.String KEY_DATA
private static final java.lang.String KEY_DATA_CHATABLE_IDENTITIES
private static final java.lang.String LOG_STATUS_MSG
Constructor Detail |
---|
public IdentityEngine(BaseEngine.IEngineEventCallback eventCallback)
eventCallback
- IEngineEventCallback allowing engine to report back.Method Detail |
---|
private static java.util.Map<java.lang.String,java.lang.Object> prepareBoolFilter(Bundle filter)
filter
- Bundle containing filter.
private static java.util.Map<java.lang.String,java.util.List<java.lang.String>> prepareStringFilter(Bundle filter)
filter
- Bundle containing filter.
public long getNextRunTime()
getNextRunTime
in class BaseEngine
public void onCreate()
onCreate
in class BaseEngine
public void onDestroy()
onDestroy
in class BaseEngine
protected void onRequestComplete()
onRequestComplete
in class BaseEngine
protected void onTimeoutEvent()
onTimeoutEvent
in class BaseEngine
protected void processCommsResponse(ResponseQueue.Response resp)
processCommsResponse
in class BaseEngine
resp
- The decoded response.protected void processUiRequest(ServiceUiRequest requestType, java.lang.Object data)
processUiRequest
in class BaseEngine
requestType
- Request to be issued.dara
- Data associated with the request.public void run()
run
in class BaseEngine
public void addUiFetchIdentities(Bundle filter)
filter
- Bundle containing parameters for fetch identities request.
This contains the set of filters applied to GetIdentities API
call.public void addUiSetIdentityStatus(java.lang.String network, java.lang.String identityId, boolean identityStatus)
network
- Name of the identity,identityId
- Id of identity.identityStatus
- Bundle containing the capability information for
this identity.public void addUiValidateIdentityCredentials(boolean dryRun, java.lang.String network, java.lang.String username, java.lang.String password, Bundle identityCapabilityStatus)
dryRun
- True if this is a dry-run.network
- Name of the network/identity.username
- User-name for login for this identity.password
- Password for login for this identity.identityCapabilityStatus
- Bundle containing capability details for
this identity.public void addUiGetMyIdentities(Bundle filter)
filter
- Bundle containing parameters for fetch identities request.
This contains the set of filters applied to GetMyIdentities
API call.private void newState(IdentityEngine.State newState)
newState
- new state.private void startGetMyIdentities(java.lang.Object data)
data
- Bundled request data.private void startGetMyChatableIdentities()
private void startSetIdentityStatus(java.lang.Object data)
data
- Bundled request data.private void startValidateIdentityCredentials(java.lang.Object data)
data
- Bundled request data.private void startFetchIdentities(java.lang.Object data)
data
- Bundled request data.private void handleServerGetAvailableIdentitiesResponse(java.util.List<BaseDataType> data)
data
- List of BaseDataTypes generated from Server response.private void handleValidateIdentityCredentials(java.util.List<BaseDataType> data)
data
- List of BaseDataTypes generated from Server response.private void handleSetIdentityCapabilityStatus(java.util.List<BaseDataType> data)
data
- List of BaseDataTypes generated from Server response.private boolean checkConnectivity()
private void makeChatableIdentitiesCache(java.util.List<Identity> list)
list
- List array of retrieved Identities.public void getMyChatableIdentities()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc