|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.ItemImpl
ItemImpl
implements the Item
interface.
Field Summary | |
protected ItemId |
id
|
protected ItemManager |
itemMgr
ItemManager that created this Item |
protected Map |
listeners
Listeners (weak references) |
protected RepositoryImpl |
rep
the Repository object |
protected SessionImpl |
session
Session through which this Item was acquired |
protected ItemState |
state
ItemState associated with this Item |
protected SessionItemStateManager |
stateMgr
SessionItemStateManager associated with this Item |
protected int |
status
|
protected static int |
STATUS_DESTROYED
|
protected static int |
STATUS_INVALIDATED
|
protected static int |
STATUS_MODIFIED
|
protected static int |
STATUS_NORMAL
|
Method Summary | |
abstract void |
accept(ItemVisitor visitor)
|
Item |
getAncestor(int degree)
|
int |
getDepth()
|
ItemId |
getId()
Return the id of this Item . |
abstract String |
getName()
|
protected abstract ItemState |
getOrCreateTransientItemState()
|
abstract Node |
getParent()
|
String |
getPath()
|
Path |
getPrimaryPath()
Returns the primary path to this Item . |
abstract QName |
getQName()
Same as except that
this method returns a QName instead of a
String . |
Session |
getSession()
|
protected void |
internalRemove(boolean noChecks)
Same as except for the
noChecks parameter. |
boolean |
isModified()
|
boolean |
isNew()
|
abstract boolean |
isNode()
|
boolean |
isSame(Item otherItem)
|
protected boolean |
isTransactionalNew()
checks if this item is new. |
protected boolean |
isTransient()
|
protected abstract void |
makePersistent()
|
protected void |
notifyDestroyed()
Notify the listeners that this instance has been destroyed (i.e. |
protected void |
notifyInvalidated()
Notify the listeners that this instance has been invalidated (i.e. |
void |
refresh(boolean keepChanges)
|
void |
remove()
|
String |
safeGetJCRPath()
Failsafe mapping of internal id to JCR path for use in
diagnostic output, error messages etc. |
protected void |
sanityCheck()
Performs a sanity check on this item and the associated session. |
void |
save()
|
protected void |
setRemoved()
Marks this instance as 'removed' and notifies its listeners. |
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 |
protected static final int STATUS_NORMAL
protected static final int STATUS_MODIFIED
protected static final int STATUS_DESTROYED
protected static final int STATUS_INVALIDATED
protected int status
protected final ItemId id
protected final SessionImpl session
Session
through which this Item
was acquired
protected final RepositoryImpl rep
Repository
object
protected ItemState state
ItemState
associated with this Item
protected final ItemManager itemMgr
ItemManager
that created this Item
protected final SessionItemStateManager stateMgr
SessionItemStateManager
associated with this Item
protected final Map listeners
Method Detail |
protected void sanityCheck() throws RepositoryException
RepositoryException
- if this item has been rendered invalid for some reasonprotected boolean isTransient()
protected abstract ItemState getOrCreateTransientItemState() throws RepositoryException
RepositoryException
protected abstract void makePersistent() throws InvalidItemStateException
InvalidItemStateException
protected void setRemoved() throws RepositoryException
RepositoryException
- if an error occursprotected void notifyInvalidated()
protected void notifyDestroyed()
public ItemId getId()
Item
.
Item
public Path getPrimaryPath() throws RepositoryException
Item
.
Item
RepositoryException
public String safeGetJCRPath()
id
to JCR path for use in
diagnostic output, error messages etc.
protected void internalRemove(boolean noChecks) throws VersionException, LockException, ConstraintViolationException, RepositoryException
Item.remove()
except for the
noChecks
parameter.
noChecks
-
VersionException
LockException
RepositoryException
ConstraintViolationException
public abstract QName getQName() throws RepositoryException
Item.getName()
except that
this method returns a QName
instead of a
String
.
QName
RepositoryException
- if an error occurs.public 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 discardedItemState.discard()
public abstract void accept(ItemVisitor visitor) throws RepositoryException
accept
in interface Item
RepositoryException
public abstract boolean isNode()
isNode
in interface Item
public abstract String getName() throws RepositoryException
getName
in interface Item
RepositoryException
public abstract Node getParent() throws ItemNotFoundException, AccessDeniedException, RepositoryException
getParent
in interface Item
ItemNotFoundException
AccessDeniedException
RepositoryException
public boolean isNew()
isNew
in interface Item
protected boolean isTransactionalNew()
isNew()
but within a transaction an item can
be saved but not yet persisted.
public boolean isModified()
isModified
in interface Item
public void remove() throws VersionException, LockException, ConstraintViolationException, RepositoryException
remove
in interface Item
VersionException
LockException
ConstraintViolationException
RepositoryException
public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException, InvalidItemStateException, ReferentialIntegrityException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException
save
in interface Item
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
ReferentialIntegrityException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException
public void refresh(boolean keepChanges) throws InvalidItemStateException, RepositoryException
refresh
in interface Item
InvalidItemStateException
RepositoryException
public Item getAncestor(int degree) throws ItemNotFoundException, AccessDeniedException, RepositoryException
getAncestor
in interface Item
ItemNotFoundException
AccessDeniedException
RepositoryException
public String getPath() throws RepositoryException
getPath
in interface Item
RepositoryException
public int getDepth() throws RepositoryException
getDepth
in interface Item
RepositoryException
public Session getSession() throws RepositoryException
getSession
in interface Item
RepositoryException
public boolean isSame(Item otherItem) throws RepositoryException
isSame
in interface Item
RepositoryException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |