Issue #2506 Refactored RegistryEvent constructors.

Amend: Added call to default constructor in Event initialization constructor.

Change-Id: I4c3f105b9782512f6c0b73f2355767e855845454

Former-commit-id: 6e7c6c980a [formerly adc09b748d] [formerly 9e8420b216] [formerly d80183edc1 [formerly 9e8420b216 [formerly f4cb28f209073788a3c329c44283c8c8cf3bf70f]]]
Former-commit-id: d80183edc1
Former-commit-id: 033425fcb7988c579bf7a0bdbe5c72e806d56c5e [formerly 86f5c2b6ec]
Former-commit-id: 04c4b2a4cd
This commit is contained in:
Brad Gonzales 2013-11-08 15:28:40 -06:00
parent 458698d0a2
commit 516426e13f
5 changed files with 38 additions and 13 deletions

View file

@ -17,7 +17,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 5, 2012 #1305 bgonzale Added LogLevel enum and transient attribute.
* Nov 05, 2012 1305 bgonzale Added LogLevel enum and transient attribute.
* Nov 08, 2013 2506 bgonzale Added constructor.
*
* </pre>
*
@ -47,6 +48,14 @@ public abstract class Event implements Serializable, ISerializableObject {
this(LogLevel.DEBUG);
}
/**
* @param id
*/
public Event(String id) {
this();
this.id = id;
}
public Event(LogLevel logLevel) {
date = Calendar.getInstance();
this.logLevel = logLevel;

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 16, 2012 jsanchez Initial creation
* Nov 08, 2013 2506 bgonzale Added constructors.
*
* </pre>
*
@ -48,10 +49,7 @@ public class InsertRegistryEvent extends RegistryEvent {
}
public InsertRegistryEvent(String id, String lid, String objectType) {
this.id = id;
setLid(lid);
setObjectType(objectType);
setAction(Action.INSERT);
super(id, lid, objectType, Action.INSERT);
}
@Override

View file

@ -35,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 16, 2012 jsanchez Initial creation
* Nov 08, 2013 2506 bgonzale Added constructors.
*
* </pre>
*
@ -50,6 +51,27 @@ public abstract class RegistryEvent extends Event {
UPDATE, DELETE, INSERT
}
/**
* Default Constructor.
*/
public RegistryEvent() {
}
/**
* Initialization Constructor.
*
* @param id
* @param lid
* @param objectType
* @param action
*/
public RegistryEvent(String id, String lid, String objectType, Action action) {
super(id);
this.lid = lid;
this.objectType = objectType;
this.action = action;
}
@DynamicSerializeElement
private String lid;

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 16, 2012 jsanchez Initial creation
* Nov 08, 2013 2506 bgonzale Added constructors.
*
* </pre>
*
@ -51,11 +52,8 @@ public class RemoveRegistryEvent extends RegistryEvent {
}
public RemoveRegistryEvent(String username, String id) {
this.id = id;
super(id, null, null, Action.DELETE);
this.username = username;
setLid(null);
setObjectType(null);
setAction(Action.DELETE);
}
public String getUsername() {

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 16, 2012 jsanchez Initial creation
* Nov 08, 2013 2506 bgonzale Added constructors.
*
* </pre>
*
@ -48,9 +49,6 @@ public class UpdateRegistryEvent extends RegistryEvent {
}
public UpdateRegistryEvent(String id, String lid, String objectType) {
this.id = id;
setLid(lid);
setObjectType(objectType);
setAction(Action.UPDATE);
super(id, lid, objectType, Action.UPDATE);
}
}