|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.reps.AccessMethod
public class AccessMethod
The AccessMethod class describes how a particular database presented
by a Schema can be accessed by an AutoMed application, using
a particular Protocol. This is very experimental at present,
and has only been designed to handle JDBC/ODBC type protocols.
| Field Summary | |
|---|---|
static java.lang.String |
PROPERTY_AUTOMED_SCHEMA
Name to give to a AccessMethod property to hold the name of an AutoMed oriented schema that was produced from the schema associated with this AccessMethod. |
static java.lang.String |
PROPERTY_CREATE_TIME
Name to give to a AccessMethod property for the time in milliseconds since 1 Jan 1970 that the datasource schema was created in the AutoMed repository. |
| Method Summary | |
|---|---|
protected static void |
clearAccessMethods()
|
static AccessMethod |
createAccessMethod(Schema schema,
java.lang.String url,
Protocol protocol,
java.lang.String dbDriver,
java.lang.String username)
Used to created an AccessMethod where no password is required to access the data source. |
static AccessMethod |
createAccessMethod(Schema schema,
java.lang.String url,
Protocol protocol,
java.lang.String dbDriver,
java.lang.String username,
java.lang.String password,
java.lang.String wrapper,
int awfFeatures)
Creates a new access method. |
static AccessMethod |
getAccessMethod(int amid)
Returns the AccessMethod held with the given identifier in
in the STR. |
int |
getAMID()
Returns the access method identifier (AMID). |
int |
getAutoMedWrapperFactoryFeatures()
Returns the feature settings as used with associated AutoMedWrapperFactory |
java.lang.String |
getDBDriver()
Returns the database driver used for connecting to the database. |
PersistentKey |
getKey()
|
java.lang.String |
getPassword()
Returns the password of the user, if it exists |
java.util.Map |
getPersistentAttributes()
|
java.lang.String |
getProperty(java.lang.String key)
Returns a property associated with this AccessMethod. |
Protocol |
getProtocol()
Returns the Protocol used for connecting to the database. |
Schema |
getSchema()
Returns the schema that represents the database to which the access method connects. |
java.lang.String |
getURL()
Returns the URL of the database to which the access method connects. |
java.lang.String |
getUsername()
Returns the username used for connecting to the database. |
java.lang.String |
getWrapper()
Returns the wrapper used for connecting to the database. |
void |
remove()
Remove this AccessMethod from the repository. |
void |
retract()
Remove this AccessMethod, and any other classes that are dependent upon its existance. |
void |
setAutoMedWrapperFactoryFeatures(int awfFeatures)
Sets the password used for connecting to the database. |
void |
setDBDriver(java.lang.String dbDriver)
Sets the database driver used for connecting to the database. |
void |
setPassword(java.lang.String password)
Sets the password used for connecting to the database. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets a property associated with this AccessMethod. |
void |
setProtocol(Protocol protocol)
Sets the protocol used for connecting to the database. |
void |
setSchema(Schema schema)
Sets the schema that represents the database to which the access method connects. |
void |
setURL(java.lang.String url)
Sets the URL of the database to which the access method connects. |
void |
setUsername(java.lang.String username)
Sets the username used for connecting to the database. |
void |
setWrapper(java.lang.String wrapper)
Sets the wrapper asscociated with this. |
void |
write(java.io.OutputStream os,
int format)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTY_CREATE_TIME
public static final java.lang.String PROPERTY_AUTOMED_SCHEMA
| Method Detail |
|---|
public static AccessMethod createAccessMethod(Schema schema,
java.lang.String url,
Protocol protocol,
java.lang.String dbDriver,
java.lang.String username)
public static AccessMethod createAccessMethod(Schema schema,
java.lang.String url,
Protocol protocol,
java.lang.String dbDriver,
java.lang.String username,
java.lang.String password,
java.lang.String wrapper,
int awfFeatures)
schema - the Schema that represents the database
to which the access method connects.url - the URL of the database the access method connects to.protocol - the Protocol used for the connection.dbDriver - the database driver used for the connection.username - the username for connecting to the database.password - for connecting to the database (which may be null if
none is required).wrapper - is the class name of the associated
AutoMedWrapperawfFeatures - is the feature settings of the associated
AutoMedWrapperFactory
public void remove()
throws InconsistentException
InconsistentException
public void retract()
throws InconsistentException
InconsistentException
public static AccessMethod getAccessMethod(int amid)
throws NotFoundException
AccessMethod held with the given identifier in
in the STR.
amid - the access method identifier (AMID) found in the STR.
NotFoundException - is no such AccessMethod existspublic int getAMID()
public Schema getSchema()
public java.lang.String getURL()
public java.lang.String getPassword()
public int getAutoMedWrapperFactoryFeatures()
AutoMedWrapperFactory
public Protocol getProtocol()
Protocol used for connecting to the database.
Protocol used for connecting to the database.public java.lang.String getDBDriver()
public java.lang.String getUsername()
public java.lang.String getWrapper()
AutoMedWrapper associated
with this AccessMethod.
public java.lang.String getProperty(java.lang.String key)
throws NotFoundException
key - name given to identify this property. The only standard
property names at present are {#link PROPERTY_CREATE_TIME}
and {#link PROPERTY_AUTOMED_SCHEMA}.
NotFoundException - is there is no value recorded under key.public void setSchema(Schema schema)
schema - the Schema that represents the database
to which the access method connects.public void setURL(java.lang.String url)
url - the URL of the database to which the access method connects.public void setProtocol(Protocol protocol)
protocol - the Protocol used for connecting to
the database.public void setDBDriver(java.lang.String dbDriver)
dbDriver - the database driver used for connecting to the database.public void setUsername(java.lang.String username)
username - the username used for connecting to the database.public void setWrapper(java.lang.String wrapper)
wrapper - the class name of the AutoMedWrapper associated
with this AccessMethod.public void setPassword(java.lang.String password)
password - the password used for connecting to the database.public void setAutoMedWrapperFactoryFeatures(int awfFeatures)
password - the password used for connecting to the database.
public void setProperty(java.lang.String key,
java.lang.String value)
key - name given to identify this property. The only standard
property names at present are {#link PROPERTY_CREATE_TIME}
and {#link PROPERTY_AUTOMED_SCHEMA}.the - value to hold against the key value.protected static void clearAccessMethods()
public PersistentKey getKey()
getKey in interface PersistentObjectpublic java.util.Map getPersistentAttributes()
getPersistentAttributes in interface PersistentObject
public void write(java.io.OutputStream os,
int format)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||