Issue #2506 Refactored RegistryEvent constructors.
Amend: Added call to default constructor in Event initialization constructor. Change-Id: I4c3f105b9782512f6c0b73f2355767e855845454 Former-commit-id:adc09b748d
[formerly9e8420b216
] [formerlyadc09b748d
[formerly9e8420b216
] [formerlyd80183edc1
[formerly f4cb28f209073788a3c329c44283c8c8cf3bf70f]]] Former-commit-id:d80183edc1
Former-commit-id:04c4b2a4cd
[formerly86f5c2b6ec
] Former-commit-id:0e64d5f7fd
This commit is contained in:
parent
837664eea1
commit
c9ba669d05
5 changed files with 38 additions and 13 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue