Search in sources :

Example 66 with Request

use of com.vodafone360.people.service.io.Request in project 360-Engine-for-Android by 360.

the class GroupPrivacy method getGroups.

/**
 * Implementation of groupprivacy/getgroups API. Parameters are; [auth],
 * Integer pageindex [opt], Integer pagesize [opt]
 *
 * @param engine handle to IdentitiesEngine
 * @param pageindex Page index.
 * @param pagesize PAge size.
 * @return request id generated for this request
 */
public static int getGroups(BaseEngine engine, Integer pageindex, Integer pagesize) {
    if (LoginEngine.getSession() == null) {
        LogUtils.logE("GroupPrivacy.GetGroups() Invalid session, return -1");
        return -1;
    }
    Request request = new Request(FUNCTION_GET_GROUPS, Request.Type.GROUP_LIST, engine.engineId(), false, Settings.API_REQUESTS_TIMEOUT_GROUP_PRIVACY);
    if (pageindex != null) {
        request.addData("pageindex", pageindex);
    }
    if (pagesize != null) {
        request.addData("pagesize", pagesize);
    }
    QueueManager queue = QueueManager.getInstance();
    int requestId = queue.addRequest(request);
    queue.fireQueueStateChanged();
    return requestId;
}
Also used : Request(com.vodafone360.people.service.io.Request) QueueManager(com.vodafone360.people.service.io.QueueManager)

Example 67 with Request

use of com.vodafone360.people.service.io.Request in project 360-Engine-for-Android by 360.

the class GroupPrivacy method deleteContactGroupRelationsExt.

/**
 * Implementation of groupprivacy/deletecontactgrouprelationsext API.
 * Parameters are; [auth], Long groupid, List<Long> contactidlist
 *
 * @param engine handle to IdentitiesEngine
 * @param groupid Group ID.
 * @param contactidlist List of contact IDs to delete group relations.
 * @return request id generated for this request
 */
public static int deleteContactGroupRelationsExt(BaseEngine engine, Long groupid, List<Long> contactidlist) {
    if (LoginEngine.getSession() == null) {
        LogUtils.logE("GroupPrivacy.deleteContactGroupRelationsExt() Invalid session, return -1");
        return -1;
    }
    if (groupid == null) {
        LogUtils.logE("GroupPrivacy.deleteContactGroupRelationsExt() groupid cannot be NULL");
        return -1;
    }
    if (contactidlist == null) {
        LogUtils.logE("GroupPrivacy.deleteContactGroupRelationsExt() contactidlist cannot be NULL");
        return -1;
    }
    if (contactidlist.size() == 0) {
        LogUtils.logE("GroupPrivacy.deleteContactGroupRelationsExt() contactidlist.size cannot be 0");
        return -1;
    }
    Request request = new Request(FUNCTION_DELETE_CONTACT_GROUP_RELATIONS_EXT, Request.Type.DELETE_CONTACT_GROUP_RELATIONS, engine.engineId(), false, Settings.API_REQUESTS_TIMEOUT_GROUP_PRIVACY);
    request.addData("groupid", groupid);
    request.addData("contactidlist", new Vector<Object>(contactidlist));
    QueueManager queue = QueueManager.getInstance();
    int requestId = queue.addRequest(request);
    queue.fireQueueStateChanged();
    return requestId;
}
Also used : Request(com.vodafone360.people.service.io.Request) QueueManager(com.vodafone360.people.service.io.QueueManager)

Example 68 with Request

use of com.vodafone360.people.service.io.Request in project 360-Engine-for-Android by 360.

the class GroupPrivacy method addContactGroupRelations.

/**
 * Implementation of groupprivacy/addcontactgrouprelations API. Parameters
 * are; [auth], List<Long> contactidlist, List<Group> grouplist
 *
 * @param engine handle to ContactSyncEngine
 * @param contactidlist List of contacts ids associated with this request.
 * @param grouplist List of groups associated with this request.
 * @return request id generated for this request
 */
public static int addContactGroupRelations(BaseEngine engine, List<Long> contactidlist, List<GroupItem> grouplist) {
    if (LoginEngine.getSession() == null) {
        LogUtils.logE("GroupPrivacy.addContactGroupRelations() Invalid session, return -1");
        return -1;
    }
    if (contactidlist == null) {
        LogUtils.logE("GroupPrivacy.addContactGroupRelations() contactidlist cannot be NULL");
        return -1;
    }
    if (grouplist == null) {
        LogUtils.logE("GroupPrivacy.addContactGroupRelations() grouplist cannot be NULL");
        return -1;
    }
    Request request = new Request(FUNCTION_ADD_CONTACT_GROUP_RELATIONS, Request.Type.CONTACT_GROUP_RELATIONS, engine.engineId(), false, Settings.API_REQUESTS_TIMEOUT_GROUP_PRIVACY);
    request.addData("contactidlist", new Vector<Object>(contactidlist));
    request.addData("grouplist", ApiUtils.createVectorOfGroup(grouplist));
    QueueManager queue = QueueManager.getInstance();
    int requestId = queue.addRequest(request);
    queue.fireQueueStateChanged();
    return requestId;
}
Also used : Request(com.vodafone360.people.service.io.Request) QueueManager(com.vodafone360.people.service.io.QueueManager)

Example 69 with Request

use of com.vodafone360.people.service.io.Request in project 360-Engine-for-Android by 360.

the class Identities method getAvailableIdentities.

/**
 * Implementation of identities/getavailableidentities API. Parameters are;
 * [auth], Map<String, List<String>> filterlist [opt]
 *
 * @param engine handle to IdentitiesEngine
 * @param filterlist List of filters the get identities request is filtered
 *            against.
 * @return request id generated for this request
 */
public static int getAvailableIdentities(BaseEngine engine, Map<String, List<String>> filterlist) {
    if (LoginEngine.getSession() == null) {
        LogUtils.logE("Identities.getAvailableIdentities() Invalid session, return -1");
        return -1;
    }
    Request request = new Request(FUNCTION_GET_AVAILABLE_IDENTITIES, Request.Type.GET_AVAILABLE_IDENTITIES, engine.engineId(), false, Settings.API_REQUESTS_TIMEOUT_IDENTITIES);
    if (filterlist != null) {
        request.addData("filterlist", ApiUtils.createHashTable(filterlist));
    }
    QueueManager queue = QueueManager.getInstance();
    int requestId = queue.addRequest(request);
    queue.fireQueueStateChanged();
    return requestId;
}
Also used : Request(com.vodafone360.people.service.io.Request) QueueManager(com.vodafone360.people.service.io.QueueManager)

Example 70 with Request

use of com.vodafone360.people.service.io.Request in project 360-Engine-for-Android by 360.

the class Identities method deleteIdentity.

/**
 * Implementation of identities/deleteIdentity API. Parameters are; [auth],
 * String network, String identityid.
 *
 * @param engine
 *            Handle to IdentitiesEngine.
 * @param network
 *            Name of network.
 * @param identityId
 *            The user's identity ID.
 * @return requestId The request ID generated for this request.
 */
public static int deleteIdentity(final BaseEngine engine, final String network, final String identityId) {
    if (LoginEngine.getSession() == null) {
        LogUtils.logE("Identities.deleteIdentity() Invalid session, return -1");
        return -1;
    }
    if (network == null) {
        LogUtils.logE("Identities.deleteIdentity() network cannot be NULL");
        return -1;
    }
    if (identityId == null) {
        LogUtils.logE("Identities.deleteIdentity() identityId cannot be NULL");
        return -1;
    }
    Request request = new Request(FUNCTION_DELETE_IDENITY, Request.Type.DELETE_IDENTITY, engine.engineId(), false, Settings.API_REQUESTS_TIMEOUT_IDENTITIES);
    request.addData("network", network);
    request.addData("identityid", identityId);
    LogUtils.logI("Identity to be removed : " + network + " : " + identityId);
    QueueManager queue = QueueManager.getInstance();
    int requestId = queue.addRequest(request);
    queue.fireQueueStateChanged();
    return requestId;
}
Also used : Request(com.vodafone360.people.service.io.Request) QueueManager(com.vodafone360.people.service.io.QueueManager)

Aggregations

Request (com.vodafone360.people.service.io.Request)43 QueueManager (com.vodafone360.people.service.io.QueueManager)27 ServiceStatus (com.vodafone360.people.service.ServiceStatus)16 ArrayList (java.util.ArrayList)16 BaseDataType (com.vodafone360.people.datatypes.BaseDataType)12 ServiceUiRequest (com.vodafone360.people.service.ServiceUiRequest)12 DecodedResponse (com.vodafone360.people.service.io.ResponseQueue.DecodedResponse)11 Suppress (android.test.suitebuilder.annotation.Suppress)10 DatabaseHelper (com.vodafone360.people.database.DatabaseHelper)9 IEngineEventCallback (com.vodafone360.people.engine.IEngineEventCallback)9 IContactSyncCallback (com.vodafone360.people.engine.contactsync.IContactSyncCallback)9 ProcessorFactory (com.vodafone360.people.engine.contactsync.ProcessorFactory)9 ServerError (com.vodafone360.people.datatypes.ServerError)6 IOException (java.io.IOException)6 Identity (com.vodafone360.people.datatypes.Identity)5 ByteArrayInputStream (java.io.ByteArrayInputStream)5 Bundle (android.os.Bundle)4 AuthSessionHolder (com.vodafone360.people.datatypes.AuthSessionHolder)4 ContactChanges (com.vodafone360.people.datatypes.ContactChanges)4 ResponseQueue (com.vodafone360.people.service.io.ResponseQueue)4