Exemplo n.º 1
0
AwaChangeSet * ChangeSet_NewWithClientID(Session * session, SessionType sessionType, TreeNode objectsTree, const char * clientID)
{
    AwaChangeSet * changeSet = NULL;
    if (objectsTree != NULL)
    {
        changeSet = Awa_MemAlloc(sizeof(*changeSet));
        if (changeSet != NULL)
        {
            memset(changeSet, 0, sizeof(*changeSet));

            changeSet->OperationCommon = OperationCommon_New(session, sessionType);

            if (changeSet->OperationCommon != NULL)
            {
                changeSet->ResponseCommon = ResponseCommon_New(changeSet->OperationCommon, objectsTree);
                if (changeSet->ResponseCommon != NULL)
                {
                    changeSet->ClientID = clientID;
                    LogNew("AwaChangeSet New", changeSet);
                }
                else
                {
                    LogErrorWithEnum(AwaError_OutOfMemory);
                    OperationCommon_Free(&changeSet->OperationCommon);
                    Awa_MemSafeFree(changeSet);
                    changeSet = NULL;
                }
            }
            else
            {
                LogErrorWithEnum(AwaError_OutOfMemory);
                Awa_MemSafeFree(changeSet);
                changeSet = NULL;
            }
        }
        else
        {
            LogErrorWithEnum(AwaError_OutOfMemory);
        }
    }
    else
    {
        LogErrorWithEnum(AwaError_OperationInvalid, "Objects tree is NULL");
    }
    return changeSet;
}
Exemplo n.º 2
0
OperationCommon * OperationCommon_NewWithServerSession(const AwaServerSession * session)
{
    return OperationCommon_New(session, SessionType_Server);
}
Exemplo n.º 3
0
OperationCommon * OperationCommon_NewWithClientSession(const AwaClientSession * session)
{
    return OperationCommon_New(session, SessionType_Client);
}