com.adobe.cq.social.messaging.api.MessagingSocialEvent Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.adobe.cq.social.messaging.api;
import java.util.Map;
import com.adobe.cq.social.scf.core.SocialEvent;
import com.adobe.granite.activitystreams.Verbs;
public class MessagingSocialEvent extends SocialEvent {
public static final String MESSAGE = "message";
/**
* @param path - the jcr path to message node on which the event was triggered.
* @param userId - the user id of the user who triggered the event.
* @param action - the action that was taken to trigger the event.
* @param additionalData - any additional data that is part of the event payload.
*/
public MessagingSocialEvent(final String path, final String userId, final MessagingActions action,
final Map additionalData) {
super(MESSAGE, path, userId, action, additionalData);
}
/**
* The event types supported for the messaging.
*/
public enum MessagingActions implements SocialEvent.SocialActions {
/**
* The event fired upon a message being sent.
*/
MessageSent;
@Override
public String getVerb() {
switch (this) {
case MessageSent:
return Verbs.POST;
default:
throw new IllegalArgumentException();
}
}
}
}