it.unimo.dbgroup.momis.odli3
Class Source

java.lang.Object
  extended byit.unimo.dbgroup.momis.odli3.MomisObject
      extended byit.unimo.dbgroup.momis.odli3.TypeContainer
          extended byit.unimo.dbgroup.momis.odli3.Source
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GlobalSource

public class Source
extends TypeContainer
implements java.io.Serializable

Descrive un sorgente

See Also:
Serialized Form

Field Summary
private  java.lang.String _description
          the source name
private  java.lang.String _name
          the source name
private  java.lang.String _sourceType
          the source type
private  WrapperCore _wrapper
          The wrapper cache.
 java.lang.String _wrapperClassName
          Name of the class of the wrapper that manages the source.
 java.util.Properties _wrapperClientProperties
          Configuration for the WrapperClient
static java.util.Comparator COMPARE_ON_NAME
          Comparator used to Sort arrays.
 
Fields inherited from class it.unimo.dbgroup.momis.odli3.TypeContainer
_constants, _interfaces, _sources, _structs, _thesRelations
 
Fields inherited from class it.unimo.dbgroup.momis.odli3.MomisObject
mod_GenericODLParser, mod_GlobalSchema, mod_QueryManger, mod_SIDes_ARM, mod_SIDes_ARTEMIS, mod_SIDes_EXTM, mod_SIDes_JoinMap, mod_SIDes_main, mod_SIDes_SAM, mod_SIDes_SIM, mod_SIDes_SIM2, mod_SIDes_SLIM, mod_SIDes_TREdit, mod_SIDes_TUNIM
 
Constructor Summary
Source()
          Basic constructor
Source(java.lang.String n, java.lang.String t)
          il costruttore passa nome e tipo del sorgente
 
Method Summary
 void closeWrapperConnection()
          closing the connection
 void delInterface(Interface intf)
          Cancella un'oggetto Interface alla lista di quelle appartenenti a questa sorgente
 QMResultSet executeQuery(java.lang.String query)
          Executes a query on this source
 java.lang.String getDescription()
          Returns the Description of this Source.
 java.util.TreeMap getExtRule(Schema sch, boolean exclusive)
          Return a list of Extensional rules that involves only local class of the give source.
 java.lang.String getName()
          Returns the name of this Source.
 java.lang.String getType()
          Returns the Type of this Source.
 java.lang.String getWrapperClassName()
          Gets the Name of the class of the wrapper that manages the source
 java.lang.String getWrapperClientPropertiesAsString()
          Sets a single property of the Configuration for the WrapperClient
 Wrapper getWrapperConnection()
          Create a new Wrapper instance to communicate with the source
This uses the information getWrapperClassName() _wrapperClientProperties
 void loadFromXML(org.xml.sax.Attributes attrib)
          Load the object from an xml tag.
 void setDescription(java.lang.String description)
          Returns the Description of this Source.
 void setName(java.lang.String newName)
          Sets the name of the source to a new name.
 void setType(java.lang.String type)
          Returns the Type of this Source.
 void setWrapperClassName(java.lang.String wrapperClassName)
          Sets the Name of the class of the wrapper that manages the source
 void setWrapperClientPropertiesFromString(java.lang.String text)
          Sets a single property of the Configuration for the WrapperClient
 java.lang.String toOdl()
          Returns the ODLi3 description for this source.
 java.lang.String toString()
          String representation for the Source.
 
Methods inherited from class it.unimo.dbgroup.momis.odli3.TypeContainer
addConstant, addConstants, addDefined, addDefineds, addEnum, addEnums, addExtRule, addIntBodies, addIntBody, addIntBodyForceNewName, addInterface, addInterfaces, addModule, addModules, addRule, addRules, addSource, addSources, addStruct, addStructs, addThesRelation, addThesRelations, addThesRelationWithControl, addThesRelationWithControlIgnoreWeaker, addThesRelationWithControlIgnoreWeaker, addTypes, addTypesToSolve, addTypeToSolve, addUnion, addUnions, cloneAllThesRelations, delAllThesRelations, delRule, delRuleByName, delThesRelation, delThesRelationsForProducer, getConstant, getConstants, getDefined, getDefineds, getEnum, getEnums, getExtRule, getIntBodies, getIntBodiesAsCollection, getIntBodiesOrderByName, getIntBody, getInterface, getInterface, getInterfaces, getInterfacesAsCollection, getInterfacesOrderByName, getModule, getModules, getParent, getRule, getRuleByName, getRules, getSchema, getSource, getSources, getSourcesAsCollection, getSourcesOrderByName, getStruct, getStructs, getThesRelations, getTopParent, getTypesToSolve, getUnion, getUnions, retrieveAttribute, retrieveInterface, retrieveSource, setParent, setSource, solveUnsolved, solveUnsolvedForeignKeys, toOlcd, toOlcdSimB
 
Methods inherited from class it.unimo.dbgroup.momis.odli3.MomisObject
getAdditionalInfo, getAdditionalInfos, getGenericProducerDescription, getProducerDescription, getProducerId, putAdditionalInfo, setProducerId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPARE_ON_NAME

public static final java.util.Comparator COMPARE_ON_NAME
Comparator used to Sort arrays.


_name

private java.lang.String _name
the source name


_description

private java.lang.String _description
the source name


_sourceType

private java.lang.String _sourceType
the source type


_wrapperClassName

public java.lang.String _wrapperClassName
Name of the class of the wrapper that manages the source.


_wrapperClientProperties

public java.util.Properties _wrapperClientProperties
Configuration for the WrapperClient


_wrapper

private WrapperCore _wrapper
The wrapper cache. This is because the connections is opened once and can be re-used several times.

Constructor Detail

Source

public Source()
Basic constructor


Source

public Source(java.lang.String n,
              java.lang.String t)
il costruttore passa nome e tipo del sorgente

Parameters:
n - nome del sorgente
t - tipo del sorgente
Method Detail

getName

public java.lang.String getName()
Returns the name of this Source.

Overrides:
getName in class TypeContainer

getType

public java.lang.String getType()
Returns the Type of this Source.


setType

public void setType(java.lang.String type)
Returns the Type of this Source.


getDescription

public java.lang.String getDescription()
Returns the Description of this Source.


setDescription

public void setDescription(java.lang.String description)
Returns the Description of this Source.


delInterface

public void delInterface(Interface intf)
Cancella un'oggetto Interface alla lista di quelle appartenenti a questa sorgente

Parameters:
intf - interfaccia da rimuovere

toString

public java.lang.String toString()
String representation for the Source.

Overrides:
toString in class TypeContainer

toOdl

public java.lang.String toOdl()
Returns the ODLi3 description for this source.

Overrides:
toOdl in class TypeContainer

getExtRule

public java.util.TreeMap getExtRule(Schema sch,
                                    boolean exclusive)
Return a list of Extensional rules that involves only local class of the give source.

Parameters:
exclusive - Flag : True Return only rules where both local class are memeber of given source False Return rules where one or both local class are member of the given source.
Returns:
ExtRule list: in key field stored the rule name and in the value field store the ExtRule object.

setName

public void setName(java.lang.String newName)
Sets the name of the source to a new name.


loadFromXML

public void loadFromXML(org.xml.sax.Attributes attrib)
                 throws java.lang.Exception
Load the object from an xml tag.

Throws:
java.lang.Exception

setWrapperClassName

public void setWrapperClassName(java.lang.String wrapperClassName)
Sets the Name of the class of the wrapper that manages the source


getWrapperClassName

public java.lang.String getWrapperClassName()
Gets the Name of the class of the wrapper that manages the source


setWrapperClientPropertiesFromString

public void setWrapperClientPropertiesFromString(java.lang.String text)
                                          throws java.lang.Exception
Sets a single property of the Configuration for the WrapperClient

Throws:
java.lang.Exception

getWrapperClientPropertiesAsString

public java.lang.String getWrapperClientPropertiesAsString()
Sets a single property of the Configuration for the WrapperClient


getWrapperConnection

public Wrapper getWrapperConnection()
                             throws java.lang.Exception
Create a new Wrapper instance to communicate with the source
This uses the information

Throws:
java.lang.Exception

executeQuery

public QMResultSet executeQuery(java.lang.String query)
                         throws java.lang.Exception
Executes a query on this source

Throws:
java.lang.Exception

closeWrapperConnection

public void closeWrapperConnection()
                            throws java.lang.Exception
closing the connection

Throws:
java.lang.Exception


Universita' di Modena e Reggio Emilia