ehsbe CommonsTM
Version 1.1.0rc3

com.ehsbe.commons.util
Class CrudEvent<E>

java.lang.Object
  extended by com.ehsbe.commons.util.CrudEvent<E>
Type Parameters:
E - the id of the changed objects
All Implemented Interfaces:
Serializable

public class CrudEvent<E>
extends Object
implements Serializable

A Create/Update/Delete event.

Version:
$Revision: 432 $
Author:
Jens Elkner
See Also:
Serialized Form

Nested Class Summary
static class CrudEvent.CrudType
          The type of entity change
 
Constructor Summary
CrudEvent(Object entity, CrudEvent.CrudType type, E... id)
          Convinience Constructor.
CrudEvent(String classname, CrudEvent.CrudType type, E... id)
          Default Constructor.
 
Method Summary
 void addId(E id)
          Add another CRUD object id to this event.
 String getClassname()
          Get the class name of the crud objects changed.
 ArrayList<E> getIds()
          Get a list of crud object ids for this event.
 CrudEvent.CrudType getType()
          Get the type of the event.
 boolean isStructureChanged()
          Check, whether the structure of the referred entity has been dramatically changed, so that all its children/[old] parent should be revalidated.
 void setStructureChanged(boolean structureChanged)
          Set, whether the structure from the referred entity has drastically changed (i.e. a simple parent and children check is not enough to re-align the structure).
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CrudEvent

public CrudEvent(String classname,
                 CrudEvent.CrudType type,
                 E... id)
Default Constructor.

Parameters:
classname - the class name of the CRUD object
id - the id of the CRUD object. Might be null.
type - the CRUD type

CrudEvent

public CrudEvent(Object entity,
                 CrudEvent.CrudType type,
                 E... id)
Convinience Constructor.

Parameters:
entity - the CRUD object
id - the id of the CRUD object. Might be null.
type - the CRUD type
See Also:
Object.getClass()
Method Detail

addId

public void addId(E id)
Add another CRUD object id to this event.

Parameters:
id - id of the crud object

getClassname

public String getClassname()
Get the class name of the crud objects changed.

Returns:
always a none-null value.

getType

public CrudEvent.CrudType getType()
Get the type of the event.

Returns:
the event type

getIds

public ArrayList<E> getIds()
Get a list of crud object ids for this event.

Returns:
a possible empty list.

toString

public String toString()

Overrides:
toString in class Object

isStructureChanged

public boolean isStructureChanged()
Check, whether the structure of the referred entity has been dramatically changed, so that all its children/[old] parent should be revalidated.

Returns:
true if the complete subtree should be revalidated.

setStructureChanged

public void setStructureChanged(boolean structureChanged)
Set, whether the structure from the referred entity has drastically changed (i.e. a simple parent and children check is not enough to re-align the structure).

Parameters:
structureChanged - structureChanged to set.

ehsbe CommonsTM
Version 1.1.0rc3

Copyright ©2005-2009 EHSBE, Walther-Rathenau-Str. 58, 39104 Magdeburg, Sachsen-Anhalt, Germany. All Rights Reserved.