public class VolatilCache extends java.lang.Object implements Cache
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALID |
private java.util.Hashtable<java.lang.String,Alignment> |
alignmentTable |
protected java.util.Hashtable<java.lang.String,Alignment> |
alignmentURITable |
protected static java.lang.String |
CACHED |
protected java.lang.String |
idprefix |
(package private) static org.slf4j.Logger |
logger |
private java.util.Hashtable<java.net.URI,OntologyNetwork> |
onetworkTable |
protected static java.lang.String |
ONID |
private java.util.Hashtable<java.net.URI,java.util.Set<Alignment>> |
ontologyTable |
protected static java.lang.String |
OURI1 |
protected static java.lang.String |
OURI2 |
private static java.util.Random |
rand |
protected static java.lang.String |
STORED |
protected static java.lang.String |
SVCNS |
Constructor and Description |
---|
VolatilCache() |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<Alignment> |
alignments() |
java.util.Collection<Alignment> |
alignments(java.net.URI u1,
java.net.URI u2) |
void |
cleanUpCache() |
void |
close() |
void |
eraseAlignment(java.lang.String uri,
boolean eraseFromDB)
Non publicised class
|
void |
eraseOntologyNetwork(java.lang.String uri,
boolean eraseFromDB)
Non publicised class
|
protected Alignment |
fetchAlignment(java.lang.String uri,
Alignment result) |
protected void |
flushAlignment(Alignment alignment)
unload the cells of an alignment...
|
void |
flushCache()
The equivalent primitives to both getAlignments()
within a network of ontologies are available from the network itself
|
java.lang.String |
generateAlignmentUri() |
protected java.lang.String |
generateCellId() |
private java.lang.String |
generateId() |
java.lang.String |
generateOntologyNetworkUri() |
Alignment |
getAlignment(java.lang.String uri)
retrieve full alignment from id (and cache it)
|
java.util.Set<Alignment> |
getAlignmentByURI(java.lang.String uri)
Find alignments by URI
|
java.util.Set<Alignment> |
getAlignments(java.net.URI uri)
Find alignments by ontology URIs
|
java.util.Set<Alignment> |
getAlignments(java.net.URI uri1,
java.net.URI uri2)
returns the alignments between two ontologies
if one of the ontologies is null, then return them all
|
java.util.Set<Alignment> |
getAlignmentsByDescription(java.lang.String desc)
Find alignments by pretty
TODO: NOT IMPLEMENTED YET
|
Alignment |
getMetadata(java.lang.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
|
OntologyNetwork |
getOntologyNetwork(java.lang.String uri)
retrieve network of ontologies from id
|
void |
init(java.util.Properties p,
java.lang.String prefix)
loads the alignment descriptions from the database and put them in the
alignmentTable hashtable
|
boolean |
isAlignmentStored(Alignment alignment) |
boolean |
isNetworkStored(OntologyNetwork network) |
protected java.util.Enumeration<Alignment> |
listAlignments() |
java.util.Collection<java.net.URI> |
ontologies() |
java.util.Collection<OntologyNetwork> |
ontologyNetworks() |
java.util.Collection<java.net.URI> |
ontologyNetworkUris() |
private int |
randomNum() |
java.lang.String |
recordAlignment(java.lang.String uri,
Alignment alignment,
boolean force)
records alignment identified by id
force will register the new alignment even if it is already registered
|
java.lang.String |
recordNetwork(java.lang.String uriString,
OntologyNetwork network,
boolean force)
records a network identified by id
|
java.lang.String |
recordNewAlignment(Alignment alignment,
boolean force)
records newly created alignment
|
java.lang.String |
recordNewAlignment(java.lang.String uri,
Alignment al,
boolean force)
records alignment identified by id
|
java.lang.String |
recordNewNetwork(OntologyNetwork network,
boolean force)
records a newly created network
|
java.lang.String |
recordNewNetwork(java.lang.String uri,
OntologyNetwork network,
boolean force)
records alignment identified by id
|
protected java.lang.String |
recoverAlignmentUri(java.lang.String id) |
protected java.lang.String |
recoverNetworkUri(java.lang.String id) |
void |
reset() |
void |
resetCacheStamp(Alignment al) |
void |
resetCacheStamp(OntologyNetwork network) |
void |
resetTables() |
void |
storeAlignment(java.lang.String uri) |
void |
storeOntologyNetwork(java.lang.String uri) |
protected java.lang.String |
stripAlignmentUri(java.lang.String alid) |
protected java.lang.String |
stripNetworkUri(java.lang.String onetid) |
void |
unRecordAlignment(Alignment alignment)
suppresses the record for an alignment
|
void |
unRecordNetwork(OntologyNetwork network)
suppresses the record for a network of ontologies
|
void |
unstoreAlignment(java.lang.String uri,
Alignment alignment) |
void |
unstoreOntologyNetwork(java.lang.String uri,
OntologyNetwork network) |
static final org.slf4j.Logger logger
private static java.util.Random rand
private java.util.Hashtable<java.lang.String,Alignment> alignmentTable
private java.util.Hashtable<java.net.URI,java.util.Set<Alignment>> ontologyTable
private java.util.Hashtable<java.net.URI,OntologyNetwork> onetworkTable
protected java.util.Hashtable<java.lang.String,Alignment> alignmentURITable
protected java.lang.String idprefix
protected static final java.lang.String SVCNS
protected static final java.lang.String CACHED
protected static final java.lang.String STORED
protected static final java.lang.String ALID
protected static final java.lang.String OURI1
protected static final java.lang.String OURI2
protected static final java.lang.String ONID
public void resetTables()
public void reset() throws AlignmentException
reset
in interface Cache
AlignmentException
public void init(java.util.Properties p, java.lang.String prefix) throws AlignmentException
init
in interface Cache
p:
- the initialisation parametersprefix:
- the URI prefix of the current serverAlignmentException
- when something goes wrong (cannot access database, but format)public void close() throws AlignmentException
close
in interface Cache
AlignmentException
protected java.util.Enumeration<Alignment> listAlignments()
public java.util.Collection<Alignment> alignments()
alignments
in interface Cache
public java.util.Collection<java.net.URI> ontologies()
ontologies
in interface Cache
public java.util.Collection<java.net.URI> ontologyNetworkUris()
public java.util.Collection<OntologyNetwork> ontologyNetworks()
ontologyNetworks
in interface Cache
public java.util.Set<Alignment> getAlignmentByURI(java.lang.String uri)
getAlignmentByURI
in interface Cache
uri:
- the URI of the alignment to retrievepublic java.util.Set<Alignment> getAlignmentsByDescription(java.lang.String desc)
getAlignmentsByDescription
in interface Cache
desc:
- a string describing the sought alignmentpublic java.util.Set<Alignment> getAlignments(java.net.URI uri)
getAlignments
in interface Cache
uri:
- the URI of one ontologypublic java.util.Set<Alignment> getAlignments(java.net.URI uri1, java.net.URI uri2)
getAlignments
in interface Cache
uri1
- anduri2:
- the URIs two ontologies from which retrieving alignmentspublic java.util.Collection<Alignment> alignments(java.net.URI u1, java.net.URI u2)
alignments
in interface Cache
public java.lang.String generateAlignmentUri()
generateAlignmentUri
in interface Cache
protected java.lang.String recoverAlignmentUri(java.lang.String id)
protected java.lang.String stripAlignmentUri(java.lang.String alid)
public java.lang.String generateOntologyNetworkUri()
generateOntologyNetworkUri
in interface Cache
protected java.lang.String recoverNetworkUri(java.lang.String id)
protected java.lang.String stripNetworkUri(java.lang.String onetid)
private java.lang.String generateId()
private int randomNum()
protected java.lang.String generateCellId()
public Alignment getMetadata(java.lang.String uri) throws AlignmentException
getMetadata
in interface Cache
uri:
- the URI of the alignment whose metadata to retrieveAlignmentException
- when something goes wrong (cannot resolve URI)public Alignment getAlignment(java.lang.String uri) throws AlignmentException
getAlignment
in interface Cache
uri:
- the URI of the alignment to retrieveAlignmentException
- when something goes wrong (cannot resolve URI)protected Alignment fetchAlignment(java.lang.String uri, Alignment result) throws AlignmentException
AlignmentException
public OntologyNetwork getOntologyNetwork(java.lang.String uri) throws AlignmentException
getOntologyNetwork
in interface Cache
uri:
- the URI of the network to retrieveAlignmentException
- when something goes wrong (cannot resolve URI)public void flushCache()
Cache
flushCache
in interface Cache
protected void flushAlignment(Alignment alignment)
alignment:
- the alignment to unloadpublic java.lang.String recordNewAlignment(Alignment alignment, boolean force)
recordNewAlignment
in interface Cache
alignment:
- the alignment to recordforce:
- true if the alignment is too be recorded even if it was recordedpublic java.lang.String recordNewAlignment(java.lang.String uri, Alignment al, boolean force) throws AlignmentException
recordNewAlignment
in interface Cache
uri:
- the URI of the alignment to recordal:
- the alignment to recordforce:
- true if the alignment is too be recorded even if it was recordedAlignmentException
- when something goes wrong (cannot resolve URI)public java.lang.String recordAlignment(java.lang.String uri, Alignment alignment, boolean force)
uri:
- the URI of the alignment to recordalignment:
- the alignment to recordforce:
- true if the alignment is too be recorded even if it was recordedpublic void unRecordAlignment(Alignment alignment)
alignment:
- the alignment to unrecordpublic java.lang.String recordNewNetwork(OntologyNetwork network, boolean force)
recordNewNetwork
in interface Cache
network:
- the network of ontologies to recordforce:
- true if the network is too be recorded even if it was recordedpublic java.lang.String recordNewNetwork(java.lang.String uri, OntologyNetwork network, boolean force) throws AlignmentException
recordNewNetwork
in interface Cache
uri:
- the URI of the network to recordnetwork:
- the network of ontologies to recordforce:
- true if the network is too be recorded even if it was recordedAlignmentException
- when something goes wrong (cannot resolve URI)public java.lang.String recordNetwork(java.lang.String uriString, OntologyNetwork network, boolean force)
uriString:
- the URI of the network to recordnetwork:
- the network of ontologies to recordforce:
- true if the network is too be recorded even if it was recordedpublic void unRecordNetwork(OntologyNetwork network)
network:
- the network of ontologies to recordpublic boolean isAlignmentStored(Alignment alignment)
isAlignmentStored
in interface Cache
public boolean isNetworkStored(OntologyNetwork network)
isNetworkStored
in interface Cache
public void eraseAlignment(java.lang.String uri, boolean eraseFromDB) throws AlignmentException
eraseAlignment
in interface Cache
uri:
- the URI of the alignment to eraseeraseFromDB:
- true if the alignment is erased from the database cacheAlignmentException
- when something goes wrong (cannot resolve URI)public void unstoreAlignment(java.lang.String uri, Alignment alignment) throws AlignmentException
AlignmentException
public void storeAlignment(java.lang.String uri) throws AlignmentException
storeAlignment
in interface Cache
AlignmentException
public void eraseOntologyNetwork(java.lang.String uri, boolean eraseFromDB) throws AlignmentException
eraseOntologyNetwork
in interface Cache
AlignmentException
public void unstoreOntologyNetwork(java.lang.String uri, OntologyNetwork network) throws AlignmentException
AlignmentException
public void storeOntologyNetwork(java.lang.String uri) throws AlignmentException
storeOntologyNetwork
in interface Cache
AlignmentException
public void resetCacheStamp(Alignment al)
public void resetCacheStamp(OntologyNetwork network)
public void cleanUpCache()
(C) INRIA & friends, 2003-2020