public class ForkJoinDataSource extends java.lang.Object implements DataSource, MemoryHandler
MemoryHandler.Cost
Constructor and Description |
---|
ForkJoinDataSource(DataSource ds)
Creates a read only data source from another data source
|
Modifier and Type | Method and Description |
---|---|
DBObject |
create(DBClass dbClass)
Creates a new DBObject of a particular type
|
DBObject |
create(GlobalId classGid)
Creates a new DBObject of a particular type
|
DBObject |
create(java.lang.String className)
Create a new Object of type passed.
|
void |
dispose()
dispose of this ReadOnlyDataSource clear to tables and make sure we can't use this MutableDataSource after calling this method
|
PossibleRowsHolder |
fetchPossibleRows(SearchPlan plan,
DBQueryHandler qh) |
DBClass |
findDBClass(GlobalId classId)
Find the object definition
|
DBClass |
findDBClass(java.lang.String className)
Finds the Definition of a Object.
|
DBClassAbstract |
findDBClassAbstract(GlobalId classId)
Find the object definition
|
DBClassAbstract |
findDBClassAbstract(java.lang.String className)
Finds the Definition of a Object.
|
DBObject |
findKey(GlobalId valueId,
GlobalId classId)
Find an object by it's key
|
DBObject |
findKey(GlobalId id,
java.lang.String defName)
Finds a new DBObject by its primary integer key
|
DBObject |
findKey(GlobalKey gKey)
Finds a new DBObject by its primary key
|
DBObject |
findKey(java.lang.String value,
java.lang.String defName)
Finds a unique DBObject based on supplied key value
|
DBObject |
findRow(long rowId,
DBClassConcrete def,
Hint hint)
Finds a DBObject by it's rowId with a hint of what's next
|
long |
freeMemory(double percentage)
Free memory at this level and below.
|
java.lang.Object |
getAttribute(java.lang.String name)
MAY NOT set/get an attribute, this method will always return null.
|
java.lang.Object |
getCacheObject(java.lang.String key)
MAY NOT set/get cache object, this method will always return null.
|
MemoryHandler.Cost |
getCost()
The cost level for this MemoryHandler.
|
DataSource |
getCurrentDataSource()
get the current data source, if from VurtualDB then the thread local version
|
VirtualDB |
getDataBase()
Get the base virtual DB.
|
DataSource |
getDataBaseReadOnly()
Get the base virtual DB, if the data source is ReadOnlyDataSource.
|
long |
getEstimatedSize()
The estimated size of data held by this memory handler
|
Globals |
getGlobalObject()
Get the globals object
|
DBResult |
getInwardLinkage(DBClass sourceClass,
DBField sourceField,
DBObject target,
HintField hint)
Get the cached DBResult set for the linkage passed
|
long |
getLastAccessed()
The last time this memory handle was accessed
|
Login |
getLogin()
Get the current login
|
DBQueryHandler |
getQueryHandler(DBClass searchClass)
makes a Query handler for simple virtual db.
|
Login |
getRealLogin()
Get the current "real" login
|
Session |
getSession()
Get the current session
|
java.util.TimeZone |
getTimeZone()
Get the timeZone used for date/time processing.
|
Person |
getUser()
Get the current user
|
DataSource |
getWrappedDS() |
boolean |
hasChild(DBClass mapClass,
DBField parentField,
DBObject parentObject,
DBField childField,
DBObject childObject)
does this map table contain a mapping for the parent to child.
|
boolean |
hasExcludedGroups()
are any contacts excluded ?
|
boolean |
isExcludeFromGroup(ContactGroup group,
Person person)
is the contact excluded from the group.
|
DALQuery |
makeQuery(java.lang.String className) |
long |
nextNumber(java.lang.String key)
The next number for this data source
|
long |
nextNumber(java.lang.String key,
int cacheSize)
The next number for this data source
|
long |
panicFreeMemory()
Clear all memory.
|
long |
queuedFreeMemory(double percentage)
This method should implement the freeing of the method and maybe synchronized.
|
void |
setCacheObject(java.lang.String key,
java.lang.Object obj)
MAY NOT set/get cache object, this method will always return null.
|
long |
tidyUp()
Tidy up the memory handler
|
public ForkJoinDataSource(@Nonnull DataSource ds)
ds
- The data source to use@CheckReturnValue @Nonnull public DataSource getWrappedDS()
public void dispose()
@CheckReturnValue public long nextNumber(@Nonnull java.lang.String key)
nextNumber
in interface DataSource
key
- The item key@CheckReturnValue public long nextNumber(@Nonnull java.lang.String key, int cacheSize)
nextNumber
in interface DataSource
key
- The itemcacheSize
- The number of numbers to reserve@CheckReturnValue @Nonnull public DBClass findDBClass(@Nonnull java.lang.String className) throws NotFoundException
findDBClass
in interface DataSource
className
- The name of the classNotFoundException
@CheckReturnValue @Nonnull public DBClassAbstract findDBClassAbstract(@Nonnull java.lang.String className) throws NotFoundException
findDBClassAbstract
in interface DataSource
className
- The name of the classNotFoundException
@CheckReturnValue @Nonnull public DBClass findDBClass(@Nonnull GlobalId classId) throws NotFoundException
findDBClass
in interface DataSource
classId
- The class to be foundNotFoundException
@CheckReturnValue @Nonnull public DBClassAbstract findDBClassAbstract(@Nonnull GlobalId classId) throws NotFoundException
findDBClassAbstract
in interface DataSource
classId
- The class to be foundNotFoundException
@CheckReturnValue @Nullable public Session getSession()
getSession
in interface DataSource
@Nonnull public DBObject create(@Nonnull java.lang.String className) throws java.lang.Exception
create
in interface DataSource
className
- The name of the class to createjava.lang.Exception
@CheckReturnValue @Nonnull public Globals getGlobalObject() throws java.lang.Exception
getGlobalObject
in interface DataSource
java.lang.Exception
@CheckReturnValue @Nonnull public DBObject create(@Nonnull DBClass dbClass) throws java.lang.Exception
create
in interface DataSource
dbClass
- The class to createjava.lang.Exception
@CheckReturnValue @Nonnull public DBObject create(@Nonnull GlobalId classGid) throws java.lang.Exception
create
in interface DataSource
classGid
- The class to be createdjava.lang.Exception
@CheckReturnValue @Nonnull public PossibleRowsHolder fetchPossibleRows(@Nonnull SearchPlan plan, @Nonnull DBQueryHandler qh) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public DBObject findKey(GlobalId valueId, GlobalId classId) throws NotFoundException
findKey
in interface DataSource
valueId
- The value of the keyclassId
- The class id of the keyNotFoundException
@CheckReturnValue @Nonnull public DBObject findKey(@Nonnull GlobalId id, @Nonnull java.lang.String defName) throws NotFoundException
findKey
in interface DataSource
id
- The value iddefName
- The class nameNotFoundException
@CheckReturnValue @Nonnull public DBObject findKey(@Nonnull GlobalKey gKey) throws NotFoundException
findKey
in interface DataSource
gKey
- The key to findNotFoundException
@CheckReturnValue @Nonnull public DBObject findKey(@Nonnull java.lang.String value, @Nonnull java.lang.String defName) throws NotFoundException, TooManyRowsException, java.lang.Exception
findKey
in interface DataSource
value
- the value to finddefName
- The class nameNotFoundException
TooManyRowsException
java.lang.Exception
- a serious problem@CheckReturnValue @Nonnull public DBObject findRow(long rowId, @Nonnull DBClassConcrete def, @Nullable Hint hint) throws NotFoundException
findRow
in interface DataSource
rowId
- The row id to founddef
- The class to findhint
- A hint to the other rows that will be required.NotFoundException
@Nonnull @CheckReturnValue public DBResult getInwardLinkage(@Nonnull DBClass sourceClass, @Nonnull DBField sourceField, @Nullable DBObject target, @Nullable HintField hint) throws java.lang.Exception
getInwardLinkage
in interface DataSource
sourceClass
- The class to search on ( Nonnull)sourceField
- The source field ( Nonnull)target
- The object that the field points to (Nullable)hint
- the other objects that will be searched ( Nullable)java.lang.Exception
@CheckReturnValue @Nonnull public VirtualDB getDataBase()
getDataBase
in interface DataSource
@CheckReturnValue @Nonnull public DataSource getDataBaseReadOnly()
getDataBaseReadOnly
in interface DataSource
@CheckReturnValue @Nonnull public DataSource getCurrentDataSource()
getCurrentDataSource
in interface DataSource
@CheckReturnValue @Nonnull public Login getLogin()
getLogin
in interface DataSource
@CheckReturnValue @Nonnull public Login getRealLogin()
getRealLogin
in interface DataSource
@CheckReturnValue @Nullable public Person getUser()
getUser
in interface DataSource
@CheckReturnValue @Nonnull public java.util.TimeZone getTimeZone()
getTimeZone
in interface DataSource
@CheckReturnValue @Nullable public java.lang.Object getCacheObject(java.lang.String key)
getCacheObject
in interface DataSource
key
- The cache keypublic void setCacheObject(java.lang.String key, java.lang.Object obj)
setCacheObject
in interface DataSource
key
- The cache keyobj
- The object to cache@CheckReturnValue @Nullable public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface DataSource
name
- The attribute's name@CheckReturnValue @Nonnull public DBQueryHandler getQueryHandler(@Nonnull DBClass searchClass)
getQueryHandler
in interface DataSource
searchClass
- The class to search@CheckReturnValue public boolean hasChild(@Nonnull DBClass mapClass, @Nonnull DBField parentField, @Nonnull DBObject parentObject, @Nonnull DBField childField, @Nonnull DBObject childObject) throws java.lang.Exception
hasChild
in interface DataSource
mapClass
- The map classparentField
- the parent linkparentObject
- the parent objectchildField
- the child linkchildObject
- the child objectjava.lang.Exception
@CheckReturnValue public boolean isExcludeFromGroup(@Nonnull ContactGroup group, @Nonnull Person person)
isExcludeFromGroup
in interface DataSource
group
- the group to check if the contact is excluded.person
- the person to check.@CheckReturnValue public boolean hasExcludedGroups()
hasExcludedGroups
in interface DataSource
@CheckReturnValue @Nonnull public DALQuery makeQuery(@Nonnull java.lang.String className)
@Nonnull @CheckReturnValue public MemoryHandler.Cost getCost()
getCost
in interface MemoryHandler
public long freeMemory(double percentage)
freeMemory
in interface MemoryHandler
percentage
- to be freedpublic long tidyUp()
tidyUp
in interface MemoryHandler
public long queuedFreeMemory(double percentage)
queuedFreeMemory
in interface MemoryHandler
percentage
- The percentage to be cleared.public long panicFreeMemory()
panicFreeMemory
in interface MemoryHandler
@CheckReturnValue @Nonnegative public long getEstimatedSize()
getEstimatedSize
in interface MemoryHandler
@CheckReturnValue public long getLastAccessed()
getLastAccessed
in interface MemoryHandler
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.