use of com.vodafone360.people.service.io.rpg.RpgPushMessage in project 360-Engine-for-Android by 360.
the class HessianDecoder method parsePushPayload.
private void parsePushPayload(RpgPushMessage msg, List<BaseDataType> list) {
// convert push msg type string to PushMsgType
PushMessageTypes type = msg.mType;
EngineId engineId = EngineId.UNDEFINED;
if (type != null) {
switch(type) {
case CHAT_MESSAGE:
LogUtils.logV("Parse incomming chat_message");
engineId = EngineId.PRESENCE_ENGINE;
list.add(new PushChatMessageEvent(msg, engineId));
return;
case AVAILABILITY_STATE_CHANGE:
LogUtils.logV("Parse availability state change:");
engineId = EngineId.PRESENCE_ENGINE;
list.add(PushAvailabilityEvent.createPushEvent(msg, engineId));
return;
case START_CONVERSATION:
LogUtils.logV("Parse new conversation event:");
engineId = EngineId.PRESENCE_ENGINE;
list.add(new PushChatConversationEvent(msg, engineId));
return;
case CLOSED_CONVERSATION:
LogUtils.logV("Parse closed conversation event:");
engineId = EngineId.PRESENCE_ENGINE;
list.add(new PushClosedConversationEvent(msg, engineId));
return;
case CONVERSATION_END:
break;
// API events create push message type
case PROFILE_CHANGE:
engineId = EngineId.SYNCME_ENGINE;
break;
case CONTACTS_CHANGE:
engineId = EngineId.CONTACT_SYNC_ENGINE;
break;
case TIMELINE_ACTIVITY_CHANGE:
case STATUS_ACTIVITY_CHANGE:
engineId = EngineId.ACTIVITIES_ENGINE;
break;
case FRIENDSHIP_REQUEST_RECEIVED:
break;
case IDENTITY_CHANGE:
engineId = EngineId.IDENTITIES_ENGINE;
break;
case IDENTITY_NETWORK_CHANGE:
engineId = EngineId.IDENTITIES_ENGINE;
break;
case SYSTEM_NOTIFICATION:
LogUtils.logE("SYSTEM_NOTIFICATION push msg:" + msg.mHash);
list.add(SystemNotification.createFromHashtable(msg.mHash, engineId));
return;
default:
}
list.add(PushEvent.createPushEvent(msg, engineId));
}
}
use of com.vodafone360.people.service.io.rpg.RpgPushMessage in project 360-Engine-for-Android by 360.
the class HessianDecoder method parsePushMessage.
private void parsePushMessage(List<BaseDataType> list, Hashtable<String, Object> hash) {
RpgPushMessage push = RpgPushMessage.createFromHashtable(hash);
parsePushPayload(push, list);
}
use of com.vodafone360.people.service.io.rpg.RpgPushMessage in project 360-Engine-for-Android by 360.
the class NowPlusDatatypesTests method testCreatePushEvent.
public void testCreatePushEvent() {
RpgPushMessage msg = new RpgPushMessage();
msg.mType = PushMessageTypes.CONTACTS_CHANGE;
EngineId engId = EngineId.ACTIVITIES_ENGINE;
PushEvent input = (PushEvent) PushEvent.createPushEvent(msg, engId);
assertEquals(BaseDataType.PUSH_EVENT_DATA_TYPE, input.getType());
assertEquals(msg.mType, input.mMessageType);
assertEquals(engId, input.mEngineId);
}
Aggregations