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
MosaicTiles 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
Virgins table. |
java.util.List<Root> |
getActiveRoots()
Get a List of active
Roots. |
java.util.List<Set> |
getActiveSets()
Get a List of active
Sets |
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
Chains in the Database. |
java.util.List<Chain> |
getChains()
Get a List of all of the
Chains 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
Filters in the database. |
java.util.List<Filter> |
getFilters()
Get a list of all of the
Filters in the database. |
java.util.List<Filter> |
getFiltersBySet(java.lang.String setName,
int size)
Get a list of all of the
Filters for this set/size. |
java.util.List<Root> |
getInactiveRoots()
Get a List of Inactive
Roots. |
java.util.List<Set> |
getInactiveSets()
Get a List of inactive
Sets |
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
MetaSets. |
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
MosaicBatches in the database. |
java.util.List<Mosaic> |
getMosaics()
Get a List of all of the
Mosaics 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
MosaicTiles for this Mosaic |
java.util.List<MosaicVector> |
getMosaicVectors(java.util.List<Pic> picList)
Get the List of
MosaicVectors 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
Filters that match this query. |
java.util.List<java.lang.String> |
getPicNamesBySet(Set set,
int size)
Get a List of the Pic Names of the
Filters 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
Filters 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
Filters 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
Filters 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
Pics for this set at this size. |
java.util.List<Pic> |
getPics(java.lang.String picName)
Get a List of all of the
Pics 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
Pics 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
Mosaics 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
Roots in the database |
java.util.List<Root> |
getRoots()
Get a List of all of the
Roots |
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
Sets in the Database. |
java.util.List<Set> |
getSets()
Get a List of all of the
Sets in the database. |
java.util.List<Set> |
getSetsClone()
Get a cloned List of all of the
Sets 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
Virgins in the database. |
java.util.List<Virgin> |
getVirgins()
Get a List of all of the
Virgins in the database. |
java.util.List<Virgin> |
getVirgins(int max)
Get a List of all of the
Virgins 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
Roots in the Database to be this List. |
void |
setSets(java.util.List<Set> sets)
Set the
Sets 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
MosaicBatches 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()
Chains in the database.int getChainCount()
Chains 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)
Chaincid - The Chain to queryjava.util.List<SetSize> getSetSizesInChain(int cid, int sid)
Chaincid - The chain idsid - The Set idint getFilterCount()
Filters in the database.java.util.List<java.lang.String> getFilterColumns()
Filter column names from the database.java.util.List<Filter> getFilters()
Filters in the database.java.util.List<Filter> getFiltersBySet(java.lang.String setName, int size)
Filters for this set/size.setName - The name of the Set to query.size - The thumbnail size to query.Filters that match this queryjava.util.List<java.lang.String> getPicNamesBySet(java.lang.String setName,
int size)
Filters 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)
Filters 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)
Filters 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)
Filters 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)
Filters 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()
MetaSets.MetaSetFilter getMetaSetFilter()
java.util.List<Mosaic> getMosaics()
Mosaics 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)
Mosaicmid - 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()
MosaicBatches in the database.MosaicBatch getMosaicBatch(int mbid)
mbid - The MosaicBatch id to query.void storeMosaicBatch(MosaicBatch mbatch)
MosaicBatches in the database.mbatch - The MosaicBatch to storejava.util.List<MosaicTile> getMosaicTiles(int mid)
MosaicTiles for this Mosaicmid - The MosaicID to fetchvoid deleteMosaicTiles(int mid)
MosaicTiles 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)
MosaicVectors that matches this picList, which probably came from a mosaic Set.picList - The List of Pics to queryMosaicVectors. The List may be empty, but not null.java.util.List<Poster> getPosters()
Mosaics 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)
Pics in the database that match this name. Wildcards are supported.picName - The name (or partial name) of the pics to fetch.Pics.java.util.List<Pic> getPics()
java.util.List<Pic> getPics(Set set, int size)
Pics 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)
Pics 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()
Rootsint getRootCount()
Roots in the databaseRootsRoot getRoot(java.lang.String name)
Rootname - The Name of the Root to fetchvoid setRoots(java.util.List<Root> roots)
Roots 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 Rootsvoid 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()
Roots.
Inactive Roots will not be scanned for new pics, or included in Sets queries.java.util.List<Root> getActiveRoots()
Roots.java.util.List<Set> getSets()
Sets 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.Setsjava.util.List<Set> getSetsClone()
Sets in the database.
This is useful for when you want to prune the list without altering the sets cache.Setsint getSetCount()
Sets in the Database.SetsSet 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)
Sets 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 Setsvoid 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()
SetsSets that the User has marked as inactive.java.util.List<Set> getActiveSets()
SetsSets that are NOT marked inactive.int[] getSizeArray()
java.util.List<java.lang.Integer> getSizes()
Filters 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.DataAccessExceptionvoid 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()
Virgins in the database.java.util.List<Virgin> getVirgins()
Virgins in the database.java.util.List<Virgin> getVirgins(int max)
Virgins in the database up to max number. max - The Maximum number of Virgins 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)
Virgins 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()