|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.state.ItemState
ItemState
represents the state of an Item
.
Field Summary | |
protected ItemState |
overlayedState
the backing persistent item state (may be null) |
protected int |
status
the internal status of this item state |
static int |
STATUS_EXISTING
'existing', i.e. |
static int |
STATUS_EXISTING_MODIFIED
'existing', i.e. |
static int |
STATUS_EXISTING_REMOVED
'existing', i.e. |
static int |
STATUS_NEW
'new' state |
static int |
STATUS_STALE_DESTROYED
'existing', i.e. |
static int |
STATUS_STALE_MODIFIED
'existing', i.e. |
static int |
STATUS_UNDEFINED
the status is undefined |
Constructor Summary | |
protected |
ItemState(int initialStatus,
boolean isTransient)
Constructs a new unconnected item state |
protected |
ItemState(ItemState overlayedState,
int initialStatus,
boolean isTransient)
Constructs a new item state that is initially connected to an overlayed state. |
Method Summary | |
void |
addListener(ItemStateListener listener)
Add an ItemStateListener |
protected void |
connect(ItemState overlayedState)
Connect this state to some underlying overlayed state. |
protected abstract void |
copy(ItemState state)
Copy state information from another state into this state |
void |
discard()
Discards this instance, i.e. |
protected void |
disconnect()
Disconnect this state from the underlying overlayed state. |
abstract ItemId |
getId()
Returns the identifier of this item. |
short |
getModCount()
Returns the modification count. |
ItemState |
getOverlayedState()
Returns the persistent state backing this transient state or null if there is no persistent state (i.e.. |
abstract NodeId |
getParentId()
Returns the NodeId of the parent NodeState or null
if either this item state represents the root node or this item state is
'free floating', i.e. |
int |
getStatus()
Returns the status of this item. |
boolean |
hasOverlayedState()
Determines if this item state is overlying persistent state. |
abstract boolean |
isNode()
Determines if this item state represents a node. |
boolean |
isStale()
Determines whether this item state has become stale. |
boolean |
isTransient()
Returns true if this item state represents new or modified
state (i.e. |
protected void |
notifyStateCreated()
Notify the listeners that the persistent state this object is representing has been created. |
protected void |
notifyStateDestroyed()
Notify the listeners that the persistent state this object is representing has been destroyed. |
protected void |
notifyStateDiscarded()
Notify the listeners that the persistent state this object is representing has been discarded. |
void |
notifyStateUpdated()
Notify the listeners that the persistent state this object is representing has been updated. |
protected void |
reconnect()
Reconnect this state to the overlayed state that it has been disconnected from earlier. |
void |
removeListener(ItemStateListener listener)
Remove an ItemStateListener |
void |
setModCount(short modCount)
Sets the modification count. |
void |
setStatus(int newStatus)
Sets the new status of this item. |
void |
stateCreated(ItemState created)
Called when an ItemState has successfully
been created (i.e. its underlying persistent state was created). |
void |
stateDestroyed(ItemState destroyed)
Called when an ItemState has successfully been
removed (i.e. its underlying persistent state has been destroyed). |
void |
stateDiscarded(ItemState discarded)
Called when an ItemState has been discarded (i.e. it has
been rendered 'invalid'). |
void |
stateModified(ItemState modified)
Called when an ItemState has successfully
been modified (i.e. its underlying persistent state has changed). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STATUS_UNDEFINED
public static final int STATUS_EXISTING
public static final int STATUS_EXISTING_MODIFIED
public static final int STATUS_EXISTING_REMOVED
public static final int STATUS_NEW
public static final int STATUS_STALE_MODIFIED
public static final int STATUS_STALE_DESTROYED
protected int status
protected transient ItemState overlayedState
Constructor Detail |
protected ItemState(int initialStatus, boolean isTransient)
initialStatus
- the initial status of the item state objectisTransient
- flag indicating whether this state is transient or notprotected ItemState(ItemState overlayedState, int initialStatus, boolean isTransient)
overlayedState
- the backing item state being overlayedinitialStatus
- the initial status of the new ItemState
instanceisTransient
- flag indicating whether this state is transient or notMethod Detail |
protected abstract void copy(ItemState state)
state
- source state informationprotected void connect(ItemState overlayedState)
protected void reconnect()
protected void disconnect()
protected void notifyStateDiscarded()
protected void notifyStateCreated()
public void notifyStateUpdated()
protected void notifyStateDestroyed()
public abstract boolean isNode()
public abstract ItemId getId()
public boolean isTransient()
true
if this item state represents new or modified
state (i.e. the result of copy-on-write) or false
if it
represents existing, unmodified state.
true
if this item state is modified or new,
otherwise false
public boolean isStale()
public abstract NodeId getParentId()
NodeState
or null
if either this item state represents the root node or this item state is
'free floating', i.e. not attached to the repository's hierarchy.
NodeState
's Idpublic int getStatus()
public void setStatus(int newStatus)
newStatus
- the new statuspublic short getModCount()
public void setModCount(short modCount)
modCount
- the modification count of this itempublic void discard()
public boolean hasOverlayedState()
true
if this item state is overlying persistent
state, otherwise false
.public ItemState getOverlayedState()
null
if there is no persistent state (i.e.. this
state is purely transient).
null
if there is
no persistent state.public void addListener(ItemStateListener listener)
ItemStateListener
listener
- the new listener to be informed on modificationspublic void removeListener(ItemStateListener listener)
ItemStateListener
listener
- an existing listenerpublic void stateCreated(ItemState created)
ItemState
has successfully
been created (i.e. its underlying persistent state was created).
stateCreated
in interface ItemStateListener
created
- the ItemState
that has been 'created'public void stateDestroyed(ItemState destroyed)
ItemState
has successfully been
removed (i.e. its underlying persistent state has been destroyed).
stateDestroyed
in interface ItemStateListener
destroyed
- the ItemState
that has been 'destroyed'public void stateModified(ItemState modified)
ItemState
has successfully
been modified (i.e. its underlying persistent state has changed).
stateModified
in interface ItemStateListener
modified
- the ItemState
that has been 'modified'public void stateDiscarded(ItemState discarded)
ItemState
has been discarded (i.e. it has
been rendered 'invalid').
stateDiscarded
in interface ItemStateListener
discarded
- the ItemState
that has been discardeddiscard()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |