KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > trading > db > TypeDatabase


1
2 // Copyright (C) 1998-1999
3
// Object Oriented Concepts, Inc.
4

5 // **********************************************************************
6
//
7
// Copyright (c) 1997
8
// Mark Spruiell (mark@intellisoft.com)
9
//
10
// See the COPYING file for more information
11
//
12
// **********************************************************************
13

14 package org.jacorb.trading.db;
15
16 import java.util.*;
17 import org.omg.CosTradingRepos.ServiceTypeRepositoryPackage.*;
18
19
20 /**
21  * An abstract interface to the service type database
22  */

23 public interface TypeDatabase
24 {
25   /** One of these must be supplied to the begin() method */
26   public static final int READ = 0;
27   public static final int WRITE = 1;
28
29   /**
30    * Must precede any use of the database - may block if the
31    * requested lock is not available
32    */

33   public void begin(int mode);
34
35   /** Must follow any use of the database */
36   public void end();
37
38
39   /**
40    * Returns the TypeStruct for the type, or null if the
41    * the type doesn't exist
42    */

43   public TypeStruct describeType(String JavaDoc name);
44
45   /** Returns true if the type was found, false otherwise */
46   public boolean maskType(String JavaDoc name);
47
48   /** Returns true if the type was found, false otherwise */
49   public boolean unmaskType(String JavaDoc name);
50
51   /** Returns the names of all of the service types */
52   public String JavaDoc[] getTypes();
53
54   /**
55    * Returns the names of all of the service types whose incarnation
56    * is the same or greater than the given one
57    */

58   public String JavaDoc[] getTypesSince(IncarnationNumber inc);
59
60   /**
61    * Returns the current incarnation number (the one that will be
62    * assigned to the next service type)
63    */

64   public IncarnationNumber getIncarnation();
65
66   /** Creates a new service type */
67   public IncarnationNumber createType(
68     String JavaDoc name,
69     String JavaDoc interfaceName,
70     PropStruct[] props,
71     String JavaDoc[] superTypes);
72
73   /** Returns true if the type was found, false otherwise */
74   public boolean removeType(String JavaDoc name);
75
76   /**
77    * Returns the name of a subtype of the given type, or null if
78    * no subtypes were found
79    */

80   public String JavaDoc findSubType(String JavaDoc name);
81
82   /**
83    * Returns the names of all supertypes of the given type,
84    * or null if the type wasn't found
85    */

86   public String JavaDoc[] getAllSuperTypes(String JavaDoc name);
87 }
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Popular Tags