Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • arsnova/arsnova-backend
  • pcvl72/arsnova-backend
  • tksl38/arsnova-backend
3 results
Show changes
Showing
with 477 additions and 672 deletions
package de.thm.arsnova.entities;
public class FoodVote {
private String _id;
private String _rev;
private String type;
private String name;
private int count;
private String day;
public FoodVote() {
this.type = "food_vote";
}
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
public String get_rev() {
return _rev;
}
public void set_rev(String _rev) {
this._rev = _rev;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
}
/*
* Copyright (C) 2012 THM webMedia
*
* This file is part of ARSnova.
*
* ARSnova is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.entities;
import java.util.List;
public class Question {
private String type;
private String questionType;
private String questionVariant;
private String subject;
private String text;
private boolean active;
private String releasedFor;
private List<PossibleAnswer> possibleAnswers;
private boolean noCorrect;
// TODO: We currently need both sessionId and sessionKeyword, but sessionKeyword will not be persisted.
private String sessionId;
private String sessionKeyword;
private long timestamp;
private int number;
private int duration;
private int piRound;
private boolean showStatistic; // sic
private boolean showAnswer;
private boolean abstention;
private String _id;
private String _rev;
private String image;
private int gridSize;
private int offsetX;
private int offsetY;
private int zoomLvl;
public final String getType() {
return type;
}
public final void setType(final String type) {
this.type = type;
}
public final String getQuestionType() {
return questionType;
}
public final void setQuestionType(final String questionType) {
this.questionType = questionType;
}
public final String getQuestionVariant() {
return questionVariant;
}
public final void setQuestionVariant(final String questionVariant) {
this.questionVariant = questionVariant;
}
public final String getSubject() {
return subject;
}
public final void setSubject(final String subject) {
this.subject = subject;
}
public final String getText() {
return text;
}
public final void setText(final String text) {
this.text = text;
}
public final boolean isActive() {
return active;
}
public final void setActive(final boolean active) {
this.active = active;
}
public final String getReleasedFor() {
return releasedFor;
}
public final void setReleasedFor(final String releasedFor) {
this.releasedFor = releasedFor;
}
public final List<PossibleAnswer> getPossibleAnswers() {
return possibleAnswers;
}
public final void setPossibleAnswers(final List<PossibleAnswer> possibleAnswers) {
this.possibleAnswers = possibleAnswers;
}
public final boolean isNoCorrect() {
return noCorrect;
}
public final void setNoCorrect(final boolean noCorrect) {
this.noCorrect = noCorrect;
}
public final String getSessionId() {
return sessionId;
}
public final void setSessionId(final String sessionId) {
this.sessionId = sessionId;
}
public final String getSession() {
return sessionId;
}
public final void setSession(final String session) {
sessionId = session;
}
public final String getSessionKeyword() {
return sessionKeyword;
}
public final void setSessionKeyword(final String keyword) {
sessionKeyword = keyword;
}
public final long getTimestamp() {
return timestamp;
}
public final void setTimestamp(final long timestamp) {
this.timestamp = timestamp;
}
public final int getNumber() {
return number;
}
public final void setNumber(final int number) {
this.number = number;
}
public final int getDuration() {
return duration;
}
public final void setDuration(final int duration) {
this.duration = duration;
}
public int getPiRound() {
return piRound;
}
public void setPiRound(final int piRound) {
this.piRound = piRound;
}
public boolean isShowStatistic() {
return showStatistic;
}
public void setShowStatistic(final boolean showStatistic) {
this.showStatistic = showStatistic;
}
public boolean isShowAnswer() {
return showAnswer;
}
public void setShowAnswer(final boolean showAnswer) {
this.showAnswer = showAnswer;
}
public boolean isAbstention() {
return abstention;
}
public void setAbstention(final boolean abstention) {
this.abstention = abstention;
}
public final String get_id() {
return _id;
}
public final void set_id(final String _id) {
this._id = _id;
}
public final String get_rev() {
return _rev;
}
public final void set_rev(final String _rev) {
this._rev = _rev;
}
public String getImage() {
return image;
}
public void setImage(final String image) {
this.image = image;
}
public int getGridSize() {
return gridSize;
}
public void setGridSize(final int gridSize) {
this.gridSize = gridSize;
}
public int getOffsetX() {
return offsetX;
}
public void setOffsetX(final int offsetX) {
this.offsetX = offsetX;
}
public int getOffsetY() {
return offsetY;
}
public void setOffsetY(final int offsetY) {
this.offsetY = offsetY;
}
public int getZoomLvl() {
return zoomLvl;
}
public void setZoomLvl(final int zoomLvl) {
this.zoomLvl = zoomLvl;
}
@Override
public final String toString() {
return "Question type '" + type + "': " + subject + ";\n" + text + possibleAnswers;
}
}
/*
* Copyright (C) 2012 THM webMedia
*
* This file is part of ARSnova.
*
* ARSnova is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.entities;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class Session implements Serializable {
private static final long serialVersionUID = 1L;
private String type;
private String name;
private String shortName;
private String keyword;
private String creator;
private boolean active;
private long lastOwnerActivity;
private String courseType;
private String courseId;
private List<String> _conflicts;
private String _id;
private String _rev;
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public String getShortName() {
return shortName;
}
public void setShortName(final String shortName) {
this.shortName = shortName;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(final String keyword) {
this.keyword = keyword;
}
public String getCreator() {
return creator;
}
public void setCreator(final String creator) {
this.creator = creator;
}
public boolean isActive() {
return active;
}
public void setActive(final boolean active) {
this.active = active;
}
public long getLastOwnerActivity() {
return lastOwnerActivity;
}
public void setLastOwnerActivity(final long lastOwnerActivity) {
this.lastOwnerActivity = lastOwnerActivity;
}
public void set_id(final String id) {
_id = id;
}
public String get_id() {
return _id;
}
public void set_rev(final String rev) {
_rev = rev;
}
public String get_rev() {
return _rev;
}
public void set_conflicts(final List<String> conflicts) {
_conflicts = conflicts;
}
public List<String> get_conflicts() {
return _conflicts;
}
public boolean isCreator(final User user) {
return user.getUsername().equals(creator);
}
public String getCourseType() {
return courseType;
}
public void setCourseType(final String courseType) {
this.courseType = courseType;
}
public String getCourseId() {
return courseId;
}
public void setCourseId(final String courseId) {
this.courseId = courseId;
}
@JsonIgnore
public boolean isCourseSession() {
return getCourseId() != null && !getCourseId().isEmpty();
}
@Override
public String toString() {
return "Session [keyword=" + keyword+ ", type=" + type + "]";
}
}
package de.thm.arsnova.entities;
public class Statistics {
private int answers;
private int questions;
private int openSessions;
private int closedSessions;
private int activeUsers;
private int loggedinUsers;
public int getAnswers() {
return answers;
}
public void setAnswers(final int answers) {
this.answers = answers;
}
public int getQuestions() {
return questions;
}
public void setQuestions(final int questions) {
this.questions = questions;
}
public int getOpenSessions() {
return openSessions;
}
public void setOpenSessions(final int openSessions) {
this.openSessions = openSessions;
}
public int getClosedSessions() {
return closedSessions;
}
public void setClosedSessions(final int closedSessions) {
this.closedSessions = closedSessions;
}
public int getActiveUsers() {
return activeUsers;
}
public void setActiveUsers(final int activeUsers) {
this.activeUsers = activeUsers;
}
public int getLoggedinUsers() {
return loggedinUsers;
}
public void setLoggedinUsers(final int loggedinUsers) {
this.loggedinUsers = loggedinUsers;
}
@Override
public int hashCode() {
return (this.getClass().getName()
+ activeUsers
+ answers
+ closedSessions
+ openSessions
+ questions
+ loggedinUsers
).hashCode();
}
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj instanceof Statistics) {
final Statistics other = (Statistics) obj;
return hashCode() == other.hashCode();
}
return false;
}
}
package de.thm.arsnova.entities;
import java.io.Serializable;
import org.jasig.cas.client.authentication.AttributePrincipal;
import org.scribe.up.profile.facebook.FacebookProfile;
import org.scribe.up.profile.google.Google2Profile;
import org.scribe.up.profile.twitter.TwitterProfile;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import de.thm.arsnova.services.UserSessionService;
public class User implements Serializable {
public static final String GOOGLE = "google";
public static final String TWITTER = "twitter";
public static final String FACEBOOK = "facebook";
public static final String THM = "thm";
public static final String LDAP = "ldap";
public static final String ANONYMOUS = "anonymous";
private static final long serialVersionUID = 1L;
private String username;
private String type;
private UserSessionService.Role role;
public User(Google2Profile profile) {
setUsername(profile.getEmail());
setType(User.GOOGLE);
}
public User(TwitterProfile profile) {
setUsername(profile.getScreenName());
setType(User.TWITTER);
}
public User(FacebookProfile profile) {
setUsername(profile.getLink());
setType(User.FACEBOOK);
}
public User(AttributePrincipal principal) {
setUsername(principal.getName());
setType(User.THM);
}
public User(AnonymousAuthenticationToken token) {
setUsername(User.ANONYMOUS);
setType(User.ANONYMOUS);
}
public User(UsernamePasswordAuthenticationToken token) {
setUsername(token.getName());
setType(LDAP);
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public UserSessionService.Role getRole() {
return role;
}
public void setRole(UserSessionService.Role role) {
this.role = role;
}
public boolean hasRole(UserSessionService.Role role) {
return this.role == role;
}
@Override
public String toString() {
return "User [username=" + username + ", type=" + type + "]";
}
@Override
public int hashCode() {
// See http://stackoverflow.com/a/113600
final int theAnswer = 42;
final int theOthers = 37;
int result = theAnswer;
result = theOthers * result + this.username.hashCode();
return theOthers * result + this.type.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null || !obj.getClass().equals(this.getClass())) {
return false;
}
User other = (User) obj;
return this.username.equals(other.username) && this.type.equals(other.type);
}
}
package de.thm.arsnova.entities;
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public class AfterCreationEvent<E extends Entity> extends CrudEvent<E> {
public AfterCreationEvent(final Object source, final E entity) {
super(source, entity);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public class AfterDeletionEvent<E extends Entity> extends CrudEvent<E> {
public AfterDeletionEvent(final Object source, final E entity) {
super(source, entity);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public class AfterFullUpdateEvent<E extends Entity> extends AfterUpdateEvent<E> {
private final E oldEntity;
public AfterFullUpdateEvent(final Object source, final E entity, final E oldEntity) {
super(source, entity);
this.oldEntity = oldEntity;
}
public E getOldEntity() {
return oldEntity;
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import java.util.Map;
import java.util.function.Function;
import de.thm.arsnova.model.Entity;
public class AfterPatchEvent<E extends Entity> extends AfterUpdateEvent<E> {
private final Function<E, ? extends Object> propertyGetter;
private final Map<String, Object> changes;
public AfterPatchEvent(final Object source, final E entity, final Function<E, ? extends Object> propertyGetter,
final Map<String, Object> changes) {
super(source, entity);
this.propertyGetter = propertyGetter;
this.changes = changes;
}
public Function<E, ? extends Object> getPropertyGetter() {
return propertyGetter;
}
public Map<String, Object> getChanges() {
return changes;
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public abstract class AfterUpdateEvent<E extends Entity> extends CrudEvent<E> {
public AfterUpdateEvent(final Object source, final E entity) {
super(source, entity);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import org.springframework.context.ApplicationEvent;
/**
* Base class of an ARSnova event.
*/
public abstract class ArsnovaEvent extends ApplicationEvent {
private static final long serialVersionUID = 1L;
public ArsnovaEvent(final Object source) {
super(source);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public class BeforeCreationEvent<E extends Entity> extends CrudEvent<E> {
public BeforeCreationEvent(final Object source, final E entity) {
super(source, entity);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public class BeforeDeletionEvent<E extends Entity> extends CrudEvent<E> {
public BeforeDeletionEvent(final Object source, final E entity) {
super(source, entity);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public class BeforeFullUpdateEvent<E extends Entity> extends BeforeUpdateEvent<E> {
private final E oldEntity;
public BeforeFullUpdateEvent(final Object source, final E entity, final E oldEntity) {
super(source, entity);
this.oldEntity = oldEntity;
}
public E getOldEntity() {
return oldEntity;
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import java.util.Map;
import java.util.function.Function;
import de.thm.arsnova.model.Entity;
public class BeforePatchEvent<E extends Entity> extends BeforeUpdateEvent<E> {
private final Function<E, ? extends Object> propertyGetter;
private final Map<String, Object> changes;
public BeforePatchEvent(final Object source, final E entity, final Function<E, ? extends Object> propertyGetter,
final Map<String, Object> changes) {
super(source, entity);
this.propertyGetter = propertyGetter;
this.changes = changes;
}
public Function<E, ? extends Object> getPropertyGetter() {
return propertyGetter;
}
public Map<String, Object> getChanges() {
return changes;
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import de.thm.arsnova.model.Entity;
public abstract class BeforeUpdateEvent<E extends Entity> extends CrudEvent<E> {
public BeforeUpdateEvent(final Object source, final E entity) {
super(source, entity);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
/**
* Fires whenever a score related value changes.
*/
public class ChangeScoreEvent extends RoomEvent {
private static final long serialVersionUID = 1L;
public ChangeScoreEvent(final Object source, final String roomId) {
super(source, roomId);
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import org.springframework.context.ApplicationEvent;
import org.springframework.core.ResolvableType;
import org.springframework.core.ResolvableTypeProvider;
import de.thm.arsnova.model.Entity;
public abstract class CrudEvent<E extends Entity> extends ApplicationEvent implements ResolvableTypeProvider {
private E entity;
public CrudEvent(final Object source, final E entity) {
super(source);
this.entity = entity;
}
public E getEntity() {
return entity;
}
@Override
public ResolvableType getResolvableType() {
return ResolvableType.forClassWithGenerics(getClass(), entity.getClass());
}
}
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.event;
import java.util.Set;
import de.thm.arsnova.model.Room;
/**
* Fires whenever the feedback of a specific user has been reset.
*/
public class DeleteFeedbackForRoomsEvent extends ArsnovaEvent {
private static final long serialVersionUID = 1L;
private final Set<Room> sessions;
private final String userId;
public DeleteFeedbackForRoomsEvent(final Object source, final Set<Room> rooms, final String userId) {
super(source);
this.sessions = rooms;
this.userId = userId;
}
public Set<Room> getSessions() {
return sessions;
}
public String getUserId() {
return userId;
}
}