|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--arlut.csd.ganymede.DBSchemaEdit
Server-side schema editing class. This class implements the
SchemaEdit remote interface to support
schema editing by the admin console.
Only one DBSchemaEdit object may be active in the server at a time; only
one admin console can edit the server's schema at a time. While the server's
schema is being edited, no users may be logged on to
the system. An admin console puts the server into schema-editing mode by calling the
editSchema() method on
a server-side GanymedeAdmin object.
When the DBSchemaEdit object is created, it makes copies of all of the
DBObjectBase type definition objects
in the server. The admin console can then talk to those DBObjectBase objects
remotely by way of the Base remote interface,
accessing data fields, reordering the type tree visible in the client, and
so forth.
When the user has made the desired changes, the
commit() method is called,
which replaces the set of DBObjectBase objects held in the server's
DBStore with the modified set that was
created and modified by DBSchemaEdit.
The schema editing code in the server currently has only a limited ability to verify that changes made in the schema editor will not break the database's consistency constraints in some fashion. Generally speaking, you should be using the schema editor to define new fields, or to change field definitions for fields that are not yet in use in the database, not to try to redefine parts of the database that are in actual use and which hold actual data.
The schema editing system is really the most fragile thing in the Ganymede server. It generally works, but it is not as robust as it ought to be. It's always a good idea to make a backup copy of your ganymede.db file before going in and editing your database schema.
| Field Summary | |
(package private) Admin |
console
remote client handle |
(package private) static boolean |
debug
|
private boolean |
locked
if true, this DBSchemaEdit object has already been committed or aborted |
(package private) java.util.Hashtable |
newBases
this holds a copy of the DBObjectBase objects comprising the DBStore's database. |
(package private) java.util.Vector |
oldNameSpaces
this holds the original vector of namespace objects extant at the time the DBSchemaEdit editing session is established. |
(package private) DBBaseCategory |
rootCategory
root node of the working DBBaseCategory tree.. |
(package private) DBStore |
store
the DBStore object whose DBObjectBases are being edited |
| Fields inherited from class java.rmi.server.UnicastRemoteObject |
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf |
| Fields inherited from class java.rmi.server.RemoteServer |
log, logname |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
DBSchemaEdit(Admin console)
Constructor. |
|
| Method Summary | |
void |
commit()
Commit this schema edit, instantiate the modified schema |
Base |
createNewBase(Category category,
boolean embedded,
boolean lowRange)
This method creates a new DBObjectBase object and returns
a remote handle to it so that the admin client can set fields on
the base, set attributes, and generally make a nuisance of
itself. |
Base |
createNewBase(Category category,
boolean embedded,
short id)
This method creates a new DBObjectBase object and returns
a remote handle to it so that the admin client can set fields on
the base, set attributes, and generally make a nuisance of
itself. |
NameSpace |
createNewNameSpace(java.lang.String name,
boolean caseInsensitive)
This method creates a new DBNameSpace
object and returns a remote handle
to it so that the admin client can set attributes on the DBNameSpace,
and generally make a nuisance of itself. |
ReturnVal |
deleteBase(java.lang.String baseName)
This method deletes a DBObjectBase, removing it from the
Schema Editor's working set of bases. |
ReturnVal |
deleteNameSpace(java.lang.String name)
This method deletes a DBNameSpace object, returning true if
the deletion could be carried out, false otherwise. |
Base |
getBase(short id)
Returns a Base reference to match the id, or
null if no match. |
Base |
getBase(java.lang.String baseName)
Returns a Base reference to match the baseName,
or null if no match. |
Base[] |
getBases()
Returns a list of bases from the current (non-committed) state of the system. |
Base[] |
getBases(boolean embedded)
Returns a list of bases from the current (non-committed) state of the system. |
CategoryNode |
getCategoryNode(java.lang.String pathName)
Method to get a category from the category list, by it's full path name. |
NameSpace |
getNameSpace(java.lang.String name)
This method returns a NameSpace by matching name,
or null if no match is found. |
NameSpace[] |
getNameSpaces()
This method returns an array of defined NameSpace objects. |
Category |
getRootCategory()
Returns the root category node from the server |
void |
release()
Abort this schema edit, return the schema to its prior state. |
void |
unreferenced()
This method is called when the client loses connection. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub, writeObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait |
| Field Detail |
static final boolean debug
private boolean locked
DBStore store
java.util.Hashtable newBases
java.util.Vector oldNameSpaces
DBBaseCategory rootCategory
Admin console
| Constructor Detail |
public DBSchemaEdit(Admin console)
throws java.rmi.RemoteException
Constructor. This constructor should only be called in
a critical section synchronized on the primary
DBStore object.
| Method Detail |
public Category getRootCategory()
Returns the root category node from the server
getRootCategory in interface SchemaEditSchemaEditpublic CategoryNode getCategoryNode(java.lang.String pathName)
public Base[] getBases(boolean embedded)
Returns a list of bases from the current (non-committed) state of the system.
getBases in interface SchemaEditembedded - If true, getBases() will only show bases that are intended
for embedding in other objects. If false, getBases() will only show bases
that are not to be embedded.SchemaEditpublic Base[] getBases()
Returns a list of bases from the current (non-committed) state of the system.
getBases in interface SchemaEditSchemaEditpublic Base getBase(short id)
Returns a Base reference to match the id, or
null if no match.
getBase in interface SchemaEditSchemaEditpublic Base getBase(java.lang.String baseName)
Returns a Base reference to match the baseName,
or null if no match.
getBase in interface SchemaEditSchemaEdit
public Base createNewBase(Category category,
boolean embedded,
boolean lowRange)
This method creates a new DBObjectBase object and returns
a remote handle to it so that the admin client can set fields on
the base, set attributes, and generally make a nuisance of
itself.
createNewBase in interface SchemaEditSchemaEdit
public Base createNewBase(Category category,
boolean embedded,
short id)
This method creates a new DBObjectBase object and returns
a remote handle to it so that the admin client can set fields on
the base, set attributes, and generally make a nuisance of
itself.
public ReturnVal deleteBase(java.lang.String baseName)
throws java.rmi.RemoteException
This method deletes a DBObjectBase, removing it from the
Schema Editor's working set of bases. The removal won't
take place for real unless the SchemaEdit is committed.
deleteBase in interface SchemaEditSchemaEditpublic NameSpace[] getNameSpaces()
This method returns an array of defined
NameSpace objects.
getNameSpaces in interface SchemaEditSchemaEditpublic NameSpace getNameSpace(java.lang.String name)
This method returns a NameSpace by matching name,
or null if no match is found.
getNameSpace in interface SchemaEditNameSpace,
SchemaEdit
public NameSpace createNewNameSpace(java.lang.String name,
boolean caseInsensitive)
This method creates a new DBNameSpace
object and returns a remote handle
to it so that the admin client can set attributes on the DBNameSpace,
and generally make a nuisance of itself.
createNewNameSpace in interface SchemaEditSchemaEditpublic ReturnVal deleteNameSpace(java.lang.String name)
This method deletes a
DBNameSpace object, returning true if
the deletion could be carried out, false otherwise.
deleteNameSpace in interface SchemaEditSchemaEditpublic void commit()
Commit this schema edit, instantiate the modified schema
It is an error to attempt any schema editing operations after this method has been called.
commit in interface SchemaEditpublic void release()
Abort this schema edit, return the schema to its prior state.
It is an error to attempt any schema editing operations after this method has been called.
release in interface SchemaEditpublic void unreferenced()
unreferenced in interface java.rmi.server.Unreferenced
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||