public class DatabaseImpl extends java.lang.Object implements DatabaseFacade, SetChangedListener
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| 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 r)
Add this
Root to the Database. |
void |
addSet(Set s)
Add a new set to the database.
|
void |
addVirgin(java.lang.String pic)
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 s)
Delete this set from the database.
|
void |
deleteVirgin(java.lang.String pic)
Delete this Pic name from the
Virgins table. |
java.util.List<Root> |
getActiveRoots()
Get a List of active
Roots. |
java.util.List<Set> |
getActiveSets()
Build 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. |
ChainsDao |
getChainsDao()
Why is this public? Because Spring was freaking out trying to reflect the type.
|
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 item)
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 set,
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()
Build a list of inactive sets
|
MetaSet |
getMetaSet(int sid)
MetaSet Management
|
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()
System Management
|
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 pic)
Is this picName a
Virgin? |
int |
normalizeSize(int size)
Given an arbitrary tile height, return a height that we actually know about.
|
void |
onSetChanged(SetSize setSize)
This set/size has changed.
|
void |
renameSet(java.lang.String oldName,
java.lang.String newName)
Rename this Set.
|
void |
saveSystem(System sys)
Flush the
System configuration back to the database. |
void |
setChainsDao(ChainsDao chainsDao)
AOP setter for the ChainsDao
|
void |
setClientSyncTimestamp(java.lang.String host)
Set the last time this client sync'd to now.
|
void |
setContactsDao(ContactsDao contactsDao)
AOP setter for the ContactsDao
|
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 |
setFiltersDao(FiltersDao filtersDao)
AOP setter for the FiltersDao
|
void |
setFiltersMicroSetsDao(FiltersMicroSetsDao filtersMicroSetsDao)
AOP setter for the FiltersMicroSetsDao
|
void |
setMetaSetsDao(MetaSetsDao metaSetsDao)
AOP setter for the MetaSetsDao
|
void |
setMosaicBatchesDao(MosaicBatchesDao mosaicBatchesDao)
AOP setter for the MosaicsDao
|
void |
setMosaicsDao(MosaicsDao mosaicsDao)
AOP setter for the MosaicsDao
|
void |
setMosaicTilesDao(MosaicTilesDao mosaicTilesDao)
AOP setter for the MosaicTilesDao
|
void |
setMosaicVectorsDao(MosaicVectorsDao mosaicVectorsDao)
AOP setter for the MosaicVectorsDao
|
void |
setPicManCommonFacade(PicManCommonFacade picManCommonFacade)
Set the callback to the partial main business facade.
|
void |
setPicsDao(PicsDao picsDao)
AOP setter for the PicsDao
|
void |
setPostersDao(PostersDao postersDao)
AOP setter for the PostersDao
|
void |
setRoots(java.util.List<Root> roots)
Set the
Roots in the Database to be this List. |
void |
setRootsDao(RootsDao rootsDao)
AOP setter for the RootsDao
|
void |
setServer_SyncDao(Server_SyncDao server_SyncDao)
AOP setter for the Server's SyncDao
|
void |
setSets(java.util.List<Set> sets)
Set the
Sets in the Database to be this List. |
void |
setSetsDao(SetsDao setsDao)
AOP setter for the SetsDao
|
void |
setSetTimestampsDao(SetTimestampsDao setTimestampsDao)
AOP setter for the SetTimestampsDao
|
void |
setSystemDao(SystemDao systemDao)
AOP setter for the SystemDao
|
void |
setUsersDao(UsersDao usersDao)
AOP setter for the UsersDao
|
void |
setVirginsDao(VirginsDao virginsDao)
AOP setter for the VirginsDao
|
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)
Store an existing set to 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) |
public void setPicManCommonFacade(PicManCommonFacade picManCommonFacade)
DatabaseFacadesetPicManCommonFacade in interface DatabaseFacadepicManCommonFacade - Where the error handler lives.public void setDEBUG(boolean debugFlag)
DatabaseFacadesetDEBUG in interface DatabaseFacadedebugFlag - true == turn on debugging.public void setChainsDao(ChainsDao chainsDao)
chainsDao - The ChainsDao from the Spring Database Setuppublic void setContactsDao(ContactsDao contactsDao)
contactsDao - The ContactsDao from the Spring Database Setuppublic void setFiltersDao(FiltersDao filtersDao)
filtersDao - The FiltersDao from the Spring Database Setuppublic void setFiltersMicroSetsDao(FiltersMicroSetsDao filtersMicroSetsDao)
filtersMicroSetsDao - The FiltersMicroSetsDao from the Spring Database Setuppublic void setMetaSetsDao(MetaSetsDao metaSetsDao)
metaSetsDao - The MetaSetsDao from the Spring Database Setuppublic void setMosaicTilesDao(MosaicTilesDao mosaicTilesDao)
mosaicTilesDao - The MosaicTilesDao from the Spring Database Setuppublic void setMosaicsDao(MosaicsDao mosaicsDao)
mosaicsDao - The MosaicsDao from the Spring Database Setuppublic void setMosaicBatchesDao(MosaicBatchesDao mosaicBatchesDao)
mosaicBatchesDao - The MosaicsBatchDao from the Spring Database Setuppublic void setMosaicVectorsDao(MosaicVectorsDao mosaicVectorsDao)
mosaicVectorsDao - The MosaicVectorsDao from the Spring Database Setuppublic void setPicsDao(PicsDao picsDao)
picsDao - The PicsDao from the Spring Database Setuppublic void setPostersDao(PostersDao postersDao)
postersDao - The PostersDao from the Spring Database Setuppublic void setRootsDao(RootsDao rootsDao)
rootsDao - The RootsDao from the Spring Database Setuppublic void setServer_SyncDao(Server_SyncDao server_SyncDao)
server_SyncDao - The Server_SyncDao from the Spring Database Setuppublic void setSystemDao(SystemDao systemDao)
systemDao - The SystemDao from the Spring Database Setuppublic void setSetsDao(SetsDao setsDao)
setsDao - The SetsDao from the Spring Database Setuppublic void setSetTimestampsDao(SetTimestampsDao setTimestampsDao)
setTimestampsDao - The SetTimestampsDao from the Spring Database Setuppublic void setUsersDao(UsersDao usersDao)
usersDao - The UsersDao from the Spring Database Setuppublic void setVirginsDao(VirginsDao virginsDao)
virginsDao - The VirginsDao from the Spring Database Setuppublic ChainsDao getChainsDao()
public void setDbUser(java.lang.String dbUser)
DatabaseFacadesetDbUser in interface DatabaseFacadedbUser - The database userpublic java.lang.String getDbUser()
DatabaseFacadegetDbUser in interface DatabaseFacadepublic void setDbUrl(java.lang.String dbUrl)
DatabaseFacadesetDbUrl in interface DatabaseFacadedbUrl - The dbUrl to set.public java.lang.String getDbUrl()
DatabaseFacadegetDbUrl in interface DatabaseFacadepublic System getSystem()
getSystem in interface DatabaseFacadeSystem.public void saveSystem(System sys)
DatabaseFacadeSystem configuration back to the database.saveSystem in interface DatabaseFacadesys - The System to write.public java.util.List<java.lang.String> getPicExtensions()
DatabaseFacade.png in here, but basically i've settled on .jpg. .jpeg.getPicExtensions in interface DatabaseFacadepublic int getThumbHeight()
DatabaseFacadeThumbnail height used when running the editors.getThumbHeight in interface DatabaseFacadepublic java.util.List<Root> getRoots()
DatabaseFacadeRootsgetRoots in interface DatabaseFacadepublic int getRootCount()
DatabaseFacadeRoots in the databasegetRootCount in interface DatabaseFacadeRootspublic Root getRoot(int rid)
DatabaseFacadeRootgetRoot in interface DatabaseFacaderid - The rootId to matchpublic Root getRoot(java.lang.String name)
DatabaseFacadeRootgetRoot in interface DatabaseFacadename - The Name of the Root to fetchpublic void setRoots(java.util.List<Root> roots)
DatabaseFacadeRoots 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.setRoots in interface DatabaseFacaderoots - A List of Rootspublic void addRoot(Root r)
DatabaseFacadeRoot to the Database.
the Root ID must be 0.addRoot in interface DatabaseFacader - The Root to add.public void storeRoot(Root root)
DatabaseFacadeRoot in the database.
The Root ID must NOT be 0.storeRoot in interface DatabaseFacaderoot - The existing Root to update.public void deleteRoot(Root root)
DatabaseFacadeRoot from the database.deleteRoot in interface DatabaseFacaderoot - The Root to delete.public java.util.List<Root> getInactiveRoots()
DatabaseFacadeRoots.
Inactive Roots will not be scanned for new pics, or included in Sets queries.getInactiveRoots in interface DatabaseFacadepublic java.util.List<Root> getActiveRoots()
DatabaseFacadeRoots.getActiveRoots in interface DatabaseFacadepublic java.util.List<Set> getSets()
DatabaseFacadeSets 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.getSets in interface DatabaseFacadeSetspublic java.util.List<Set> getSetsClone()
DatabaseFacadeSets in the database.
This is useful for when you want to prune the list without altering the sets cache.getSetsClone in interface DatabaseFacadeSetspublic int getSetCount()
DatabaseFacadeSets in the Database.getSetCount in interface DatabaseFacadeSetspublic Set getSet(int sid)
DatabaseFacadeSet that matches this Set IDgetSet in interface DatabaseFacadesid - The SetID to querypublic Set getSet(java.lang.String setName)
DatabaseFacadeSet that matches this Set IDgetSet in interface DatabaseFacadesetName - The name of the Set to querypublic void setSets(java.util.List<Set> sets)
DatabaseFacadeSets 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.setSets in interface DatabaseFacadesets - A List of Setspublic void addSet(Set s)
addSet in interface DatabaseFacades - The Set to add. The sid should be 0.public void storeSet(Set set)
storeSet in interface DatabaseFacadeset - The set to store. The sid should NOT be 0.public void deleteSet(Set s)
deleteSet in interface DatabaseFacades - The set to delete.public void renameSet(java.lang.String oldName,
java.lang.String newName)
DatabaseFacaderenameSet in interface DatabaseFacadeoldName - What is this set called?newName - What do we want it to be called?public java.util.List<Set> getInactiveSets()
getInactiveSets in interface DatabaseFacadepublic java.util.List<Set> getActiveSets()
getActiveSets in interface DatabaseFacadepublic MetaSet getMetaSet(int sid)
getMetaSet in interface DatabaseFacadesid - The SetID to query.public void storeMetaSet(MetaSet mset)
DatabaseFacadeMetaSet to the database.storeMetaSet in interface DatabaseFacademset - The MetaSet to write.public java.util.List<java.lang.String> getMetaSetColumns()
getMetaSetColumns in interface DatabaseFacadepublic MetaSetFilter getMetaSetFilter()
DatabaseFacadegetMetaSetFilter in interface DatabaseFacadepublic Mosaic getMosaic(int mid)
DatabaseFacadeMosaic from the database based on this Mosaic ID.getMosaic in interface DatabaseFacademid - The Mosaic ID to query.public Mosaic getMosaic(java.lang.String masterPic, java.lang.String engine, int sid, int tileHeight)
DatabaseFacadeMosaic in the database that matches these parameters.getMosaic in interface DatabaseFacadepublic int getMosaicTileCount(int mid)
DatabaseFacadeMosaicgetMosaicTileCount in interface DatabaseFacademid - The mosaicIdpublic java.util.List<Mosaic> getMosaics()
DatabaseFacadeMosaics in the database.getMosaics in interface DatabaseFacadepublic void storeMosaic(Mosaic mosaic)
DatabaseFacadeMosaic in the database.storeMosaic in interface DatabaseFacademosaic - The Mosaic to store.public void deleteMosaic(int mid)
DatabaseFacadeMosaic from the database that has this Mosaic ID.deleteMosaic in interface DatabaseFacademid - The Mosaic ID to delete.public MosaicBatch getMosaicBatch(int mbid)
DatabaseFacadegetMosaicBatch in interface DatabaseFacadembid - The MosaicBatch id to query.public java.util.List<MosaicBatch> getMosaicBatches()
DatabaseFacadeMosaicBatches in the database.getMosaicBatches in interface DatabaseFacadepublic void storeMosaicBatch(MosaicBatch mbatch)
DatabaseFacadeMosaicBatches in the database.storeMosaicBatch in interface DatabaseFacadembatch - The MosaicBatch to storepublic void deleteMosaicTiles(int mid)
DatabaseFacadeMosaicTiles for the Mosaic specified by this Mosaic ID.deleteMosaicTiles in interface DatabaseFacademid - The Mosaic ID to delete.public java.util.List<MosaicTile> getMosaicTiles(int mid)
DatabaseFacadeMosaicTiles for this MosaicgetMosaicTiles in interface DatabaseFacademid - The MosaicID to fetchpublic void storeMosaicTile(MosaicTile tile)
DatabaseFacadeMosaicTile in the database.storeMosaicTile in interface DatabaseFacadetile - The MosaicTile to store.public void updateMosaicVectors(MosaicVector mv)
DatabaseFacadeMosaicVector in the database.updateMosaicVectors in interface DatabaseFacademv - The MosaicVector to store.public java.util.List<MosaicVector> getMosaicVectors(java.util.List<Pic> picList)
DatabaseFacadeMosaicVectors that matches this picList, which probably came from a mosaic Set.getMosaicVectors in interface DatabaseFacadepicList - The List of Pics to queryMosaicVectors. The List may be empty, but not null.public Poster getPoster(int pid)
DatabaseFacadePoster from the database based on this Poster ID.getPoster in interface DatabaseFacadepid - The Poster ID to query.public java.util.List<Poster> getPosters()
DatabaseFacadeMosaics in the database.getPosters in interface DatabaseFacadepublic void storePoster(Poster poster)
DatabaseFacadePoster in the database.storePoster in interface DatabaseFacadeposter - The Poster to store.public void deletePoster(int pid)
DatabaseFacadePoster from the database that has this Poster ID.deletePoster in interface DatabaseFacadepid - The Poster ID to delete.public java.util.List<java.lang.Integer> getSizes()
DatabaseFacadeFilters are keyed to the sizes.
A Thumbnail that looks OK as a 75, might not be worthy of a 300.getSizes in interface DatabaseFacadeDatabaseFacade.getSizeArray()public int[] getSizeArray()
DatabaseFacadegetSizeArray in interface DatabaseFacadepublic int getSizeCount()
DatabaseFacadegetSizeCount in interface DatabaseFacadepublic java.util.List<Chain> getChains()
DatabaseFacadeChains in the database.getChains in interface DatabaseFacadepublic int getChainCount()
DatabaseFacadeChains in the Database.getChainCount in interface DatabaseFacadepublic Chain getChain(java.lang.String chainName)
DatabaseFacadeChain based on its name.getChain in interface DatabaseFacadechainName - The name to query.null if not found.public Chain getChain(int cid)
DatabaseFacadeChain based on its Chain ID.getChain in interface DatabaseFacadecid - The Chain ID to query.null if not found.public void storeChain(Chain chain)
DatabaseFacadeChain in the Database.storeChain in interface DatabaseFacadechain - The Chain to write.public void deleteChain(Chain chain)
DatabaseFacadeChain from the Database.deleteChain in interface DatabaseFacadechain - The Chain to delete.public java.util.List<Set> getSetsInChain(int cid)
DatabaseFacadeChaingetSetsInChain in interface DatabaseFacadecid - The Chain to querypublic java.util.List<SetSize> getSetSizesInChain(int cid, int sid)
DatabaseFacadeChaingetSetSizesInChain in interface DatabaseFacadecid - The chain idsid - The Set idpublic Contact getContact(int cid, java.lang.String name)
DatabaseFacadeContact 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.getContact in interface DatabaseFacadecid - The Chain IDname - The qualified name of this contact. i.e. "Gail-100-02"public Contact getContact(int cid, java.lang.String setName, int size, int item)
DatabaseFacadeContact 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.getContact in interface DatabaseFacadecid - The Chain IDsetName - The name of the Set that was usedsize - The Thumbnail sizeitem - Which of this series of contactspublic void addContact(Contact c)
DatabaseFacadeContact to the database.addContact in interface DatabaseFacadec - The Contactpublic Contact getNewestContact()
DatabaseFacadeContact made. Basically this tells us
the last time Contacts were made.getNewestContact in interface DatabaseFacadepublic java.util.HashMap<java.lang.String,java.util.Date> getContactOldestMap(Chain chain)
DatabaseFacadegetContactOldestMap in interface DatabaseFacadechain - Which Chain to processpublic int getFilterCount()
DatabaseFacadeFilters in the database.getFilterCount in interface DatabaseFacadepublic java.util.List<java.lang.String> getFilterColumns()
DatabaseFacadeFilter column names from the database.getFilterColumns in interface DatabaseFacadepublic java.util.List<Filter> getFilters()
DatabaseFacadeFilters in the database.getFilters in interface DatabaseFacadepublic java.util.List<Filter> getFiltersBySet(java.lang.String set, int size)
DatabaseFacadeFilters for this set/size.getFiltersBySet in interface DatabaseFacadeset - The name of the Set to query.size - The thumbnail size to query.Filters that match this querypublic java.util.List<java.lang.String> getPicNamesBySet(java.lang.String setName,
int size)
DatabaseFacadeFilters that match this query.getPicNamesBySet in interface DatabaseFacadesetName - The name of the Set to querysize - The thumbnail size to querypublic java.util.List<java.lang.String> getPicNamesBySet(Set set, int size)
DatabaseFacadeFilters that match this query.getPicNamesBySet in interface DatabaseFacadeset - The Set to querysize - The thumbnail size to querypublic java.util.List<java.lang.String> getPicNamesBySet(MetaSet set, int size, int rateOp, int rateVal)
DatabaseFacadeFilters that match this query.getPicNamesBySet in interface DatabaseFacadeset - 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 setpublic java.util.List<java.lang.String> getPicNamesBySet(java.lang.String setName,
int size,
int rateOp,
int rateVal)
DatabaseFacadeFilters that match this valued query.
This allows to say "mlb < 5".getPicNamesBySet in interface DatabaseFacadesetName - The name of the Set to query.size - The thumbnail size to query.public java.util.List<java.lang.String> getPicNamesBySet(Set set, int size, int rateOp, int rateVal)
DatabaseFacadeFilters that match this valued query.
This allows to say "mlb < 5".getPicNamesBySet in interface DatabaseFacadeset - 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 setpublic java.util.List<java.lang.String> getPicNamesByFunc(int func,
int size,
int rateOp,
java.lang.String operand)
DatabaseFacadeSet for the list of valid function numbers.getPicNamesByFunc in interface DatabaseFacadefunc - 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"public java.util.HashMap<java.lang.String,java.util.Date> getSetTimestamps()
DatabaseFacadegetSetTimestamps in interface DatabaseFacadepublic void addFilter(Filter filter)
DatabaseFacadeFilter to the database, overwriting any existing filter for this pic.addFilter in interface DatabaseFacadefilter - The new (or used) Filter.public Filter getFilter(java.lang.String picName)
DatabaseFacadeFilter for the pic named.getFilter in interface DatabaseFacadepicName - The name of the Pic.public FilterMicroSet getPicFromFilterMicroSet(int pid, int sid)
DatabaseFacadeFilterMicroSet for this pic in this set.getPicFromFilterMicroSet in interface DatabaseFacadepid - The pid the Pic.sid - The sid of the set to query.FilterMicroSet or null if not found.public User getUser(int userid) throws DataAccessException
DatabaseFacadeUser who has this userid.getUser in interface DatabaseFacadeuserid - The userid to query.DataAccessExceptionpublic void storeUser(User user)
DatabaseFacadeUser in the database. Does not affect the BSAccount settings of this User.storeUser in interface DatabaseFacadeuser - The User to save.public java.util.List<Virgin> getVirgins()
DatabaseFacadeVirgins in the database.getVirgins in interface DatabaseFacadepublic java.util.List<Virgin> getVirgins(int max)
DatabaseFacadeVirgins in the database up to max number. getVirgins in interface DatabaseFacademax - The Maximum number of Virgins to put in the Listpublic boolean isVirgin(java.lang.String pic)
DatabaseFacadeVirgin?isVirgin in interface DatabaseFacadepic - The name of the Pic to queryVirgins table.public void addVirgin(java.lang.String pic)
DatabaseFacadeVirgin in the database.addVirgin in interface DatabaseFacadepic - The name of the Pic to add.public void deleteVirgin(java.lang.String pic)
DatabaseFacadeVirgins table. This Pic is no longer a Virgin.deleteVirgin in interface DatabaseFacadepic - The name of the Pic to remove.public int getVirginCount()
DatabaseFacadeVirgins in the database.getVirginCount in interface DatabaseFacadepublic void addPic(Pic pic)
DatabaseFacadePic to the database.addPic in interface DatabaseFacadepic - The Pic to add. pid is assumed to be 0.public void updatePic(Pic pic)
DatabaseFacadePic in the database.
Pic is assumed to exist and pid must not be 0.updatePic in interface DatabaseFacadepic - The Pic to update.public Pic getPic(java.lang.String picName)
DatabaseFacadePic who's name matches this picName.getPic in interface DatabaseFacadepicName - The name of the Pic to query.null.public Pic getPic(int pid)
DatabaseFacadePic who's pid matches this one.getPic in interface DatabaseFacadepid - The pid to querypublic Pic getNewestPic()
DatabaseFacadegetNewestPic in interface DatabaseFacadepublic Pic getRandomPic()
DatabaseFacadegetRandomPic in interface DatabaseFacadepublic java.util.List<Pic> getPicsByMD5Sum(long md5sum)
DatabaseFacadegetPicsByMD5Sum in interface DatabaseFacadepublic java.lang.String getRandomHomePagePicName(User user)
DatabaseFacadegetRandomHomePagePicName in interface DatabaseFacadeuser - The User who is requesting the Picpublic void onSetChanged(SetSize setSize)
SetChangedListeneronSetChanged in interface SetChangedListenersetSize - The Set/Size that changed.public java.util.HashMap<java.lang.String,java.util.Date> getPicsMap()
DatabaseFacadePic names in the database.getPicsMap in interface DatabaseFacadepublic java.util.List<Pic> getPics()
DatabaseFacadegetPics in interface DatabaseFacadepublic java.util.List<Pic> getPics(java.lang.String picName)
DatabaseFacadePics in the database that match this name. Wildcards are supported.getPics in interface DatabaseFacadepicName - The name (or partial name) of the pics to fetch.Pics.public java.util.List<Pic> getPics(Set set, int size)
DatabaseFacadePics for this set at this size.getPics in interface DatabaseFacadeset - The set to use as a filtersize - The size to use as a filterpublic java.util.List<Pic> getPicsInDir(int rid, java.lang.String dirName)
DatabaseFacadePics that are in this subdirectory.getPicsInDir in interface DatabaseFacaderid - Root id to search underdirName - The directory, i.e. "2002/20021225"public java.util.List<Pic> getPicsNewerThan(java.util.Calendar calendar)
DatabaseFacadegetPicsNewerThan in interface DatabaseFacadecalendar - The timestamp to compare againstpublic double getPicRate(java.lang.String picName,
Set set,
int size)
DatabaseFacadegetPicRate in interface DatabaseFacadepicName - 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 aboutpublic double getPicRate(java.lang.String picName,
MetaSet metaSet,
int size)
DatabaseFacadegetPicRate in interface DatabaseFacadepicName - The Pic whose rating we wantmetaSet - The metaSet to do the rating check against.size - The size of the pic we care aboutpublic int getPicMaxThumbCacheDirUsed()
DatabaseFacadegetPicMaxThumbCacheDirUsed in interface DatabaseFacadepublic int getPicThumbCacheFillCount(int cacheDir)
DatabaseFacadegetPicThumbCacheFillCount in interface DatabaseFacadecacheDir - The directory to checkpublic java.lang.String getUuid(java.lang.String setName,
int size)
DatabaseFacadegetUuid in interface DatabaseFacadesetName - The name of the Setsize - The sizepublic int normalizeSize(int size)
size - The size to normalizepublic java.util.Date getClientSyncTimestamp(java.lang.String host)
DatabaseFacadegetClientSyncTimestamp in interface DatabaseFacadehost - The host to fetchpublic void setClientSyncTimestamp(java.lang.String host)
DatabaseFacadesetClientSyncTimestamp in interface DatabaseFacadehost - The host to fetchpublic void updateSetTimestamp(java.lang.String setSize)
updateSetTimestamp in interface DatabaseFacadepublic void storeSyncClient(SyncClient syncClient)
storeSyncClient in interface DatabaseFacadepublic java.util.List<SyncClient> getSyncClients()
getSyncClients in interface DatabaseFacadepublic void storeSyncServer(SyncServer syncServer)
storeSyncServer in interface DatabaseFacadepublic java.util.List<SyncServer> getSyncServers()
getSyncServers in interface DatabaseFacade