1. /*
  2. * @(#)NamingContextDataStore.java 1.20 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.impl.naming.cosnaming;
  8. // Import general CORBA classes
  9. import org.omg.CORBA.Object;
  10. // Import org.omg.CosNaming classes
  11. import org.omg.CosNaming.BindingType;
  12. import org.omg.CosNaming.BindingTypeHolder;
  13. import org.omg.CosNaming.BindingListHolder;
  14. import org.omg.CosNaming.BindingIteratorHolder;
  15. import org.omg.CosNaming.NameComponent;
  16. import org.omg.CosNaming.NamingContext;
  17. import org.omg.PortableServer.POA;
  18. /**
  19. * This interface defines a set of methods that must be implemented by the
  20. * "data store" associated with a NamingContext implementation.
  21. * It allows for different implementations of naming contexts that
  22. * support the same API but differ in storage mechanism.
  23. */
  24. public interface NamingContextDataStore {
  25. /**
  26. * Method which implements binding a name to an object as
  27. * the specified binding type.
  28. * @param n a NameComponent which is the name under which the object
  29. * will be bound.
  30. * @param obj the object reference to be bound.
  31. * @param bt Type of binding (as object or as context).
  32. * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  33. */
  34. void Bind(NameComponent n, org.omg.CORBA.Object obj, BindingType bt)
  35. throws org.omg.CORBA.SystemException;
  36. /**
  37. * Method which implements resolving the specified name,
  38. * returning the type of the binding and the bound object reference.
  39. * If the id and kind of the NameComponent are both empty, the initial
  40. * naming context (i.e., the local root) must be returned.
  41. * @param n a NameComponent which is the name to be resolved.
  42. * @param bth the BindingType as an out parameter.
  43. * @return the object reference bound under the supplied name.
  44. * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  45. */
  46. org.omg.CORBA.Object Resolve(NameComponent n,BindingTypeHolder bth)
  47. throws org.omg.CORBA.SystemException;
  48. /**
  49. * Method which implements unbinding a name.
  50. * @return the object reference bound to the name, or null if not found.
  51. * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  52. */
  53. org.omg.CORBA.Object Unbind(NameComponent n)
  54. throws org.omg.CORBA.SystemException;
  55. /**
  56. * Method which implements listing the contents of this
  57. * NamingContext and return a binding list and a binding iterator.
  58. * @param how_many The number of requested bindings in the BindingList.
  59. * @param bl The BindingList as an out parameter.
  60. * @param bi The BindingIterator as an out parameter.
  61. * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  62. */
  63. void List(int how_many, BindingListHolder bl, BindingIteratorHolder bi)
  64. throws org.omg.CORBA.SystemException;
  65. /**
  66. * Method which implements creating a new NamingContext.
  67. * @return an object reference for a new NamingContext object implemented
  68. * by this Name Server.
  69. * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  70. */
  71. NamingContext NewContext()
  72. throws org.omg.CORBA.SystemException;
  73. /**
  74. * Method which implements destroying this NamingContext.
  75. * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
  76. */
  77. void Destroy()
  78. throws org.omg.CORBA.SystemException;
  79. /**
  80. * Method which returns whether this NamingContext is empty
  81. * or not.
  82. * @return true if this NamingContext contains no bindings.
  83. */
  84. boolean IsEmpty();
  85. POA getNSPOA( );
  86. }