1 | /* |
2 | |
3 | Derby - Class org.apache.derby.iapi.sql.dictionary.DependencyDescriptor |
4 | |
5 | Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.iapi.sql.dictionary; |
22 | |
23 | import org.apache.derby.catalog.UUID; |
24 | |
25 | import org.apache.derby.iapi.reference.SQLState; |
26 | import org.apache.derby.iapi.services.sanity.SanityManager; |
27 | import org.apache.derby.iapi.sql.StatementType; |
28 | import org.apache.derby.catalog.DependableFinder; |
29 | import org.apache.derby.catalog.Dependable; |
30 | import org.apache.derby.iapi.services.io.StoredFormatIds; |
31 | import org.apache.derby.iapi.error.StandardException; |
32 | import org.apache.derby.iapi.sql.depend.DependencyManager; |
33 | import org.apache.derby.iapi.sql.depend.Dependent; |
34 | import org.apache.derby.iapi.sql.depend.Dependency; |
35 | import org.apache.derby.iapi.sql.depend.Provider; |
36 | |
37 | /** |
38 | * This interface is used to get information from a DependencyDescriptor. |
39 | * |
40 | * @version 0.1 |
41 | * @author Jerry Brenner |
42 | */ |
43 | |
44 | public class DependencyDescriptor extends TupleDescriptor |
45 | implements UniqueTupleDescriptor |
46 | { |
47 | /** public interface for this class is: |
48 | <ol> |
49 | <li>public DependableFinder getDependentFinder();</li> |
50 | <li>public UUID getProviderID();</li> |
51 | <li>public DependableFinder getProviderFinder();</li> |
52 | </ol> |
53 | */ |
54 | |
55 | // implementation |
56 | private UUID dependentID; |
57 | private DependableFinder dependentBloodhound; |
58 | private UUID providerID; |
59 | private DependableFinder providerBloodhound; |
60 | |
61 | /** |
62 | * Constructor for a DependencyDescriptor |
63 | * |
64 | * @param dependent The Dependent |
65 | * @param provider The Provider |
66 | */ |
67 | |
68 | public DependencyDescriptor( |
69 | Dependent dependent, |
70 | Provider provider |
71 | ) |
72 | { |
73 | dependentID = dependent.getObjectID(); |
74 | dependentBloodhound = dependent.getDependableFinder(); |
75 | providerID = provider.getObjectID(); |
76 | providerBloodhound = provider.getDependableFinder(); |
77 | } |
78 | |
79 | /** |
80 | * Constructor for a DependencyDescriptor |
81 | * |
82 | * @param dependentID The Dependent ID |
83 | * @param dependentBloodhound The bloodhound for finding the Dependent |
84 | * @param providerID The Provider ID |
85 | * @param providerBloodhound The bloodhound for finding the Provider |
86 | */ |
87 | |
88 | public DependencyDescriptor( |
89 | UUID dependentID, DependableFinder dependentBloodhound, |
90 | UUID providerID, DependableFinder providerBloodhound |
91 | ) |
92 | { |
93 | this.dependentID = dependentID; |
94 | this.dependentBloodhound = dependentBloodhound; |
95 | this.providerID = providerID; |
96 | this.providerBloodhound = providerBloodhound; |
97 | } |
98 | |
99 | // DependencyDescriptor interface |
100 | |
101 | /** |
102 | * Get the dependent's ID for the dependency. |
103 | * |
104 | * @return The dependent's ID. |
105 | */ |
106 | public UUID getUUID() |
107 | { |
108 | return dependentID; |
109 | } |
110 | |
111 | /** |
112 | * Get the dependent's type for the dependency. |
113 | * |
114 | * @return The dependent's type. |
115 | */ |
116 | public DependableFinder getDependentFinder() |
117 | { |
118 | return dependentBloodhound; |
119 | } |
120 | |
121 | /** |
122 | * Get the provider's ID for the dependency. |
123 | * |
124 | * @return The provider's ID. |
125 | */ |
126 | public UUID getProviderID() |
127 | { |
128 | return providerID; |
129 | } |
130 | |
131 | /** |
132 | * Get the provider's type for the dependency. |
133 | * |
134 | * @return The provider's type. |
135 | */ |
136 | public DependableFinder getProviderFinder() |
137 | { |
138 | return providerBloodhound; |
139 | } |
140 | } |