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
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 s)
Delete this set from the database.
|
void |
deleteVirgin(java.lang.String pic)
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()
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
Chain s in the Database. |
java.util.List<Chain> |
getChains()
Get a List of all of the
Chain s 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
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 set,
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()
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
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()
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
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 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
Root s 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
Set s 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
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)
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)
DatabaseFacade
setPicManCommonFacade
in interface DatabaseFacade
picManCommonFacade
- Where the error handler lives.public void setDEBUG(boolean debugFlag)
DatabaseFacade
setDEBUG
in interface DatabaseFacade
debugFlag
- 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)
DatabaseFacade
setDbUser
in interface DatabaseFacade
dbUser
- The database userpublic java.lang.String getDbUser()
DatabaseFacade
getDbUser
in interface DatabaseFacade
public void setDbUrl(java.lang.String dbUrl)
DatabaseFacade
setDbUrl
in interface DatabaseFacade
dbUrl
- The dbUrl to set.public java.lang.String getDbUrl()
DatabaseFacade
getDbUrl
in interface DatabaseFacade
public System getSystem()
getSystem
in interface DatabaseFacade
System
.public void saveSystem(System sys)
DatabaseFacade
System
configuration back to the database.saveSystem
in interface DatabaseFacade
sys
- 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 DatabaseFacade
public int getThumbHeight()
DatabaseFacade
Thumbnail
height used when running the editors.getThumbHeight
in interface DatabaseFacade
public java.util.List<Root> getRoots()
DatabaseFacade
Root
sgetRoots
in interface DatabaseFacade
public int getRootCount()
DatabaseFacade
Root
s in the databasegetRootCount
in interface DatabaseFacade
Root
spublic Root getRoot(int rid)
DatabaseFacade
Root
getRoot
in interface DatabaseFacade
rid
- The rootId to matchpublic Root getRoot(java.lang.String name)
DatabaseFacade
Root
getRoot
in interface DatabaseFacade
name
- The Name of the Root to fetchpublic void setRoots(java.util.List<Root> roots)
DatabaseFacade
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.setRoots
in interface DatabaseFacade
roots
- A List of Root
spublic void addRoot(Root r)
DatabaseFacade
Root
to the Database.
the Root ID must be 0.addRoot
in interface DatabaseFacade
r
- The Root to add.public void storeRoot(Root root)
DatabaseFacade
Root
in the database.
The Root ID must NOT be 0.storeRoot
in interface DatabaseFacade
root
- The existing Root to update.public void deleteRoot(Root root)
DatabaseFacade
Root
from the database.deleteRoot
in interface DatabaseFacade
root
- The Root to delete.public java.util.List<Root> getInactiveRoots()
DatabaseFacade
Root
s.
Inactive Root
s will not be scanned for new pics, or included in Sets queries.getInactiveRoots
in interface DatabaseFacade
public java.util.List<Root> getActiveRoots()
DatabaseFacade
Root
s.getActiveRoots
in interface DatabaseFacade
public java.util.List<Set> getSets()
DatabaseFacade
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.getSets
in interface DatabaseFacade
Set
spublic java.util.List<Set> getSetsClone()
DatabaseFacade
Set
s in the database.
This is useful for when you want to prune the list without altering the sets cache.getSetsClone
in interface DatabaseFacade
Set
spublic int getSetCount()
DatabaseFacade
Set
s in the Database.getSetCount
in interface DatabaseFacade
Set
spublic Set getSet(int sid)
DatabaseFacade
Set
that matches this Set IDgetSet
in interface DatabaseFacade
sid
- The SetID to querypublic Set getSet(java.lang.String setName)
DatabaseFacade
Set
that matches this Set IDgetSet
in interface DatabaseFacade
setName
- The name of the Set to querypublic void setSets(java.util.List<Set> sets)
DatabaseFacade
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.setSets
in interface DatabaseFacade
sets
- A List of Set
spublic void addSet(Set s)
addSet
in interface DatabaseFacade
s
- The Set to add. The sid should be 0.public void storeSet(Set set)
storeSet
in interface DatabaseFacade
set
- The set to store. The sid should NOT be 0.public void deleteSet(Set s)
deleteSet
in interface DatabaseFacade
s
- The set to delete.public void renameSet(java.lang.String oldName, java.lang.String newName)
DatabaseFacade
renameSet
in interface DatabaseFacade
oldName
- What is this set called?newName
- What do we want it to be called?public java.util.List<Set> getInactiveSets()
getInactiveSets
in interface DatabaseFacade
public java.util.List<Set> getActiveSets()
getActiveSets
in interface DatabaseFacade
public MetaSet getMetaSet(int sid)
getMetaSet
in interface DatabaseFacade
sid
- The SetID to query.public void storeMetaSet(MetaSet mset)
DatabaseFacade
MetaSet
to the database.storeMetaSet
in interface DatabaseFacade
mset
- The MetaSet to write.public java.util.List<java.lang.String> getMetaSetColumns()
getMetaSetColumns
in interface DatabaseFacade
public MetaSetFilter getMetaSetFilter()
DatabaseFacade
getMetaSetFilter
in interface DatabaseFacade
public Mosaic getMosaic(int mid)
DatabaseFacade
Mosaic
from the database based on this Mosaic ID.getMosaic
in interface DatabaseFacade
mid
- The Mosaic ID to query.public Mosaic getMosaic(java.lang.String masterPic, java.lang.String engine, int sid, int tileHeight)
DatabaseFacade
Mosaic
in the database that matches these parameters.getMosaic
in interface DatabaseFacade
public int getMosaicTileCount(int mid)
DatabaseFacade
Mosaic
getMosaicTileCount
in interface DatabaseFacade
mid
- The mosaicIdpublic java.util.List<Mosaic> getMosaics()
DatabaseFacade
Mosaic
s in the database.getMosaics
in interface DatabaseFacade
public void storeMosaic(Mosaic mosaic)
DatabaseFacade
Mosaic
in the database.storeMosaic
in interface DatabaseFacade
mosaic
- The Mosaic to store.public void deleteMosaic(int mid)
DatabaseFacade
Mosaic
from the database that has this Mosaic ID.deleteMosaic
in interface DatabaseFacade
mid
- The Mosaic ID to delete.public MosaicBatch getMosaicBatch(int mbid)
DatabaseFacade
getMosaicBatch
in interface DatabaseFacade
mbid
- The MosaicBatch id to query.public java.util.List<MosaicBatch> getMosaicBatches()
DatabaseFacade
MosaicBatch
es in the database.getMosaicBatches
in interface DatabaseFacade
public void storeMosaicBatch(MosaicBatch mbatch)
DatabaseFacade
MosaicBatch
es in the database.storeMosaicBatch
in interface DatabaseFacade
mbatch
- The MosaicBatch to storepublic void deleteMosaicTiles(int mid)
DatabaseFacade
MosaicTile
s for the Mosaic specified by this Mosaic ID.deleteMosaicTiles
in interface DatabaseFacade
mid
- The Mosaic ID to delete.public java.util.List<MosaicTile> getMosaicTiles(int mid)
DatabaseFacade
MosaicTile
s for this MosaicgetMosaicTiles
in interface DatabaseFacade
mid
- The MosaicID to fetchpublic void storeMosaicTile(MosaicTile tile)
DatabaseFacade
MosaicTile
in the database.storeMosaicTile
in interface DatabaseFacade
tile
- The MosaicTile to store.public void updateMosaicVectors(MosaicVector mv)
DatabaseFacade
MosaicVector
in the database.updateMosaicVectors
in interface DatabaseFacade
mv
- The MosaicVector to store.public java.util.List<MosaicVector> getMosaicVectors(java.util.List<Pic> picList)
DatabaseFacade
MosaicVector
s that matches this picList, which probably came from a mosaic Set.getMosaicVectors
in interface DatabaseFacade
picList
- The List of Pics to queryMosaicVector
s. The List may be empty, but not null.public Poster getPoster(int pid)
DatabaseFacade
Poster
from the database based on this Poster ID.getPoster
in interface DatabaseFacade
pid
- The Poster ID to query.public java.util.List<Poster> getPosters()
DatabaseFacade
Mosaic
s in the database.getPosters
in interface DatabaseFacade
public void storePoster(Poster poster)
DatabaseFacade
Poster
in the database.storePoster
in interface DatabaseFacade
poster
- The Poster to store.public void deletePoster(int pid)
DatabaseFacade
Poster
from the database that has this Poster ID.deletePoster
in interface DatabaseFacade
pid
- The Poster ID to delete.public java.util.List<java.lang.Integer> getSizes()
DatabaseFacade
Filter
s are keyed to the sizes.
A Thumbnail
that looks OK as a 75, might not be worthy of a 300.getSizes
in interface DatabaseFacade
DatabaseFacade.getSizeArray()
public int[] getSizeArray()
DatabaseFacade
getSizeArray
in interface DatabaseFacade
public int getSizeCount()
DatabaseFacade
getSizeCount
in interface DatabaseFacade
public java.util.List<Chain> getChains()
DatabaseFacade
Chain
s in the database.getChains
in interface DatabaseFacade
public int getChainCount()
DatabaseFacade
Chain
s in the Database.getChainCount
in interface DatabaseFacade
public Chain getChain(java.lang.String chainName)
DatabaseFacade
Chain
based on its name.getChain
in interface DatabaseFacade
chainName
- The name to query.null
if not found.public Chain getChain(int cid)
DatabaseFacade
Chain
based on its Chain ID.getChain
in interface DatabaseFacade
cid
- The Chain ID to query.null
if not found.public void storeChain(Chain chain)
DatabaseFacade
Chain
in the Database.storeChain
in interface DatabaseFacade
chain
- The Chain to write.public void deleteChain(Chain chain)
DatabaseFacade
Chain
from the Database.deleteChain
in interface DatabaseFacade
chain
- The Chain to delete.public java.util.List<Set> getSetsInChain(int cid)
DatabaseFacade
Chain
getSetsInChain
in interface DatabaseFacade
cid
- The Chain to querypublic java.util.List<SetSize> getSetSizesInChain(int cid, int sid)
DatabaseFacade
Chain
getSetSizesInChain
in interface DatabaseFacade
cid
- The chain idsid
- The Set
idpublic Contact getContact(int cid, java.lang.String name)
DatabaseFacade
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.getContact
in interface DatabaseFacade
cid
- 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)
DatabaseFacade
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.getContact
in interface DatabaseFacade
cid
- The Chain
IDsetName
- The name of the Set
that was usedsize
- The Thumbnail sizeitem
- Which of this series of contactspublic void addContact(Contact c)
DatabaseFacade
Contact
to the database.addContact
in interface DatabaseFacade
c
- The Contactpublic Contact getNewestContact()
DatabaseFacade
Contact
made. Basically this tells us
the last time Contacts were made.getNewestContact
in interface DatabaseFacade
public java.util.HashMap<java.lang.String,java.util.Date> getContactOldestMap(Chain chain)
DatabaseFacade
getContactOldestMap
in interface DatabaseFacade
chain
- Which Chain
to processpublic int getFilterCount()
DatabaseFacade
Filter
s in the database.getFilterCount
in interface DatabaseFacade
public java.util.List<java.lang.String> getFilterColumns()
DatabaseFacade
Filter
column names from the database.getFilterColumns
in interface DatabaseFacade
public java.util.List<Filter> getFilters()
DatabaseFacade
Filter
s in the database.getFilters
in interface DatabaseFacade
public java.util.List<Filter> getFiltersBySet(java.lang.String set, int size)
DatabaseFacade
Filter
s for this set/size.getFiltersBySet
in interface DatabaseFacade
set
- The name of the Set to query.size
- The thumbnail size to query.Filter
s that match this querypublic java.util.List<java.lang.String> getPicNamesBySet(java.lang.String setName, int size)
DatabaseFacade
Filter
s that match this query.getPicNamesBySet
in interface DatabaseFacade
setName
- The name of the Set to querysize
- The thumbnail size to querypublic java.util.List<java.lang.String> getPicNamesBySet(Set set, int size)
DatabaseFacade
Filter
s that match this query.getPicNamesBySet
in interface DatabaseFacade
set
- The Set to querysize
- The thumbnail size to querypublic java.util.List<java.lang.String> getPicNamesBySet(MetaSet set, int size, int rateOp, int rateVal)
DatabaseFacade
Filter
s that match this query.getPicNamesBySet
in interface DatabaseFacade
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 setpublic java.util.List<java.lang.String> getPicNamesBySet(java.lang.String setName, int size, int rateOp, int rateVal)
DatabaseFacade
Filter
s that match this valued query.
This allows to say "mlb < 5".getPicNamesBySet
in interface DatabaseFacade
setName
- 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)
DatabaseFacade
Filter
s that match this valued query.
This allows to say "mlb < 5".getPicNamesBySet
in interface DatabaseFacade
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 setpublic java.util.List<java.lang.String> getPicNamesByFunc(int func, int size, int rateOp, java.lang.String operand)
DatabaseFacade
Set
for the list of valid function numbers.getPicNamesByFunc
in interface DatabaseFacade
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"public java.util.HashMap<java.lang.String,java.util.Date> getSetTimestamps()
DatabaseFacade
getSetTimestamps
in interface DatabaseFacade
public void addFilter(Filter filter)
DatabaseFacade
Filter
to the database, overwriting any existing filter for this pic.addFilter
in interface DatabaseFacade
filter
- The new (or used) Filter.public Filter getFilter(java.lang.String picName)
DatabaseFacade
Filter
for the pic named.getFilter
in interface DatabaseFacade
picName
- The name of the Pic.public FilterMicroSet getPicFromFilterMicroSet(int pid, int sid)
DatabaseFacade
FilterMicroSet
for this pic in this set.getPicFromFilterMicroSet
in interface DatabaseFacade
pid
- 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
DatabaseFacade
User
who has this userid.getUser
in interface DatabaseFacade
userid
- The userid to query.DataAccessException
public void storeUser(User user)
DatabaseFacade
User
in the database. Does not affect the BSAccount settings of this User.storeUser
in interface DatabaseFacade
user
- The User to save.public java.util.List<Virgin> getVirgins()
DatabaseFacade
Virgin
s in the database.getVirgins
in interface DatabaseFacade
public java.util.List<Virgin> getVirgins(int max)
DatabaseFacade
Virgin
s in the database up to max number. getVirgins
in interface DatabaseFacade
max
- The Maximum number of Virgin
s to put in the Listpublic boolean isVirgin(java.lang.String pic)
DatabaseFacade
Virgin
?isVirgin
in interface DatabaseFacade
pic
- The name of the Pic
to queryVirgin
s table.public void addVirgin(java.lang.String pic)
DatabaseFacade
Virgin
in the database.addVirgin
in interface DatabaseFacade
pic
- The name of the Pic to add.public void deleteVirgin(java.lang.String pic)
DatabaseFacade
Virgin
s table. This Pic is no longer a Virgin
.deleteVirgin
in interface DatabaseFacade
pic
- The name of the Pic
to remove.public int getVirginCount()
DatabaseFacade
Virgin
s in the database.getVirginCount
in interface DatabaseFacade
public void addPic(Pic pic)
DatabaseFacade
Pic
to the database.addPic
in interface DatabaseFacade
pic
- The Pic to add. pid is assumed to be 0.public void updatePic(Pic pic)
DatabaseFacade
Pic
in the database.
Pic is assumed to exist and pid must not be 0.updatePic
in interface DatabaseFacade
pic
- The Pic to update.public Pic getPic(java.lang.String picName)
DatabaseFacade
Pic
who's name matches this picName.getPic
in interface DatabaseFacade
picName
- The name of the Pic
to query.null
.public Pic getPic(int pid)
DatabaseFacade
Pic
who's pid matches this one.getPic
in interface DatabaseFacade
pid
- The pid to querypublic Pic getNewestPic()
DatabaseFacade
getNewestPic
in interface DatabaseFacade
public Pic getRandomPic()
DatabaseFacade
getRandomPic
in interface DatabaseFacade
public java.util.List<Pic> getPicsByMD5Sum(long md5sum)
DatabaseFacade
getPicsByMD5Sum
in interface DatabaseFacade
public java.lang.String getRandomHomePagePicName(User user)
DatabaseFacade
getRandomHomePagePicName
in interface DatabaseFacade
user
- The User
who is requesting the Picpublic void onSetChanged(SetSize setSize)
SetChangedListener
onSetChanged
in interface SetChangedListener
setSize
- The Set/Size that changed.public java.util.HashMap<java.lang.String,java.util.Date> getPicsMap()
DatabaseFacade
Pic
names in the database.getPicsMap
in interface DatabaseFacade
public java.util.List<Pic> getPics()
DatabaseFacade
getPics
in interface DatabaseFacade
public java.util.List<Pic> getPics(java.lang.String picName)
DatabaseFacade
Pic
s in the database that match this name. Wildcards are supported.getPics
in interface DatabaseFacade
picName
- The name (or partial name) of the pics to fetch.Pic
s.public java.util.List<Pic> getPics(Set set, int size)
DatabaseFacade
Pic
s for this set at this size.getPics
in interface DatabaseFacade
set
- 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)
DatabaseFacade
Pic
s that are in this subdirectory.getPicsInDir
in interface DatabaseFacade
rid
- Root id to search underdirName
- The directory, i.e. "2002/20021225"public java.util.List<Pic> getPicsNewerThan(java.util.Calendar calendar)
DatabaseFacade
getPicsNewerThan
in interface DatabaseFacade
calendar
- The timestamp to compare againstpublic double getPicRate(java.lang.String picName, Set set, int size)
DatabaseFacade
getPicRate
in interface DatabaseFacade
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 aboutpublic double getPicRate(java.lang.String picName, MetaSet metaSet, int size)
DatabaseFacade
getPicRate
in interface DatabaseFacade
picName
- 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()
DatabaseFacade
getPicMaxThumbCacheDirUsed
in interface DatabaseFacade
public int getPicThumbCacheFillCount(int cacheDir)
DatabaseFacade
getPicThumbCacheFillCount
in interface DatabaseFacade
cacheDir
- The directory to checkpublic java.lang.String getUuid(java.lang.String setName, int size)
DatabaseFacade
getUuid
in interface DatabaseFacade
setName
- The name of the Setsize
- The sizepublic int normalizeSize(int size)
size
- The size to normalizepublic java.util.Date getClientSyncTimestamp(java.lang.String host)
DatabaseFacade
getClientSyncTimestamp
in interface DatabaseFacade
host
- The host to fetchpublic void setClientSyncTimestamp(java.lang.String host)
DatabaseFacade
setClientSyncTimestamp
in interface DatabaseFacade
host
- The host to fetchpublic void updateSetTimestamp(java.lang.String setSize)
updateSetTimestamp
in interface DatabaseFacade
public void storeSyncClient(SyncClient syncClient)
storeSyncClient
in interface DatabaseFacade
public java.util.List<SyncClient> getSyncClients()
getSyncClients
in interface DatabaseFacade
public void storeSyncServer(SyncServer syncServer)
storeSyncServer
in interface DatabaseFacade
public java.util.List<SyncServer> getSyncServers()
getSyncServers
in interface DatabaseFacade