public interface DatabaseFacade
Modifier and Type | Method and Description |
---|---|
void |
addContact(Contact c)
Add this
Contact to the database. |
void |
addFilter(Filter filter)
Add a
Filter to the database, overwriting any existing filter for this pic. |
void |
addPic(Pic pic)
Add this
Pic to the database. |
void |
addRoot(Root root)
Add this
Root to the Database. |
void |
addSet(Set set)
Add this new
Set to the database. |
void |
addVirgin(java.lang.String picName)
Add this Pic name as a
Virgin in the database. |
void |
deleteChain(Chain chain)
Delete this
Chain from the Database. |
void |
deleteMosaic(int mid)
Delete the
Mosaic from the database that has this Mosaic ID. |
void |
deleteMosaicTiles(int mid)
Delete the
MosaicTile s for the Mosaic specified by this Mosaic ID. |
void |
deletePoster(int pid)
Delete the
Poster from the database that has this Poster ID. |
void |
deleteRoot(Root root)
Delete this
Root from the database. |
void |
deleteSet(Set set)
Delete this
Set from the database. |
void |
deleteVirgin(java.lang.String picName)
Delete this Pic name from the
Virgin s table. |
java.util.List<Root> |
getActiveRoots()
Get a List of active
Root s. |
java.util.List<Set> |
getActiveSets()
Get a List of active
Set s |
Chain |
getChain(int cid)
Fetch a
Chain based on its Chain ID. |
Chain |
getChain(java.lang.String chainName)
Fetch a
Chain based on its name. |
int |
getChainCount()
Return the number of
Chain s in the Database. |
java.util.List<Chain> |
getChains()
Get a List of all of the
Chain s in the database. |
java.util.Date |
getClientSyncTimestamp(java.lang.String host)
Get the last time this client sync'd.
|
Contact |
getContact(int cid,
java.lang.String name)
Fetch the
Contact that was built with these parameters. |
Contact |
getContact(int cid,
java.lang.String setName,
int size,
int index)
Fetch the
Contact that was built with these parameters. |
java.util.HashMap<java.lang.String,java.util.Date> |
getContactOldestMap(Chain chain)
Return the oldest contact in each set/size in a map
k = SetName i.e.
|
java.lang.String |
getDbUrl()
Get the url that is accessing the database.
|
java.lang.String |
getDbUser()
Get the user who is accessing the database.
|
Filter |
getFilter(java.lang.String picName)
Get the
Filter for the pic named. |
java.util.List<java.lang.String> |
getFilterColumns()
Get a list of the
Filter column names from the database. |
int |
getFilterCount()
Get the number of
Filter s in the database. |
java.util.List<Filter> |
getFilters()
Get a list of all of the
Filter s in the database. |
java.util.List<Filter> |
getFiltersBySet(java.lang.String setName,
int size)
Get a list of all of the
Filter s for this set/size. |
java.util.List<Root> |
getInactiveRoots()
Get a List of Inactive
Root s. |
java.util.List<Set> |
getInactiveSets()
Get a List of inactive
Set s |
MetaSet |
getMetaSet(int sid)
Get the
MetaSet that matches this Set ID. |
java.util.List<java.lang.String> |
getMetaSetColumns()
Get a List of Column names for the
MetaSet s. |
MetaSetFilter |
getMetaSetFilter()
Fetch a reference to the MetaSet filter processor.
|
Mosaic |
getMosaic(int mid)
Get a
Mosaic from the database based on this Mosaic ID. |
Mosaic |
getMosaic(java.lang.String masterPic,
java.lang.String engine,
int sid,
int tileHeight)
Find the
Mosaic in the database that matches these parameters. |
MosaicBatch |
getMosaicBatch(int mbid)
Get the MosaicBatch that matches this mbid
|
java.util.List<MosaicBatch> |
getMosaicBatches()
Get a List of
MosaicBatch es in the database. |
java.util.List<Mosaic> |
getMosaics()
Get a List of all of the
Mosaic s in the database. |
int |
getMosaicTileCount(int mid)
Return the number of tiles we have stored for this
Mosaic |
java.util.List<MosaicTile> |
getMosaicTiles(int mid)
Fetch the already built
MosaicTile s for this Mosaic |
java.util.List<MosaicVector> |
getMosaicVectors(java.util.List<Pic> picList)
Get the List of
MosaicVector s that matches this picList, which probably came from a mosaic Set. |
Contact |
getNewestContact()
Fetch the newest
Contact made. |
Pic |
getNewestPic()
Get the newest pic in the database.
|
Pic |
getPic(int pid)
Get a
Pic who's pid matches this one. |
Pic |
getPic(java.lang.String picName)
Get a
Pic who's name matches this picName. |
java.util.List<java.lang.String> |
getPicExtensions()
Return a list of file name extensions that denote pics that we are interested in.
|
FilterMicroSet |
getPicFromFilterMicroSet(int pid,
int sid)
Get the
FilterMicroSet for this pic in this set. |
int |
getPicMaxThumbCacheDirUsed()
Determine the highest numbered thumb cache subdirectory used.
|
java.util.List<java.lang.String> |
getPicNamesByFunc(int func,
int size,
int rateOp,
java.lang.String operand)
Get a List of the Pic Names that pass this function filter.
|
java.util.List<java.lang.String> |
getPicNamesBySet(MetaSet set,
int size,
int rateOp,
int rateVal)
Get a List of the Pic Names of the
Filter s that match this query. |
java.util.List<java.lang.String> |
getPicNamesBySet(Set set,
int size)
Get a List of the Pic Names of the
Filter s that match this query. |
java.util.List<java.lang.String> |
getPicNamesBySet(Set set,
int size,
int rateOp,
int rateVal)
Get a List of the Pic Names of the
Filter s that match this valued query. |
java.util.List<java.lang.String> |
getPicNamesBySet(java.lang.String setName,
int size)
Get a List of the Pic Names of the
Filter s that match this query. |
java.util.List<java.lang.String> |
getPicNamesBySet(java.lang.String setName,
int size,
int rateOp,
int rateVal)
Get a List of the Pic Names of the
Filter s that match this valued query. |
double |
getPicRate(java.lang.String picName,
MetaSet metaSet,
int size)
Get the rating for this pic intersected by this MetaSet at this size
|
double |
getPicRate(java.lang.String picName,
Set set,
int size)
Get the rating for this pic intersected by this set at this size
|
java.util.List<Pic> |
getPics()
Get a List of all of the Pics.
|
java.util.List<Pic> |
getPics(Set set,
int size)
Get a list of
Pic s for this set at this size. |
java.util.List<Pic> |
getPics(java.lang.String picName)
Get a List of all of the
Pic s in the database that match this name. |
java.util.List<Pic> |
getPicsByMD5Sum(long md5sum)
Return a list of Pics that have this md5Sum
|
java.util.List<Pic> |
getPicsInDir(int rid,
java.lang.String dirName)
Get a list of
Pic s that are in this subdirectory. |
java.util.HashMap<java.lang.String,java.util.Date> |
getPicsMap()
Get a HashMap of all of the
Pic names in the database. |
java.util.List<Pic> |
getPicsNewerThan(java.util.Calendar calendar)
Get a list of Pics that are newer than this date
|
int |
getPicThumbCacheFillCount(int cacheDir)
Determine the number of cached thumbs in this cache directory.
|
Poster |
getPoster(int pid)
Get a
Poster from the database based on this Poster ID. |
java.util.List<Poster> |
getPosters()
Get a List of all of the
Mosaic s in the database. |
java.lang.String |
getRandomHomePagePicName(User user)
Return a random pic from the database destined to be a thumbnail on the home page
|
Pic |
getRandomPic()
Return a random pic from the database
|
Root |
getRoot(int rid)
Fetch a
Root |
Root |
getRoot(java.lang.String name)
Fetch a
Root |
int |
getRootCount()
Get the number of
Root s in the database |
java.util.List<Root> |
getRoots()
Get a List of all of the
Root s |
Set |
getSet(int sid)
Get the
Set that matches this Set ID |
Set |
getSet(java.lang.String setName)
Get the
Set that matches this Set ID |
int |
getSetCount()
Return the number of
Set s in the Database. |
java.util.List<Set> |
getSets()
Get a List of all of the
Set s in the database. |
java.util.List<Set> |
getSetsClone()
Get a cloned List of all of the
Set s in the database. |
java.util.List<Set> |
getSetsInChain(int cid)
Return a list of Sets in a
Chain |
java.util.List<SetSize> |
getSetSizesInChain(int cid,
int sid)
Return a list of SetSize for this set that are in this
Chain |
java.util.HashMap<java.lang.String,java.util.Date> |
getSetTimestamps()
Return a hash of the newest filter for each set/size.
|
int[] |
getSizeArray()
Get an array of the number of thumbnail sizes.
|
int |
getSizeCount()
Return the number of sizes that we deal with.
|
java.util.List<java.lang.Integer> |
getSizes()
Get the array of Thumbnail Sizes as a List of Integers.
|
java.util.List<SyncClient> |
getSyncClients() |
java.util.List<SyncServer> |
getSyncServers() |
System |
getSystem()
Fetch a reference to the
System configuration. |
int |
getThumbHeight()
Get the user's preferred
Thumbnail height used when running the editors. |
User |
getUser(int userid)
Get the
User who has this userid. |
java.lang.String |
getUuid(java.lang.String setName,
int size)
Make a uuid String based on a setName and a size
|
int |
getVirginCount()
Return the number of
Virgin s in the database. |
java.util.List<Virgin> |
getVirgins()
Get a List of all of the
Virgin s in the database. |
java.util.List<Virgin> |
getVirgins(int max)
Get a List of all of the
Virgin s in the database up to max number. |
boolean |
isVirgin(java.lang.String picName)
Is this picName a
Virgin ? |
void |
renameSet(java.lang.String oldName,
java.lang.String newName)
Rename this Set.
|
void |
saveSystem(System system)
Flush the
System configuration back to the database. |
void |
setClientSyncTimestamp(java.lang.String host)
Set the last time this client sync'd to now.
|
void |
setDbUrl(java.lang.String dbUrl)
Set the database url.
|
void |
setDbUser(java.lang.String dbUser)
Set the user who is accessing the database.
|
void |
setDEBUG(boolean debugFlag)
Enable logger output on the database
|
void |
setPicManCommonFacade(PicManCommonFacade picManCommonFacade)
Set the callback to the partial main business facade.
|
void |
setRoots(java.util.List<Root> roots)
Set the
Root s in the Database to be this List. |
void |
setSets(java.util.List<Set> sets)
Set the
Set s in the Database to be this List. |
void |
storeChain(Chain chain)
Store this
Chain in the Database. |
void |
storeMetaSet(MetaSet mset)
Store this
MetaSet to the database. |
void |
storeMosaic(Mosaic mosaic)
Store this
Mosaic in the database. |
void |
storeMosaicBatch(MosaicBatch mbatch)
Store this
MosaicBatch es in the database. |
void |
storeMosaicTile(MosaicTile tile)
Store this
MosaicTile in the database. |
void |
storePoster(Poster poster)
Store this
Poster in the database. |
void |
storeRoot(Root root)
Store this existing
Root in the database. |
void |
storeSet(Set set)
Update this existing
Set in the database. |
void |
storeSyncClient(SyncClient syncClient) |
void |
storeSyncServer(SyncServer syncServer) |
void |
storeUser(User user)
Store this
User in the database. |
void |
updateMosaicVectors(MosaicVector mv)
Store this
MosaicVector in the database. |
void |
updatePic(Pic pic)
Update this
Pic in the database. |
void |
updateSetTimestamp(java.lang.String setSize) |
void setDEBUG(boolean debugFlag)
debugFlag
- true == turn on debugging.void setPicManCommonFacade(PicManCommonFacade picManCommonFacade)
picManCommonFacade
- Where the error handler lives.Contact getContact(int cid, java.lang.String name)
Contact
that was built with these parameters.
This does not return an image, just all of the parameters needed to recreate the image.
Such as which Thumbnail appeared at each coordinates.cid
- The Chain
IDname
- The qualified name of this contact. i.e. "Gail-100-02"Contact getContact(int cid, java.lang.String setName, int size, int index)
Contact
that was built with these parameters.
This does not return an image, just all of the parameters needed to recreate the image.
Such as which Thumbnail appeared at each coordinates.Contact getNewestContact()
Contact
made. Basically this tells us
the last time Contacts were made.java.util.HashMap<java.lang.String,java.util.Date> getContactOldestMap(Chain chain)
chain
- Which Chain
to processjava.util.List<Chain> getChains()
Chain
s in the database.int getChainCount()
Chain
s in the Database.DataAccessException
- It broke.Chain getChain(java.lang.String chainName)
Chain
based on its name.chainName
- The name to query.null
if not found.Chain getChain(int cid)
Chain
based on its Chain ID.cid
- The Chain ID to query.null
if not found.void deleteChain(Chain chain)
Chain
from the Database.chain
- The Chain to delete.void storeChain(Chain chain)
Chain
in the Database.chain
- The Chain to write.java.util.List<Set> getSetsInChain(int cid)
Chain
cid
- The Chain to queryjava.util.List<SetSize> getSetSizesInChain(int cid, int sid)
Chain
cid
- The chain idsid
- The Set
idint getFilterCount()
Filter
s in the database.java.util.List<java.lang.String> getFilterColumns()
Filter
column names from the database.java.util.List<Filter> getFilters()
Filter
s in the database.java.util.List<Filter> getFiltersBySet(java.lang.String setName, int size)
Filter
s for this set/size.setName
- The name of the Set to query.size
- The thumbnail size to query.Filter
s that match this queryjava.util.List<java.lang.String> getPicNamesBySet(java.lang.String setName, int size)
Filter
s that match this query.setName
- The name of the Set to querysize
- The thumbnail size to queryjava.util.List<java.lang.String> getPicNamesBySet(Set set, int size)
Filter
s that match this query.set
- The Set to querysize
- The thumbnail size to queryjava.util.List<java.lang.String> getPicNamesBySet(MetaSet set, int size, int rateOp, int rateVal)
Filter
s that match this query.set
- The MetaSet to querysize
- The thumbnail size to queryrateOp
- An index into the MetaSet rateOps table. i.e. NONE, =, !=, <, >.rateVal
- The value to apply with the rateOp against this setjava.util.List<java.lang.String> getPicNamesBySet(Set set, int size, int rateOp, int rateVal)
Filter
s that match this valued query.
This allows to say "mlb < 5".set
- The Set to query.size
- The thumbnail size to query.rateOp
- An index into the MetaSet rateOps table. i.e. NONE, =, !=, <, >.rateVal
- The value to apply with the rateOp against this setjava.util.List<java.lang.String> getPicNamesBySet(java.lang.String setName, int size, int rateOp, int rateVal)
Filter
s that match this valued query.
This allows to say "mlb < 5".setName
- The name of the Set to query.size
- The thumbnail size to query.java.util.List<java.lang.String> getPicNamesByFunc(int func, int size, int rateOp, java.lang.String operand)
Set
for the list of valid function numbers.func
- The Function number to run.size
- The thumb size to run this filter on.rateOp
- An index into the MetaSet rateOps table. i.e. NONE, =, !=, <, >.operand
- A generic operand for the func. i.e. date (-2) takes a date here "2009-07-25"java.util.HashMap<java.lang.String,java.util.Date> getSetTimestamps()
void addFilter(Filter filter)
Filter
to the database, overwriting any existing filter for this pic.filter
- The new (or used) Filter.Filter getFilter(java.lang.String picName)
Filter
for the pic named.picName
- The name of the Pic.FilterMicroSet getPicFromFilterMicroSet(int pid, int sid)
FilterMicroSet
for this pic in this set.pid
- The pid the Pic.sid
- The sid of the set to query.FilterMicroSet
or null if not found.MetaSet getMetaSet(int sid)
MetaSet
that matches this Set ID.sid
- The SetID to query.void storeMetaSet(MetaSet mset)
MetaSet
to the database.mset
- The MetaSet to write.java.util.List<java.lang.String> getMetaSetColumns()
MetaSet
s.MetaSetFilter getMetaSetFilter()
java.util.List<Mosaic> getMosaics()
Mosaic
s in the database.Mosaic getMosaic(int mid)
Mosaic
from the database based on this Mosaic ID.mid
- The Mosaic ID to query.Mosaic getMosaic(java.lang.String masterPic, java.lang.String engine, int sid, int tileHeight)
Mosaic
in the database that matches these parameters.masterPic
- engine
- sid
- tileHeight
- int getMosaicTileCount(int mid)
Mosaic
mid
- The mosaicIdvoid deleteMosaic(int mid)
Mosaic
from the database that has this Mosaic ID.mid
- The Mosaic ID to delete.void storeMosaic(Mosaic mosaic)
Mosaic
in the database.mosaic
- The Mosaic to store.java.util.List<MosaicBatch> getMosaicBatches()
MosaicBatch
es in the database.MosaicBatch getMosaicBatch(int mbid)
mbid
- The MosaicBatch id to query.void storeMosaicBatch(MosaicBatch mbatch)
MosaicBatch
es in the database.mbatch
- The MosaicBatch to storejava.util.List<MosaicTile> getMosaicTiles(int mid)
MosaicTile
s for this Mosaicmid
- The MosaicID to fetchvoid deleteMosaicTiles(int mid)
MosaicTile
s for the Mosaic specified by this Mosaic ID.mid
- The Mosaic ID to delete.void storeMosaicTile(MosaicTile tile)
MosaicTile
in the database.tile
- The MosaicTile to store.void updateMosaicVectors(MosaicVector mv)
MosaicVector
in the database.mv
- The MosaicVector to store.java.util.List<MosaicVector> getMosaicVectors(java.util.List<Pic> picList)
MosaicVector
s that matches this picList, which probably came from a mosaic Set.picList
- The List of Pics to queryMosaicVector
s. The List may be empty, but not null.java.util.List<Poster> getPosters()
Mosaic
s in the database.Poster getPoster(int pid)
Poster
from the database based on this Poster ID.pid
- The Poster ID to query.void deletePoster(int pid)
Poster
from the database that has this Poster ID.pid
- The Poster ID to delete.void storePoster(Poster poster)
Poster
in the database.poster
- The Poster to store.void addPic(Pic pic)
Pic
to the database.pic
- The Pic to add. pid is assumed to be 0.void updatePic(Pic pic)
Pic
in the database.
Pic is assumed to exist and pid must not be 0.pic
- The Pic to update.Pic getPic(java.lang.String picName)
Pic
who's name matches this picName.picName
- The name of the Pic
to query.null
.Pic getPic(int pid)
Pic
who's pid matches this one.pid
- The pid to queryPic getNewestPic()
Pic getRandomPic()
java.util.List<Pic> getPicsByMD5Sum(long md5sum)
md5sum
- java.lang.String getRandomHomePagePicName(User user)
user
- The User
who is requesting the Picjava.util.HashMap<java.lang.String,java.util.Date> getPicsMap()
Pic
names in the database.java.util.List<Pic> getPics(java.lang.String picName)
Pic
s in the database that match this name. Wildcards are supported.picName
- The name (or partial name) of the pics to fetch.Pic
s.java.util.List<Pic> getPics()
java.util.List<Pic> getPics(Set set, int size)
Pic
s for this set at this size.set
- The set to use as a filtersize
- The size to use as a filterjava.util.List<Pic> getPicsInDir(int rid, java.lang.String dirName)
Pic
s that are in this subdirectory.rid
- Root id to search underdirName
- The directory, i.e. "2002/20021225"java.util.List<Pic> getPicsNewerThan(java.util.Calendar calendar)
calendar
- The timestamp to compare againstint getPicMaxThumbCacheDirUsed()
int getPicThumbCacheFillCount(int cacheDir)
cacheDir
- The directory to checkdouble getPicRate(java.lang.String picName, Set set, int size)
picName
- The name of the Pic whose rating we wantset
- The set to do the rating check against.
If a pic is Audrey-7 and we want Carl, then this is probably not one we want.size
- The size of the pic we care aboutdouble getPicRate(java.lang.String picName, MetaSet metaSet, int size)
picName
- The Pic whose rating we wantmetaSet
- The metaSet to do the rating check against.size
- The size of the pic we care aboutjava.util.List<Root> getRoots()
Root
sint getRootCount()
Root
s in the databaseRoot
sRoot getRoot(java.lang.String name)
Root
name
- The Name of the Root to fetchvoid setRoots(java.util.List<Root> roots)
Root
s in the Database to be this List.
I'm not sure why you'd want to do this, and it is unused, but here it is.roots
- A List of Root
svoid addRoot(Root root) throws java.lang.Exception
Root
to the Database.
the Root ID must be 0.root
- The Root to add.java.lang.Exception
- Can't do it.void deleteRoot(Root root) throws java.lang.Exception
Root
from the database.root
- The Root to delete.java.lang.Exception
- Can't do it.void storeRoot(Root root)
Root
in the database.
The Root ID must NOT be 0.root
- The existing Root to update.java.util.List<Root> getInactiveRoots()
Root
s.
Inactive Root
s will not be scanned for new pics, or included in Sets queries.java.util.List<Root> getActiveRoots()
Root
s.java.util.List<Set> getSets()
Set
s in the database.
Note: The Sets are cached in memory. An external app writing to the database will not
be reflected in this running instance.Set
sjava.util.List<Set> getSetsClone()
Set
s in the database.
This is useful for when you want to prune the list without altering the sets cache.Set
sint getSetCount()
Set
s in the Database.Set
sSet getSet(int sid)
Set
that matches this Set IDsid
- The SetID to querySet getSet(java.lang.String setName)
Set
that matches this Set IDsetName
- The name of the Set to queryvoid setSets(java.util.List<Set> sets)
Set
s in the Database to be this List.
I'm not sure why you'd want to do this, and it is unused, but here it is.sets
- A List of Set
svoid addSet(Set set) throws java.lang.Exception
Set
to the database.
The Set ID (sid) is assumed to be 0.set
- The Set to addjava.lang.Exception
- Can't do itvoid deleteSet(Set set) throws java.lang.Exception
Set
from the database.
This is a very bad thing, as new Set IDs are derived from the number of Sets.set
- The Set to delete.java.lang.Exception
- Can't do it.void storeSet(Set set)
Set
in the database.set
- The Set to updatevoid renameSet(java.lang.String oldName, java.lang.String newName)
oldName
- What is this set called?newName
- What do we want it to be called?java.util.List<Set> getInactiveSets()
Set
sSet
s that the User has marked as inactive.java.util.List<Set> getActiveSets()
Set
sSet
s that are NOT marked inactive.int[] getSizeArray()
java.util.List<java.lang.Integer> getSizes()
Filter
s are keyed to the sizes.
A Thumbnail
that looks OK as a 75, might not be worthy of a 300.getSizeArray()
int getSizeCount()
System getSystem()
System
configuration.
Note: This is a cached object and changes made outside of this application will not be picked up.System
.void saveSystem(System system)
System
configuration back to the database.system
- The System to write.int getThumbHeight()
Thumbnail
height used when running the editors.java.util.List<java.lang.String> getPicExtensions()
.png
in here, but basically i've settled on .jpg
. .jpeg
.User getUser(int userid) throws DataAccessException
User
who has this userid.userid
- The userid to query.DataAccessException
void storeUser(User user)
User
in the database. Does not affect the BSAccount settings of this User.user
- The User to save.java.lang.String getUuid(java.lang.String setName, int size)
setName
- The name of the Setsize
- The sizeint getVirginCount()
Virgin
s in the database.java.util.List<Virgin> getVirgins()
Virgin
s in the database.java.util.List<Virgin> getVirgins(int max)
Virgin
s in the database up to max number. max
- The Maximum number of Virgin
s to put in the Listboolean isVirgin(java.lang.String picName)
Virgin
?void addVirgin(java.lang.String picName)
Virgin
in the database.picName
- The name of the Pic to add.void deleteVirgin(java.lang.String picName)
Virgin
s table. This Pic is no longer a Virgin
.picName
- The name of the Pic
to remove.java.util.Date getClientSyncTimestamp(java.lang.String host)
host
- The host to fetchvoid setClientSyncTimestamp(java.lang.String host)
host
- The host to fetchvoid updateSetTimestamp(java.lang.String setSize)
void storeSyncClient(SyncClient syncClient)
java.util.List<SyncClient> getSyncClients()
void storeSyncServer(SyncServer syncServer)
java.util.List<SyncServer> getSyncServers()
void setDbUser(java.lang.String dbUser)
dbUser
- The database userjava.lang.String getDbUser()
void setDbUrl(java.lang.String dbUrl)
dbUrl
- The dbUrl to set.java.lang.String getDbUrl()