|
Alignment API and Server 4.5 (1846M) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.inrialpes.exmo.align.service.CacheImpl
public class CacheImpl
This class caches the content of the alignment database. I.e., It loads the metadata in the hash table It stores the alignment when requested It
Field Summary | |
---|---|
private static String |
ALID
|
(package private) Hashtable<String,Alignment> |
alignmentTable
|
private static String |
CACHED
|
(package private) Connection |
conn
|
(package private) int |
CONNECTION_ERROR
|
(package private) String |
host
|
(package private) String |
idprefix
|
(package private) int |
INIT_ERROR
|
(package private) static org.slf4j.Logger |
logger
|
(package private) Hashtable<URI,Set<Alignment>> |
ontologyTable
|
private static String |
OURI1
|
private static String |
OURI2
|
(package private) String |
port
|
(package private) int |
rights
|
(package private) DBService |
service
|
private static String |
STORED
|
(package private) int |
SUCCESS
|
private static String |
SVCNS
|
(package private) int |
VERSION
|
Constructor Summary | |
---|---|
CacheImpl(DBService serv)
|
Method Summary | |
---|---|
protected Collection<Alignment> |
alignments()
|
protected Collection<Alignment> |
alignments(URI u1,
URI u2)
|
void |
changeColumnType(Statement st,
String tableName,
String columnName,
String newType)
|
void |
cleanUpCache()
|
void |
close()
|
Statement |
createStatement()
|
void |
eraseAlignment(String uri,
boolean eraseFromDB)
Non publicised class |
protected void |
flushAlignment(Alignment alignment)
unload the cells of an alignment... |
protected void |
flushCache()
|
String |
generateAlignmentUri()
|
private String |
generateCellId()
|
private String |
generateId()
|
Alignment |
getAlignment(String uri)
retrieve full alignment from id (and cache it) |
Set<Alignment> |
getAlignments(URI uri)
|
Set<Alignment> |
getAlignments(URI uri1,
URI uri2)
returns the alignments between two ontologies if one of the ontologies is null, then return them all |
Alignment |
getMetadata(String uri)
retrieve alignment metadata from id This is more difficult because we return the alignment we have disreagarding if it is complete o only metadata |
void |
init(Properties p,
String prefix)
loads the alignment descriptions from the database and put them in the alignmentTable hashtable |
void |
initDatabase()
|
boolean |
isAlignmentStored(Alignment alignment)
|
protected Enumeration<Alignment> |
listAlignments()
|
private void |
loadAlignments(boolean force)
loads the alignment descriptions from the database and put them in the alignmentTable hashtable index them under the ontology URIs |
protected Collection<URI> |
ontologies()
|
String |
quote(String s)
quote: Prepare a string to be used in SQL queries by preceeding occurences of "'", """, and "\" by a "\". |
private int |
randomNum()
|
String |
recordAlignment(String uri,
Alignment alignment,
boolean force)
records alignment identified by id |
String |
recordNewAlignment(Alignment alignment,
boolean force)
records newly created alignment |
String |
recordNewAlignment(String uri,
Alignment al,
boolean force)
records alignment identified by id |
void |
recordOntology(Statement st,
String id,
boolean source,
URI uri,
URI file,
Ontology onto)
|
String |
recoverAlignmentUri(String id)
|
private void |
registerServer(String host,
String port,
Boolean writeable,
String prefix)
|
void |
renameColumn(Statement st,
String tableName,
String oldName,
String newName,
String newType)
|
void |
reset()
|
void |
resetCacheStamp(Alignment result)
|
void |
resetDatabase(boolean force)
|
protected Alignment |
retrieveAlignment(String uri,
Alignment alignment)
loads the full alignment from the database and put it in the alignmentTable hastable should be invoked when: ( result.getExtension(CACHED) == "" && result.getExtension(STORED) != "") { |
protected Alignment |
retrieveDescription(String id)
loads the description of alignments from the database and set them in an alignment object |
void |
storeAlignment(String uri)
|
String |
stripAlignmentUri(String alid)
|
void |
unRecordAlignment(Alignment alignment)
suppresses the record for an alignment |
void |
unstoreAlignment(String uri)
Non publicised class |
void |
unstoreAlignment(String uri,
Alignment alignment)
|
void |
updateDatabase()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final org.slf4j.Logger logger
Hashtable<String,Alignment> alignmentTable
Hashtable<URI,Set<Alignment>> ontologyTable
String host
String port
int rights
String idprefix
final int VERSION
DBService service
Connection conn
final int CONNECTION_ERROR
final int SUCCESS
final int INIT_ERROR
private static final String SVCNS
private static final String CACHED
private static final String STORED
private static final String ALID
private static final String OURI1
private static final String OURI2
Constructor Detail |
---|
public CacheImpl(DBService serv)
Method Detail |
---|
public void reset() throws SQLException
SQLException
public void init(Properties p, String prefix) throws SQLException, AlignmentException
SQLException
AlignmentException
public void close() throws SQLException
SQLException
public Statement createStatement() throws SQLException
SQLException
private void loadAlignments(boolean force) throws SQLException
SQLException
protected Enumeration<Alignment> listAlignments()
protected Collection<Alignment> alignments()
protected Collection<URI> ontologies()
protected Collection<Alignment> alignments(URI u1, URI u2)
protected void flushCache()
protected Alignment retrieveDescription(String id)
protected Alignment retrieveAlignment(String uri, Alignment alignment) throws SQLException, AlignmentException, URISyntaxException
SQLException
AlignmentException
URISyntaxException
protected void flushAlignment(Alignment alignment)
public String generateAlignmentUri()
public String recoverAlignmentUri(String id)
public String stripAlignmentUri(String alid)
private String generateCellId()
private String generateId()
private int randomNum()
public Alignment getMetadata(String uri) throws AlignmentException
AlignmentException
public Alignment getAlignment(String uri) throws AlignmentException, SQLException
AlignmentException
SQLException
public Set<Alignment> getAlignments(URI uri)
public Set<Alignment> getAlignments(URI uri1, URI uri2)
public String recordNewAlignment(Alignment alignment, boolean force)
public String recordNewAlignment(String uri, Alignment al, boolean force) throws AlignmentException
AlignmentException
public String recordAlignment(String uri, Alignment alignment, boolean force)
public void unRecordAlignment(Alignment alignment)
public String quote(String s)
public boolean isAlignmentStored(Alignment alignment)
public void eraseAlignment(String uri, boolean eraseFromDB) throws SQLException, AlignmentException
SQLException
AlignmentException
public void unstoreAlignment(String uri) throws SQLException, AlignmentException
SQLException
AlignmentException
public void unstoreAlignment(String uri, Alignment alignment) throws SQLException, AlignmentException
SQLException
AlignmentException
public void storeAlignment(String uri) throws AlignmentException, SQLException
AlignmentException
SQLException
public void recordOntology(Statement st, String id, boolean source, URI uri, URI file, Ontology onto) throws SQLException
SQLException
public void resetCacheStamp(Alignment result)
public void cleanUpCache()
public void initDatabase() throws SQLException
SQLException
public void resetDatabase(boolean force) throws SQLException, AlignmentException
SQLException
AlignmentException
private void registerServer(String host, String port, Boolean writeable, String prefix) throws SQLException
SQLException
public void renameColumn(Statement st, String tableName, String oldName, String newName, String newType) throws SQLException
SQLException
public void changeColumnType(Statement st, String tableName, String columnName, String newType) throws SQLException
SQLException
public void updateDatabase() throws SQLException, AlignmentException
SQLException
AlignmentException
|
Alignment API and Server 4.5 (1846M) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |