クラス org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema

org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchemaのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

説明

A SchedulerDatabaseSchema describes all the tables and columns of a database and its associated cache entries.

作者:
Emmanuel Cecchet
バージョン:
1.0

SchedulerDatabaseSchema.java41 行で定義されています。

Public メソッド

 SchedulerDatabaseSchema (DatabaseSchema schema)
void addTable (SchedulerDatabaseTable table)
void removeTable (SchedulerDatabaseTable table)
void mergeSchema (SchedulerDatabaseSchema databaseSchema) throws SQLException
ArrayList getTables ()
SchedulerDatabaseTable getTable (String tableName)
boolean hasTable (String tableName)
TransactionExclusiveLock getLock ()
boolean equals (Object other)
String getInformation (boolean longFormat)

Private 変数

ArrayList tables
TransactionExclusiveLock lock = new TransactionExclusiveLock()


コンストラクタとデストラクタ

org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.SchedulerDatabaseSchema DatabaseSchema  schema  ) 
 

Creates a new SchedulerDatabaseSchema instance by cloning an existing DatabaseSchema.

引数:
schema the database schema to clone

SchedulerDatabaseSchema.java54 行で定義されています。

参照先 org.objectweb.cjdbc.common.sql.schema.DatabaseSchema.getTables().

00055   {
00056     if (schema == null)
00057     {
00058       tables = new ArrayList();
00059       return;
00060     }
00061 
00062     // Clone the tables
00063     ArrayList origTables = schema.getTables();
00064     int size = origTables.size();
00065     tables = new ArrayList(size);
00066     for (int i = 0; i < size; i++)
00067       tables.add(new SchedulerDatabaseTable((DatabaseTable) origTables.get(i)));
00068   }


メソッド

void org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.addTable SchedulerDatabaseTable  table  ) 
 

Adds a SchedulerDatabaseTable describing a table of the database.

引数:
table the table to add

SchedulerDatabaseSchema.java76 行で定義されています。

参照元 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.mergeSchema(), org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.notifyWriteCompleted(), と org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.setDatabaseSchema().

00077   {
00078     tables.add(table);
00079   }

boolean org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.equals Object  other  ) 
 

Two SchedulerDatabaseSchema are equals if they have the same tables.

引数:
other the object to compare with
戻り値:
true if the objects are the same

SchedulerDatabaseSchema.java188 行で定義されています。

参照先 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getTables().

00189   {
00190     if (!(other instanceof SchedulerDatabaseSchema))
00191       return false;
00192 
00193     if (tables == null)
00194       return ((SchedulerDatabaseSchema) other).getTables() == null;
00195     else
00196       return tables.equals(((SchedulerDatabaseSchema) other).getTables());
00197   }

String org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getInformation boolean  longFormat  ) 
 

Returns information about the database schema.

引数:
longFormat true for a long format, false for a short summary
戻り値:
a String value

SchedulerDatabaseSchema.java206 行で定義されています。

参照先 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getInformation().

00207   {
00208     StringBuffer result = new StringBuffer();
00209     SchedulerDatabaseTable t;
00210     int size = tables.size();
00211     for (int i = 0; i < size; i++)
00212     {
00213       t = (SchedulerDatabaseTable) tables.get(i);
00214       result.append(t.getInformation(longFormat));
00215       result.append(System.getProperty("line.separator"));
00216     }
00217     return result.toString();
00218   }

TransactionExclusiveLock org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getLock  ) 
 

Returns the lock for this table.

戻り値:
a TransactionExclusiveLock instance
参照:
TransactionExclusiveLock

SchedulerDatabaseSchema.java176 行で定義されています。

00177   {
00178     return lock;
00179   }

SchedulerDatabaseTable org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getTable String  tableName  ) 
 

Returns the SchedulerDatabaseTable object matching the given table name or null if not found.

引数:
tableName the table name to look for
戻り値:
a SchedulerDatabaseTable value or null

SchedulerDatabaseSchema.java138 行で定義されています。

参照先 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getName().

参照元 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.mergeSchema(), org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.notifyWriteCompleted(), と org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.scheduleNonSuspendedWriteRequest().

00139   {
00140     SchedulerDatabaseTable t;
00141     int size = tables.size();
00142     for (int i = 0; i < size; i++)
00143     {
00144       t = (SchedulerDatabaseTable) tables.get(i);
00145       if (tableName.compareTo(t.getName()) == 0)
00146         return t;
00147     }
00148     return null;
00149   }

ArrayList org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getTables  ) 
 

Returns an ArrayList of SchedulerDatabaseTable objects describing the database.

戻り値:
an ArrayList of SchedulerDatabaseTable

SchedulerDatabaseSchema.java126 行で定義されています。

参照元 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.equals(), org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.releaseLocks(), org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.scheduleNonSuspendedWriteRequest(), と org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.setDatabaseSchema().

00127   {
00128     return tables;
00129   }

boolean org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.hasTable String  tableName  ) 
 

Returns true if the given TableName is found in this schema.

引数:
tableName the name of the table you are looking for
戻り値:
true if the table has been found

SchedulerDatabaseSchema.java158 行で定義されています。

参照先 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getName().

参照元 org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.setDatabaseSchema().

00159   {
00160     int size = tables.size();
00161     for (int i = 0; i < size; i++)
00162     {
00163       SchedulerDatabaseTable t = (SchedulerDatabaseTable) tables.get(i);
00164       if (tableName.equals(t.getName()))
00165         return true;
00166     }
00167     return false;
00168   }

void org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.mergeSchema SchedulerDatabaseSchema  databaseSchema  )  throws SQLException
 

Merge the given schema with the current one. All missing tables are added if no conflict is detected. An exception is thrown if the given schema definition conflicts with the current one.

引数:
databaseSchema the schema to merge
例外:
SQLException if the schemas conflict

SchedulerDatabaseSchema.java100 行で定義されています。

参照先 org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.addTable(), org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getName(), と org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getTable().

参照元 org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.mergeDatabaseSchema().

00102   {
00103     if (databaseSchema == null)
00104       return;
00105 
00106     ArrayList otherTables = databaseSchema.getTables();
00107     if (otherTables == null)
00108       return;
00109 
00110     int size = otherTables.size();
00111     for (int i = 0; i < size; i++)
00112     {
00113       SchedulerDatabaseTable t = (SchedulerDatabaseTable) otherTables.get(i);
00114       SchedulerDatabaseTable original = getTable(t.getName());
00115       if (original == null)
00116         addTable(t);
00117     }
00118   }

void org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.removeTable SchedulerDatabaseTable  table  ) 
 

Removes a SchedulerDatabaseTable describing a table of the database.

引数:
table the table to remove

SchedulerDatabaseSchema.java87 行で定義されています。

参照元 org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.notifyWriteCompleted(), と org.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1OptimisticTransactionLevelScheduler.setDatabaseSchema().

00088   {
00089     tables.remove(table);
00090   }


変数

TransactionExclusiveLock org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.lock = new TransactionExclusiveLock() [private]
 

SchedulerDatabaseSchema.java46 行で定義されています。

ArrayList org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.tables [private]
 

ArrayList of SchedulerDatabaseTable.

SchedulerDatabaseSchema.java44 行で定義されています。


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0rc6に対してWed May 5 18:03:03 2004に生成されました。 doxygen 1.3.6