social-service-model/src/main/java/org/gcube/social_networking/socialnetworking/model/beans/workspace/AddedItemEvent.java

63 lines
1.3 KiB
Java
Raw Normal View History

2022-05-04 11:26:41 +02:00
package org.gcube.social_networking.socialnetworking.model.beans.workspace;
import javax.validation.constraints.NotNull;
2022-04-29 14:52:03 +02:00
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
2022-04-29 14:52:03 +02:00
import com.fasterxml.jackson.annotation.JsonTypeName;
2022-04-29 14:52:03 +02:00
@JsonIgnoreProperties(ignoreUnknown=true)
2022-05-02 18:46:40 +02:00
@JsonTypeName("ITEM_NEW")
2022-05-04 11:26:41 +02:00
public class AddedItemEvent extends WorkspaceEvent {
2022-05-04 16:35:59 +02:00
private static final WorkspaceEventType TYPE = WorkspaceEventType.ITEM_NEW;
@JsonProperty("fileItem")
@NotNull(message="fileItem cannot be missing")
2022-05-04 11:26:41 +02:00
private FileItemBean item;
2022-05-04 16:35:59 +02:00
2022-05-04 11:26:41 +02:00
public AddedItemEvent() {
2022-05-05 13:15:50 +02:00
super(TYPE);
2022-04-29 14:52:03 +02:00
}
2022-05-04 16:35:59 +02:00
/**
*
* @param idsToNotify usernames or contexts
* @param idsAsGroup true if idsToNotify are groups (members of contexts)
* @param item
*/
public AddedItemEvent(String[] idsToNotify, boolean idsAsGroup, FileItemBean item) {
super(TYPE);
this.idsToNotify = idsToNotify;
this.idsAsGroup = idsAsGroup;
this.item = item;
}
2022-05-04 16:35:59 +02:00
/**
*
* @param idsToNotify usernames
* @param item
*/
public AddedItemEvent(String[] idsToNotify, FileItemBean item) {
super(TYPE);
this.idsToNotify = idsToNotify;
this.item = item;
}
2022-05-04 16:35:59 +02:00
2022-05-04 11:26:41 +02:00
public FileItemBean getItem() {
return item;
}
2022-05-04 11:26:41 +02:00
public void setItem(FileItemBean item) {
this.item = item;
}
2022-05-04 10:43:26 +02:00
2022-05-04 16:35:59 +02:00
}