org.apache.lenya.cms.repository
Interface Session

All Superinterfaces:
UnitOfWork
All Known Subinterfaces:
SharedItemStore
All Known Implementing Classes:
SessionImpl

public interface Session
extends UnitOfWork

Repository session.


Method Summary
 void addListener(RepositoryListener listener)
           
 void commit()
          Commits the transaction.
 void enqueueEvent(RepositoryEvent event)
           
 java.lang.String getId()
           
 Identity getIdentity()
           
 RepositoryItem getRepositoryItem(RepositoryItemFactory factory, java.lang.String key)
           
 boolean isListenerRegistered(RepositoryListener listener)
          Checks if a listener is registered.
 boolean isModifiable()
           
 void rollback()
          Rolls the transaction back.
 void setIdentity(Identity identity)
           
 
Methods inherited from interface org.apache.lenya.transaction.UnitOfWork
createLock, isDirty, registerDirty, registerNew, registerRemoved, removeLock
 

Method Detail

getIdentity

Identity getIdentity()
Returns:
the identity this session belongs to.

commit

void commit()
            throws RepositoryException,
                   ConcurrentModificationException
Commits the transaction.

Specified by:
commit in interface UnitOfWork
Throws:
RepositoryException - if an error occurs.
ConcurrentModificationException - if a transactionable has been modified by another session.

rollback

void rollback()
              throws RepositoryException
Rolls the transaction back.

Specified by:
rollback in interface UnitOfWork
Throws:
RepositoryException - if an error occurs.

getRepositoryItem

RepositoryItem getRepositoryItem(RepositoryItemFactory factory,
                                 java.lang.String key)
                                 throws RepositoryException
Parameters:
factory - The factory.
key - The key.
Returns:
The item for the specific key.
Throws:
RepositoryException - if an error occurs.

addListener

void addListener(RepositoryListener listener)
                 throws RepositoryException
Parameters:
listener - The listener to add.
Throws:
RepositoryException - if the listener is already registered.

isListenerRegistered

boolean isListenerRegistered(RepositoryListener listener)
Checks if a listener is registered.

Parameters:
listener - The listener.
Returns:
A boolean value.

enqueueEvent

void enqueueEvent(RepositoryEvent event)
Parameters:
event - The event to add to the queue.

setIdentity

void setIdentity(Identity identity)
Parameters:
identity - The identity.

isModifiable

boolean isModifiable()
Returns:
if the repository items in this session can be modified.

getId

java.lang.String getId()
Returns:
The ID of this session.


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.