001: /*
002:
003: Derby - Class org.apache.derby.catalog.Dependable
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to You under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.catalog;
023:
024: /**
025:
026: * A Dependable is an in-memory representation of an object managed
027: * by the Dependency System.
028: *
029: * There are two kinds of Dependables:
030: * Providers and Dependents. Dependents depend on Providers and
031: * are responsible for executing compensating logic when their
032: * Providers change.
033: * <P>
034: * The fields represent the known Dependables.
035: * <P>
036: * Persistent dependencies (those between database objects) are
037: * stored in SYS.SYSDEPENDS.
038: *
039: * @see org.apache.derby.catalog.DependableFinder
040: */
041: public interface Dependable {
042: /*
043: * Universe of known Dependables.
044: */
045:
046: public static final String ALIAS = "Alias";
047: public static final String CONGLOMERATE = "Conglomerate";
048: public static final String CONSTRAINT = "Constraint";
049: public static final String DEFAULT = "Default";
050: public static final String HEAP = "Heap";
051: public static final String INDEX = "Index";
052: public static final String PREPARED_STATEMENT = "PreparedStatement";
053: public static final String FILE = "File";
054: public static final String STORED_PREPARED_STATEMENT = "StoredPreparedStatement";
055: public static final String TABLE = "Table";
056: public static final String COLUMNS_IN_TABLE = "ColumnsInTable";
057: public static final String TRIGGER = "Trigger";
058: public static final String VIEW = "View";
059: public static final String SCHEMA = "Schema";
060: public static final String TABLE_PERMISSION = "TablePrivilege";
061: public static final String COLUMNS_PERMISSION = "ColumnsPrivilege";
062: public static final String ROUTINE_PERMISSION = "RoutinePrivilege";
063:
064: /**
065: * Get an object which can be written to disk and which,
066: * when read from disk, will find or reconstruct this in-memory
067: * Dependable.
068: *
069: * @return A Finder object that can be written to disk if this is a
070: * Persistent Dependable.
071: * Null if this is not a persistent dependable.
072: */
073: public DependableFinder getDependableFinder();
074:
075: /**
076: * Get the name of this Dependable OBJECT. This is useful
077: * for diagnostic messages.
078: *
079: * @return Name of Dependable OBJECT.
080: */
081: public String getObjectName();
082:
083: /**
084: * Get the UUID of this Dependable OBJECT.
085: *
086: * @return UUID of this OBJECT.
087: */
088: public UUID getObjectID();
089:
090: /**
091: * Return whether or not this Dependable is persistent. Persistent
092: * dependencies are stored in SYS.SYSDEPENDS.
093: *
094: * @return true if this Dependable is persistent.
095: */
096: public boolean isPersistent();
097:
098: /**
099: * Get the unique class id for the Dependable.
100: * Every Dependable belongs to a class of Dependables.
101: *
102: * @return type of this Dependable.
103: */
104: public String getClassType();
105: }
|