|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectit.polito.elite.doseWS.wrappers.DBWrapperImpl
This class implements DBWrapper
configuration parameters in config.conf
dbDriver=COM.cloudscape.core.RmiJdbcDriver dbURI=jdbc:cloudscape:rmi:jGuru dbUser=sa dbPassword=admin
| Field Summary | |
static int |
EAGAIN
Operation failed for external causes |
static int |
EBADSQL
SQL-Level error (ie. |
static int |
ENOENT
Required key not found |
static int |
EPARAM
Wrong parameter |
| Constructor Summary | |
DBWrapperImpl(java.lang.String dbDriver,
java.lang.String dbURI,
java.lang.String dbUser,
java.lang.String dbPassword)
An Implementation of DBWrapper |
|
| Method Summary | |
int |
countAnnotations()
gives back the total number of annotations stored in the database |
int |
countAnnotations(java.lang.String topicURI)
returns the number of annotation (unexpanded) for a given topic |
java.lang.String |
dbStatus()
last database error |
java.lang.Integer |
deleteAuthor(java.lang.Integer idauthor)
delete an author from the database given the key (and ALL the annotations synset that use it) |
java.lang.Integer |
deleteAuthor(java.lang.String author)
delete an author from the database given the name (and ALL the annotations synset that use it) |
int |
deleteSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
delete an annotations block |
java.lang.Integer |
deleteSynset(java.lang.Integer i)
Elimina un Synset, dato topicUri e linguaggio nella tabella sysnset |
java.lang.Integer |
deleteSynset(java.lang.String topicURI,
java.lang.String lang)
Elimina un Synset, dato topicUri e linguaggio nella tabella sysnset |
java.lang.Integer |
deleteSynset(Synset S)
elimina un synset, data la chiave |
java.lang.Integer |
deleteTopic(java.lang.Integer idtopic)
delete a topic, given the topic key |
java.lang.Integer |
deleteTopic(java.lang.String topic)
delete a topic from the database given the URI (and ALL the annotations synset that use it) |
java.lang.Integer |
deleteType(java.lang.Integer idtype)
delete an annotation type from the database given the key (and ALL the annotations synset that use it) |
java.lang.Integer |
deleteType(java.lang.String anntype)
delete an annotation type from the database given the name (and ALL the annotations synset that use it) |
int |
deleteXSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
delete an expanded annotations block |
Synset[] |
getAnySynset(java.lang.String lang)
Get all synset for a giveb language this is not optimized: will call multiple times getSynset |
boolean |
getCheckann()
reads thre checkann boolean value |
Spectrum |
getSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
gives back the block of annotations, given fragment (author and type are optional) |
Synset |
getSynset(java.lang.String TopicURI,
java.lang.String lang)
Get a Sysnset given URI and language |
TopicCoverage |
getTopicsCoverage()
For being able to implement the political of self-management of the conceptual cover of annotations it is necessary to introduce a method getTopicsCoverage. |
Spectrum |
getXSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
gives back the block of refined annotations, given fragment (author and type are optional) |
java.lang.Integer |
insertAuthor(java.lang.String author)
Insert an author |
int |
insertSpectrum(Spectrum spectrum)
Insert a block of annotations for a Spectrum |
java.lang.Integer |
insertSynset(java.lang.String topicURI,
java.lang.String lang)
Inssert a row into SynsetTable |
java.lang.Integer |
insertTopic(java.lang.String topic)
insert a topic |
java.lang.Integer |
insertType(java.lang.String anntype)
Insert an annotation type |
int |
insertXSpectrum(Spectrum spectrum)
Insert a block of annotations for an expanded Spectrum |
java.lang.Integer |
loadSynset(Synset S)
Carica un Synset nuovo. |
java.util.Vector |
searchXByTopic(java.util.Vector topicURIs,
int level)
give back the spectra that are compatible with the one of the given topicURI, ie. |
java.lang.Integer |
selectAuthor(java.lang.String author)
Returns the key of the annotation author, null if not found |
java.lang.Integer |
selectSynset(java.lang.String topicURI,
java.lang.String lang)
Cerca una riga nella tabella sysnset |
java.lang.Integer |
selectTopic(java.lang.String topic)
seleziona un topic dal database |
java.lang.Integer |
selectType(java.lang.String type)
Returns the key of the annotation type, null if not found |
void |
setCheckann(boolean b)
Set the checkann flag. |
int |
updateSpectrum(Spectrum spectrum)
Updates a spectrum: the actual behaviour is to delete the existing specrum, then inset the new specrum |
java.lang.Integer |
updateSynset(Synset S,
boolean addMode)
Updates a Synset. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int EBADSQL
public static int ENOENT
public static int EAGAIN
public static int EPARAM
| Constructor Detail |
public DBWrapperImpl(java.lang.String dbDriver,
java.lang.String dbURI,
java.lang.String dbUser,
java.lang.String dbPassword)
throws java.lang.Exception
dbDriver - JDBC driver to usedbURI - DBMS URI to usedbUser - DBMS userdbPassword - DBMS password
java.lang.Exception - in error| Method Detail |
public void setCheckann(boolean b)
b - the checkann valuepublic boolean getCheckann()
public int insertSpectrum(Spectrum spectrum)
throws java.lang.Exception
insertSpectrum in interface DBWrapperspectrum - The specrum to be inserted
java.lang.Exception - for serious errors
public int insertXSpectrum(Spectrum spectrum)
throws java.lang.Exception
insertXSpectrum in interface DBWrapperspectrum - The specrum to be inserted
java.lang.Exception - for serious errors
public Spectrum getSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
getSpectrum in interface DBWrapperuri - fragment's URIxPath - fragment's xPathauthor - fragment's authortype - e fragment's type
public Spectrum getXSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
getXSpectrum in interface DBWrapperuri - fragment's URIxPath - fragment's xPathauthor - fragment's authortype - e fragment's type
public int updateSpectrum(Spectrum spectrum)
throws java.lang.Exception
updateSpectrum in interface DBWrapperspectrum - the Spectrum that will be updated
java.lang.Exception - In case of error.
public int deleteSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
deleteSpectrum in interface DBWrapperuri - annotation's URIxPath - annotation's xpathauthor - annotation's authortype - annotation's type
public int deleteXSpectrum(java.lang.String uri,
java.lang.String xPath,
java.lang.String author,
java.lang.String type)
deleteXSpectrum in interface DBWrapperuri - annotation's URIxPath - annotation's xpathauthor - annotation's authortype - annotation's type
public java.lang.String dbStatus()
dbStatus in interface DBWrapper
public java.util.Vector searchXByTopic(java.util.Vector topicURIs,
int level)
searchXByTopic in interface DBWrappertopicURIs - vector of tpocurilevel - number of occoureances respect the given fragment.
A spectrum to be considered valid shoul have at least this number of
occorrences. If level=1 will make OR of the terms. if level=topicURIs.lenght()
will make an AND of terms
public java.lang.Integer selectTopic(java.lang.String topic)
throws java.lang.Exception
selectTopic in interface DBWrappertopic - il topic da cercare (es: http://www.www#001/
java.lang.Exception - In caso di errore genera una Exception
public java.lang.Integer selectType(java.lang.String type)
throws java.lang.Exception
selectType in interface DBWrappertype - string representing the annotation type
java.lang.Exception - see selectGeneric
public java.lang.Integer selectAuthor(java.lang.String author)
throws java.lang.Exception
selectAuthor in interface DBWrapperauthor - the author sting
java.lang.Exception - see selectGeneric
public java.lang.Integer insertAuthor(java.lang.String author)
throws java.lang.Exception
insertAuthor in interface DBWrapperauthor - the author name
java.lang.Exception - see insertGeneric
public java.lang.Integer insertType(java.lang.String anntype)
throws java.lang.Exception
insertType in interface DBWrapperanntype - the annotation type name
java.lang.Exception - see insertGeneric
public java.lang.Integer insertTopic(java.lang.String topic)
throws java.lang.Exception
insertTopic in interface DBWrappertopic - the topic to insert (es: http://www.www#001/)
java.lang.Exception - see insertGeneric
public java.lang.Integer insertSynset(java.lang.String topicURI,
java.lang.String lang)
throws java.lang.Exception
insertSynset in interface DBWrappertopicURI - Synset's topicURIlang - synset's lagnuage (two characters)
java.lang.Exception - in error
public java.lang.Integer selectSynset(java.lang.String topicURI,
java.lang.String lang)
throws java.lang.Exception
selectSynset in interface DBWrappertopicURI - URI referenced by the synset (must exist before insering
the sysnset)lang - two-charachet rapresentation of the synset language
java.lang.Exception - see selectGeneric
public java.lang.Integer deleteSynset(java.lang.String topicURI,
java.lang.String lang)
throws java.lang.Exception
deleteSynset in interface DBWrappertopicURI - l'uri a cui si riferisce il synsetlang - lingua del synset
java.lang.Exception - si` spara un'eccezione
public java.lang.Integer deleteSynset(java.lang.Integer i)
throws java.lang.Exception
deleteSynset in interface DBWrapperi - chiave da eliminare
java.lang.Exception - eccezione in caso di errore
public java.lang.Integer deleteSynset(Synset S)
throws java.lang.Exception
deleteSynset in interface DBWrapperS - da eliminare (ATTENZIONE: non elimina solo quello che
si trova nelle occour ....)
java.lang.Exception - In caso di problemi al DB spara un'eccezione
public java.lang.Integer loadSynset(Synset S)
throws java.lang.Exception
loadSynset in interface DBWrapperS - Synset da inserire
java.lang.Exception - In caso di problemi al DB spara un'eccezione
public java.lang.Integer updateSynset(Synset S,
boolean addMode)
throws java.lang.Exception
updateSynset in interface DBWrapperaddMode - false new values will overwrite older ones, true the new occouurence wil be added to the old one (weight will be overwritten anyway)S - Synset to insert/update
java.lang.Exception - In error
public Synset getSynset(java.lang.String TopicURI,
java.lang.String lang)
throws java.lang.Exception
TopicURI - the synset's topiclang - the synset's language
java.lang.Exception - in error
public Synset[] getAnySynset(java.lang.String lang)
throws java.lang.Exception
lang - the language requested
java.lang.Exception - in error
public int countAnnotations(java.lang.String topicURI)
throws java.lang.Exception
countAnnotations in interface DBWrappertopicURI - the topicuri to search
java.lang.Exception - in error
public int countAnnotations()
throws java.lang.Exception
countAnnotations in interface DBWrapperjava.lang.Exception - in error
public java.lang.Integer deleteAuthor(java.lang.String author)
throws java.lang.Exception
deleteAuthor in interface DBWrapperauthor - the author name to delete
java.lang.Exception - see deleteGeneric
public java.lang.Integer deleteAuthor(java.lang.Integer idauthor)
throws java.lang.Exception
deleteAuthor in interface DBWrapperidauthor - the author to delete
java.lang.Exception - in error
public java.lang.Integer deleteType(java.lang.Integer idtype)
throws java.lang.Exception
deleteType in interface DBWrapperidtype - the annotation type to delete
java.lang.Exception - in error
public java.lang.Integer deleteType(java.lang.String anntype)
throws java.lang.Exception
deleteType in interface DBWrapperanntype - the annotation type to delete
java.lang.Exception - see deleteGeneric
public java.lang.Integer deleteTopic(java.lang.Integer idtopic)
throws java.lang.Exception
deleteTopic in interface DBWrapperidtopic - the topic to delete
java.lang.Exception - see deleteGeneric
public java.lang.Integer deleteTopic(java.lang.String topic)
throws java.lang.Exception
deleteTopic in interface DBWrappertopic - the topic to delete
java.lang.Exception - in error
public TopicCoverage getTopicsCoverage()
throws java.lang.Exception
getTopicsCoverage in interface DBWrapperjava.lang.Exception - in error case
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||