NamingContextDataStore.java revision 608:7e06bf1dcb09
1/*
2 * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.corba.se.impl.naming.cosnaming;
27
28// Import general CORBA classes
29import org.omg.CORBA.Object;
30
31// Import org.omg.CosNaming classes
32import org.omg.CosNaming.BindingType;
33import org.omg.CosNaming.BindingTypeHolder;
34import org.omg.CosNaming.BindingListHolder;
35import org.omg.CosNaming.BindingIteratorHolder;
36import org.omg.CosNaming.NameComponent;
37import org.omg.CosNaming.NamingContext;
38import org.omg.PortableServer.POA;
39
40/**
41 * This interface defines a set of methods that must be implemented by the
42 * "data store" associated with a NamingContext implementation.
43 * It allows for different implementations of naming contexts that
44 * support the same API but differ in storage mechanism.
45 */
46public interface NamingContextDataStore {
47    /**
48     * Method which implements binding a name to an object as
49     * the specified binding type.
50     * @param n a NameComponent which is the name under which the object
51     * will be bound.
52     * @param obj the object reference to be bound.
53     * @param bt Type of binding (as object or as context).
54     * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
55     */
56    void Bind(NameComponent n, org.omg.CORBA.Object obj, BindingType bt)
57        throws org.omg.CORBA.SystemException;
58
59    /**
60     * Method which implements resolving the specified name,
61     * returning the type of the binding and the bound object reference.
62     * If the id and kind of the NameComponent are both empty, the initial
63     * naming context (i.e., the local root) must be returned.
64     * @param n a NameComponent which is the name to be resolved.
65     * @param bth the BindingType as an out parameter.
66     * @return the object reference bound under the supplied name.
67     * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
68     */
69    org.omg.CORBA.Object Resolve(NameComponent n,BindingTypeHolder bth)
70        throws org.omg.CORBA.SystemException;
71
72    /**
73     * Method which implements unbinding a name.
74     * @return the object reference bound to the name, or null if not found.
75     * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
76     */
77    org.omg.CORBA.Object Unbind(NameComponent n)
78        throws org.omg.CORBA.SystemException;
79
80    /**
81     * Method which implements listing the contents of this
82     * NamingContext and return a binding list and a binding iterator.
83     * @param how_many The number of requested bindings in the BindingList.
84     * @param bl The BindingList as an out parameter.
85     * @param bi The BindingIterator as an out parameter.
86     * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
87     */
88    void List(int how_many, BindingListHolder bl, BindingIteratorHolder bi)
89        throws org.omg.CORBA.SystemException;
90
91    /**
92     * Method which implements creating a new NamingContext.
93     * @return an object reference for a new NamingContext object implemented
94     * by this Name Server.
95     * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
96     */
97    NamingContext NewContext()
98        throws org.omg.CORBA.SystemException;
99
100    /**
101     * Method which implements destroying this NamingContext.
102     * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
103     */
104    void Destroy()
105        throws org.omg.CORBA.SystemException;
106
107    /**
108     * Method which returns whether this NamingContext is empty
109     * or not.
110     * @return true if this NamingContext contains no bindings.
111     */
112    boolean IsEmpty();
113
114    POA getNSPOA( );
115}
116