KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > dictionary > DependencyDescriptor


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.dictionary.DependencyDescriptor
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.sql.dictionary;
23
24 import org.apache.derby.catalog.UUID;
25
26 import org.apache.derby.iapi.reference.SQLState;
27 import org.apache.derby.iapi.services.sanity.SanityManager;
28 import org.apache.derby.iapi.sql.StatementType;
29 import org.apache.derby.catalog.DependableFinder;
30 import org.apache.derby.catalog.Dependable;
31 import org.apache.derby.iapi.services.io.StoredFormatIds;
32 import org.apache.derby.iapi.error.StandardException;
33 import org.apache.derby.iapi.sql.depend.DependencyManager;
34 import org.apache.derby.iapi.sql.depend.Dependent;
35 import org.apache.derby.iapi.sql.depend.Dependency;
36 import org.apache.derby.iapi.sql.depend.Provider;
37
38 /**
39  * This interface is used to get information from a DependencyDescriptor.
40  *
41  * @version 0.1
42  * @author Jerry Brenner
43  */

44
45 public class DependencyDescriptor extends TupleDescriptor
46     implements UniqueTupleDescriptor
47 {
48     /** public interface for this class is:
49         <ol>
50         <li>public DependableFinder getDependentFinder();</li>
51         <li>public UUID getProviderID();</li>
52         <li>public DependableFinder getProviderFinder();</li>
53         </ol>
54     */

55
56     // implementation
57
private final UUID dependentID;
58     private final DependableFinder dependentBloodhound;
59     private final UUID providerID;
60     private final DependableFinder providerBloodhound;
61
62     /**
63      * Constructor for a DependencyDescriptor
64      *
65      * @param dependent The Dependent
66      * @param provider The Provider
67      */

68
69     public DependencyDescriptor(
70             Dependent dependent,
71             Provider provider
72             )
73     {
74         dependentID = dependent.getObjectID();
75         dependentBloodhound = dependent.getDependableFinder();
76         providerID = provider.getObjectID();
77         providerBloodhound = provider.getDependableFinder();
78     }
79
80     /**
81      * Constructor for a DependencyDescriptor
82      *
83      * @param dependentID The Dependent ID
84      * @param dependentBloodhound The bloodhound for finding the Dependent
85      * @param providerID The Provider ID
86      * @param providerBloodhound The bloodhound for finding the Provider
87      */

88
89     public DependencyDescriptor(
90             UUID dependentID, DependableFinder dependentBloodhound,
91             UUID providerID, DependableFinder providerBloodhound
92             )
93     {
94         this.dependentID = dependentID;
95         this.dependentBloodhound = dependentBloodhound;
96         this.providerID = providerID;
97         this.providerBloodhound = providerBloodhound;
98     }
99
100     // DependencyDescriptor interface
101

102     /**
103      * Get the dependent's ID for the dependency.
104      *
105      * @return The dependent's ID.
106      */

107     public UUID getUUID()
108     {
109         return dependentID;
110     }
111
112     /**
113      * Get the dependent's type for the dependency.
114      *
115      * @return The dependent's type.
116      */

117     public DependableFinder getDependentFinder()
118     {
119         return dependentBloodhound;
120     }
121
122     /**
123      * Get the provider's ID for the dependency.
124      *
125      * @return The provider's ID.
126      */

127     public UUID getProviderID()
128     {
129         return providerID;
130     }
131
132     /**
133      * Get the provider's type for the dependency.
134      *
135      * @return The provider's type.
136      */

137     public DependableFinder getProviderFinder()
138     {
139         return providerBloodhound;
140     }
141 }
142
Popular Tags