D
- either java.sql.Driver or javax.sql.DataSourcepublic abstract class AbstractDatabase<D> extends java.lang.Object implements Database<D>
Constructor and Description |
---|
AbstractDatabase() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDirty(java.lang.Object oldValue,
java.lang.Object newValue)
Set the dirty flag if the new value differs from the old value.
|
void |
clean() |
int |
compareTo(Database<D> database) |
boolean |
equals(java.lang.Object object) |
java.lang.String |
getId()
Returns the unique idenfier for this database
|
java.lang.String |
getPassword() |
java.util.Properties |
getProperties()
Returns a collection of additional properties of this database.
|
java.lang.String |
getUser() |
int |
getWeight()
Returns the relative "weight" of this cluster node.
|
int |
hashCode() |
boolean |
isDirty() |
boolean |
isLocal()
Indicates whether or not this database is local to the machine on which the JVM resides.
|
void |
removeProperty(java.lang.String name)
Removes the specified property.
|
void |
setId(java.lang.String id) |
void |
setLocal(boolean local)
Sets whether or not this database is local to the machine on which the JVM resides.
|
void |
setPassword(java.lang.String password)
Set the password for this database
|
void |
setProperties(java.util.Properties properties) |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set the value of the specified property.
|
void |
setUser(java.lang.String user)
Set the user for this database.
|
void |
setWeight(int weight)
Set the weight for this database
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
connect, createConnectionFactory, getActiveMBean, getInactiveMBean
public AbstractDatabase()
public java.lang.String getId()
ActiveDatabaseMBean
getId
in interface ActiveDatabaseMBean
ActiveDatabaseMBean.getId()
public void setId(java.lang.String id)
id
- public java.lang.String getUser()
getUser
in interface ActiveDatabaseMBean
ActiveDatabaseMBean.getUser()
public void setUser(java.lang.String user)
InactiveDatabaseMBean
setUser
in interface InactiveDatabaseMBean
user
- a userInactiveDatabaseMBean.setUser(java.lang.String)
public java.lang.String getPassword()
getPassword
in interface ActiveDatabaseMBean
ActiveDatabaseMBean.getPassword()
public void setPassword(java.lang.String password)
InactiveDatabaseMBean
setPassword
in interface InactiveDatabaseMBean
password
- a passwordInactiveDatabaseMBean.setPassword(java.lang.String)
public int getWeight()
ActiveDatabaseMBean
getWeight
in interface ActiveDatabaseMBean
ActiveDatabaseMBean.getWeight()
public void setWeight(int weight)
InactiveDatabaseMBean
setWeight
in interface InactiveDatabaseMBean
weight
- a weightInactiveDatabaseMBean.setWeight(int)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.util.Properties getProperties()
ActiveDatabaseMBean
getProperties
in interface ActiveDatabaseMBean
ActiveDatabaseMBean.getProperties()
public void setProperties(java.util.Properties properties)
properties
- public void removeProperty(java.lang.String name)
InactiveDatabaseMBean
removeProperty
in interface InactiveDatabaseMBean
name
- a property nameInactiveDatabaseMBean.removeProperty(java.lang.String)
public void setProperty(java.lang.String name, java.lang.String value)
InactiveDatabaseMBean
setProperty
in interface InactiveDatabaseMBean
name
- a property namevalue
- a property valueInactiveDatabaseMBean.setProperty(java.lang.String, java.lang.String)
public void setLocal(boolean local)
InactiveDatabaseMBean
setLocal
in interface InactiveDatabaseMBean
local
- true if local, false if remoteInactiveDatabaseMBean.setLocal(boolean)
public boolean isLocal()
ActiveDatabaseMBean
isLocal
in interface ActiveDatabaseMBean
ActiveDatabaseMBean.isLocal()
public void clean()
clean
in interface Database<D>
Database.clean()
public boolean isDirty()
isDirty
in interface Database<D>
Database.isDirty()
protected void checkDirty(java.lang.Object oldValue, java.lang.Object newValue)
oldValue
- newValue
-