Commit 4fc92030 authored by michael.simon's avatar michael.simon
Browse files

Change Event object to be audit and not auditor. Auditor has non

serialazable object and cannot be sent via JMS.
parent 36bcd41e
......@@ -12,7 +12,7 @@ package edu.kit.scc.webreg.event;
import java.io.Serializable;
import edu.kit.scc.webreg.audit.Auditor;
import edu.kit.scc.webreg.entity.audit.AuditEntryEntity;
public class AbstractEvent<E extends Serializable> implements Event<E> {
......@@ -20,11 +20,11 @@ public class AbstractEvent<E extends Serializable> implements Event<E> {
private E entity;
private Auditor auditor;
private AuditEntryEntity audit;
public AbstractEvent(E entity, Auditor auditor) {
public AbstractEvent(E entity, AuditEntryEntity audit) {
this.entity = entity;
this.auditor = auditor;
this.audit = audit;
}
public AbstractEvent(E entity) {
......@@ -35,8 +35,7 @@ public class AbstractEvent<E extends Serializable> implements Event<E> {
return entity;
}
public Auditor getAuditor() {
return auditor;
public AuditEntryEntity getAudit() {
return audit;
}
}
......@@ -10,8 +10,8 @@
******************************************************************************/
package edu.kit.scc.webreg.event;
import edu.kit.scc.webreg.audit.Auditor;
import edu.kit.scc.webreg.entity.RegistryEntity;
import edu.kit.scc.webreg.entity.audit.AuditEntryEntity;
public class ServiceRegisterEvent extends AbstractEvent<RegistryEntity> {
......@@ -21,7 +21,7 @@ public class ServiceRegisterEvent extends AbstractEvent<RegistryEntity> {
super(entity);
}
public ServiceRegisterEvent(RegistryEntity entity, Auditor auditor) {
super(entity, auditor);
public ServiceRegisterEvent(RegistryEntity entity, AuditEntryEntity audit) {
super(entity, audit);
}
}
......@@ -10,8 +10,8 @@
******************************************************************************/
package edu.kit.scc.webreg.event;
import edu.kit.scc.webreg.audit.Auditor;
import edu.kit.scc.webreg.entity.UserEntity;
import edu.kit.scc.webreg.entity.audit.AuditEntryEntity;
public class UserEvent extends AbstractEvent<UserEntity> {
......@@ -22,7 +22,7 @@ public class UserEvent extends AbstractEvent<UserEntity> {
super(entity);
}
public UserEvent(UserEntity entity, Auditor auditor) {
super(entity, auditor);
public UserEvent(UserEntity entity, AuditEntryEntity audit) {
super(entity, audit);
}
}
......@@ -367,7 +367,7 @@ public class UserUpdater implements Serializable {
protected void fireUserChangeEvent(UserEntity user, String executor, Auditor auditor) {
UserEvent userEvent = new UserEvent(user, auditor);
UserEvent userEvent = new UserEvent(user, auditor.getAudit());
try {
eventSubmitter.submit(userEvent, EventType.USER_UPDATE, executor);
......
......@@ -114,7 +114,7 @@ public class ApprovalServiceImpl implements ApprovalService {
auditor.logAction(registry.getUser().getEppn(), "DENY APPROVAL", "registry-" + registry.getId(), "User is denied acces for service", AuditStatus.SUCCESS);
ServiceRegisterEvent serviceRegisterEvent = new ServiceRegisterEvent(registry, auditor);
ServiceRegisterEvent serviceRegisterEvent = new ServiceRegisterEvent(registry, auditor.getAudit());
List<EventEntity> eventList = new ArrayList<EventEntity>(serviceEventDao.findAllByService(registry.getService()));
try {
eventSubmitter.submit(serviceRegisterEvent, eventList, EventType.APPROVAL_DENIED, executor);
......@@ -186,7 +186,7 @@ public class ApprovalServiceImpl implements ApprovalService {
}
}
ServiceRegisterEvent serviceRegisterEvent = new ServiceRegisterEvent(registry, auditor);
ServiceRegisterEvent serviceRegisterEvent = new ServiceRegisterEvent(registry, auditor.getAudit());
List<EventEntity> eventList = new ArrayList<EventEntity>(serviceEventDao.findAllByService(serviceEntity));
eventSubmitter.submit(serviceRegisterEvent, eventList, EventType.SERVICE_REGISTER, executor);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment