public class ABOServerCache extends AbstractServerObject<ServerContext> implements CloseableComponent
AliveBusinessObject
instances.
An internal ABOAccessList
maintains the SessionId
s currently accessing ABOs.
Only such clients currently accessing an ABO will get change notifications.Constructor and Description |
---|
ABOServerCache(ServerContext serverCtx) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkPermission(SessionId sessionId,
PermissionControlled obj,
EspritPermission action)
Checks whether the current user has permission on the given object for the given action.
|
void |
clear()
Removes all ABOs from the cache sending according client notifications.
|
void |
close() |
protected int |
configureDumpHeadlineLength() |
<A extends AliveBusinessObject> |
createABO(SessionId sessionId,
A abo)
Creates the ABO and sends a client notification.
|
boolean |
deleteABO(SessionId sessionId,
AliveBusinessObject abo)
Deletes the ABO from the cache and sends a client notification.
|
void |
dropABO(SessionId sessionId,
PrimaryKey pk)
Drops the given
SessionId from the ABOs access list. |
int |
dumpCacheContent(DumpString s) |
<A extends AliveBusinessObject> |
fetchABO(SessionId sessionId,
PrimaryKey pk)
Feches the ABO from the cache.
|
<T extends AbstractSingletonABO> |
findCachedABO(java.lang.Class<? extends AbstractABO> aboClass)
Finds the according SingletonABO in the cache
|
<T extends AliveBusinessObject> |
findCachedABO(PrimaryKey pk)
Returns the cached ABO matching the
PrimaryKey . |
AliveBusinessObject |
findCachedABO(SessionId sessionId,
PrimaryKey pk)
Returns the cached ABO matching the
PrimaryKey . |
<A extends AliveBusinessObject> |
findCachedABOs(SessionId sessionId,
java.lang.Class<A> aboClass,
ABOFilter filter)
Returns a list of ABOs matching the given type and condition.
|
ABOAccessList |
getABOAccessList()
Returns a snapshot copy of the current access list.
|
int |
getABOInstanceCount(PrimaryKey pk)
Counts the number of cached instances of the ABO-type given in the primary key.
|
java.util.Collection<AliveBusinessObject> |
getAllCachedABOs()
Returns a snapshot collection of all ABOs currently in the cache.
|
int |
getCachedABOCount()
Returns the number of ABOs currently in the cache.
|
java.util.Collection<AliveBusinessObject> |
getCachedABOs(SessionId sessionId)
Returns all ABOs currently accessed by the given
SessionId |
void |
putABO(AliveBusinessObject abo)
Puts the given ABO into the cache and sends a client notification.
|
void |
updateABO(SessionId sessionId,
AliveBusinessObject abo)
Updates the given ABO and sends a client notification.
|
checkPermission, getServerConfig, getServerContext, getStatisticManager, toString
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString
public ABOServerCache(ServerContext serverCtx)
public int getCachedABOCount()
public java.util.Collection<AliveBusinessObject> getCachedABOs(SessionId sessionId)
SessionId
public java.util.Collection<AliveBusinessObject> getAllCachedABOs()
public int getABOInstanceCount(PrimaryKey pk) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public ABOAccessList getABOAccessList()
public void putABO(AliveBusinessObject abo)
public <T extends AbstractSingletonABO> T findCachedABO(java.lang.Class<? extends AbstractABO> aboClass)
public <T extends AliveBusinessObject> T findCachedABO(PrimaryKey pk)
PrimaryKey
.
This is an informative fetch only, it does NOT affect the accesslist.public AliveBusinessObject findCachedABO(SessionId sessionId, PrimaryKey pk)
PrimaryKey
.
The given SessionId
is registered in the accesslist, making the ABO online.public <A extends AliveBusinessObject> A fetchABO(SessionId sessionId, PrimaryKey pk) throws java.lang.Exception
SessionId
is registered in the access-list, making the ABO online.java.lang.Exception
public <A extends AliveBusinessObject> A createABO(SessionId sessionId, A abo) throws java.lang.Exception
SessionId
is registered in the access-list, making the ABO online.java.lang.Exception
public void updateABO(SessionId sessionId, AliveBusinessObject abo) throws java.lang.Exception
SessionId
is registered in the access-list, making the ABO online.java.lang.Exception
public void dropABO(SessionId sessionId, PrimaryKey pk)
SessionId
from the ABOs access list. If the ABO remains without any
accessing sessions and is not declared cache-resident, it will be removed from the cache
without client notification.public boolean deleteABO(SessionId sessionId, AliveBusinessObject abo) throws java.lang.Exception
java.lang.Exception
public void clear()
public void close()
close
in interface java.lang.AutoCloseable
protected final void checkPermission(SessionId sessionId, PermissionControlled obj, EspritPermission action) throws PermissionException
PermissionException
public <A extends AliveBusinessObject> java.util.List<A> findCachedABOs(SessionId sessionId, java.lang.Class<A> aboClass, ABOFilter filter)
protected int configureDumpHeadlineLength()
configureDumpHeadlineLength
in class DumpableObject
public int dumpCacheContent(DumpString s)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.