summaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/naming/directory
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/naming/directory')
-rw-r--r--libjava/classpath/javax/naming/directory/Attribute.java70
-rw-r--r--libjava/classpath/javax/naming/directory/AttributeInUseException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/AttributeModificationException.java78
-rw-r--r--libjava/classpath/javax/naming/directory/Attributes.java61
-rw-r--r--libjava/classpath/javax/naming/directory/BasicAttribute.java358
-rw-r--r--libjava/classpath/javax/naming/directory/BasicAttributes.java284
-rw-r--r--libjava/classpath/javax/naming/directory/DirContext.java103
-rw-r--r--libjava/classpath/javax/naming/directory/InitialDirContext.java272
-rw-r--r--libjava/classpath/javax/naming/directory/InvalidAttributeIdentifierException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/InvalidAttributeValueException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/InvalidAttributesException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/InvalidSearchControlsException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/InvalidSearchFilterException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/ModificationItem.java81
-rw-r--r--libjava/classpath/javax/naming/directory/NoSuchAttributeException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/SchemaViolationException.java56
-rw-r--r--libjava/classpath/javax/naming/directory/SearchControls.java138
-rw-r--r--libjava/classpath/javax/naming/directory/SearchResult.java95
-rw-r--r--libjava/classpath/javax/naming/directory/package.html46
19 files changed, 2034 insertions, 0 deletions
diff --git a/libjava/classpath/javax/naming/directory/Attribute.java b/libjava/classpath/javax/naming/directory/Attribute.java
new file mode 100644
index 000000000..d29e1eae0
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/Attribute.java
@@ -0,0 +1,70 @@
+/* Attribute.java --
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import java.io.Serializable;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+/**
+ * @author Warren Levy (warrenl@redhat.com)
+ * @date June 14, 2001
+ */
+public interface Attribute extends Cloneable, Serializable
+{
+ long serialVersionUID = 8707690322213556804L;
+
+ NamingEnumeration<?> getAll() throws NamingException;
+ Object get() throws NamingException;
+ int size();
+ String getID();
+ boolean contains(Object attrVal);
+ boolean add(Object attrVal);
+ boolean remove(Object attrval);
+ void clear();
+ DirContext getAttributeSyntaxDefinition() throws NamingException;
+ DirContext getAttributeDefinition() throws NamingException;
+ Object clone();
+ boolean isOrdered();
+ Object get(int ix) throws NamingException;
+ Object remove(int ix);
+ void add(int ix, Object attrVal);
+ Object set(int ix, Object attrVal);
+}
diff --git a/libjava/classpath/javax/naming/directory/AttributeInUseException.java b/libjava/classpath/javax/naming/directory/AttributeInUseException.java
new file mode 100644
index 000000000..08f337c5c
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/AttributeInUseException.java
@@ -0,0 +1,56 @@
+/* AttributeInUseException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class AttributeInUseException extends NamingException
+{
+ private static final long serialVersionUID = 4437710305529322564L;
+
+ public AttributeInUseException ()
+ {
+ super ();
+ }
+
+ public AttributeInUseException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/AttributeModificationException.java b/libjava/classpath/javax/naming/directory/AttributeModificationException.java
new file mode 100644
index 000000000..9614bac13
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/AttributeModificationException.java
@@ -0,0 +1,78 @@
+/* AttributeModificationException.java --
+ Copyright (C) 2001, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+/**
+ * @author Warren Levy (warrenl@redhat.com)
+ * @date June 14, 2001
+ */
+
+public class AttributeModificationException extends NamingException
+{
+ private static final long serialVersionUID = 8060676069678710186L;
+ // Serialized fields.
+ private ModificationItem[] unexecs;
+
+ public AttributeModificationException ()
+ {
+ super ();
+ }
+
+ public AttributeModificationException (String msg)
+ {
+ super (msg);
+ }
+
+ public void setUnexecutedModifications(ModificationItem[] e)
+ {
+ unexecs = e;
+ }
+
+ public ModificationItem[] getUnexecutedModifications()
+ {
+ return unexecs;
+ }
+
+ public String toString()
+ {
+ return super.toString () + ": " + unexecs[0].toString ();
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/Attributes.java b/libjava/classpath/javax/naming/directory/Attributes.java
new file mode 100644
index 000000000..50df17c2d
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/Attributes.java
@@ -0,0 +1,61 @@
+/* Attributes.java --
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import java.io.Serializable;
+
+import javax.naming.NamingEnumeration;
+
+/**
+ * @author Warren Levy (warrenl@redhat.com)
+ * @date June 14, 2001
+ */
+
+public interface Attributes extends Cloneable, Serializable
+{
+ boolean isCaseIgnored();
+ int size();
+ Attribute get(String attrID);
+ NamingEnumeration<? extends Attribute> getAll();
+ NamingEnumeration<String> getIDs();
+ Attribute put(String attrID, Object val);
+ Attribute put(Attribute attr);
+ Attribute remove(String attrID);
+ Object clone();
+}
diff --git a/libjava/classpath/javax/naming/directory/BasicAttribute.java b/libjava/classpath/javax/naming/directory/BasicAttribute.java
new file mode 100644
index 000000000..65b44169e
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/BasicAttribute.java
@@ -0,0 +1,358 @@
+/* BasicAttribute.java --
+ Copyright (C) 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @date June 20, 2001
+ * @since 1.3
+ */
+public class BasicAttribute implements Attribute
+{
+ private static final long serialVersionUID = 6743528196119291326L;
+
+ /** The ID of this attribute. */
+ protected String attrID;
+ /** True if this attribute's values are ordered. */
+ protected boolean ordered;
+ /** Values for this attribute. */
+ protected transient Vector<Object> values;
+
+ // Used by cloning.
+ private BasicAttribute ()
+ {
+ }
+
+ public BasicAttribute (String id)
+ {
+ this (id, false);
+ }
+
+ public BasicAttribute (String id, boolean ordered)
+ {
+ attrID = id;
+ this.ordered = ordered;
+ values = new Vector<Object> ();
+ }
+
+ public BasicAttribute (String id, Object value)
+ {
+ this (id, value, false);
+ }
+
+ public BasicAttribute (String id, Object value, boolean ordered)
+ {
+ attrID = id;
+ this.ordered = ordered;
+ values = new Vector<Object> ();
+ values.add (value);
+ }
+
+ public void add (int index, Object val)
+ {
+ if (! ordered && contains (val))
+ throw new IllegalStateException ("value already in attribute");
+ values.add (index, val);
+ }
+
+ public boolean add (Object val)
+ {
+ if (! ordered && contains (val))
+ throw new IllegalStateException ("value already in attribute");
+ return values.add (val);
+ }
+
+ public void clear ()
+ {
+ values.clear ();
+ }
+
+ public Object clone ()
+ {
+ BasicAttribute c = new BasicAttribute ();
+ c.attrID = attrID;
+ c.ordered = ordered;
+ c.values = (Vector<Object>) values.clone ();
+ return c;
+ }
+
+ public boolean contains (Object val)
+ {
+ for (int i = 0; i < values.size (); ++i)
+ {
+ if (equals (val, values.get (i)))
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean equals (Object obj)
+ {
+ if (! (obj instanceof BasicAttribute))
+ return false;
+ BasicAttribute b = (BasicAttribute) obj;
+
+ if (ordered != b.ordered
+ || ! attrID.equals (b.attrID)
+ || values.size () != b.values.size ())
+ return false;
+
+ for (int i = 0; i < values.size (); ++i)
+ {
+ boolean ok = false;
+ if (ordered)
+ ok = equals (values.get (i), b.values.get (i));
+ else
+ {
+ for (int j = 0; j < b.values.size (); ++j)
+ {
+ if (equals (values.get (i), b.values.get (j)))
+ {
+ ok = true;
+ break;
+ }
+ }
+ }
+
+ if (! ok)
+ return false;
+ }
+
+ return true;
+ }
+
+ public Object get ()
+ throws NamingException
+ {
+ if (values.size () == 0)
+ throw new NoSuchElementException ("no values");
+ return get (0);
+ }
+
+ public Object get (int index)
+ throws NamingException
+ {
+ return values.get (index);
+ }
+
+ public NamingEnumeration<?> getAll ()
+ throws NamingException
+ {
+ return new BasicAttributeEnumeration ();
+ }
+
+ public DirContext getAttributeDefinition ()
+ throws OperationNotSupportedException, NamingException
+ {
+ throw new OperationNotSupportedException ();
+ }
+
+ public DirContext getAttributeSyntaxDefinition ()
+ throws OperationNotSupportedException, NamingException
+ {
+ throw new OperationNotSupportedException ();
+ }
+
+ public String getID ()
+ {
+ return attrID;
+ }
+
+ public int hashCode ()
+ {
+ int val = attrID.hashCode ();
+ for (int i = 0; i < values.size (); ++i)
+ {
+ Object o = values.get (i);
+ if (o == null)
+ {
+ // Nothing.
+ }
+ else if (o instanceof Object[])
+ {
+ Object[] a = (Object[]) o;
+ for (int j = 0; j < a.length; ++j)
+ val += a[j].hashCode ();
+ }
+ else
+ val += o.hashCode ();
+ }
+
+ return val;
+ }
+
+ public boolean isOrdered ()
+ {
+ return ordered;
+ }
+
+ public Object remove (int index)
+ {
+ return values.remove (index);
+ }
+
+ public boolean remove (Object val)
+ {
+ for (int i = 0; i < values.size (); ++i)
+ {
+ if (equals (val, values.get (i)))
+ {
+ values.remove (i);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public Object set (int index, Object val)
+ {
+ if (! ordered && contains (val))
+ throw new IllegalStateException ("value already in attribute");
+ return values.set (index, val);
+ }
+
+ public int size ()
+ {
+ return values.size ();
+ }
+
+ public String toString ()
+ {
+ String r = attrID;
+ for (int i = 0; i < values.size (); ++i)
+ r += ";" + values.get (i).toString ();
+ return r;
+ }
+
+ // This is used for testing equality of two Objects according to our
+ // local rules.
+ private boolean equals (Object one, Object two)
+ {
+ if (one == null)
+ return two == null;
+
+ if (one instanceof Object[])
+ {
+ if (! (two instanceof Object[]))
+ return false;
+
+ Object[] aone = (Object[]) one;
+ Object[] atwo = (Object[]) two;
+
+ if (aone.length != atwo.length)
+ return false;
+
+ for (int i = 0; i < aone.length; ++i)
+ {
+ if (! aone[i].equals (atwo[i]))
+ return false;
+ }
+
+ return true;
+ }
+
+ return one.equals (two);
+ }
+
+ private void readObject(ObjectInputStream s)
+ throws IOException, ClassNotFoundException
+ {
+ s.defaultReadObject();
+ int size = s.readInt();
+ values = new Vector<Object>(size);
+ for (int i=0; i < size; i++)
+ values.add(s.readObject());
+ }
+
+ private void writeObject(ObjectOutputStream s) throws IOException
+ {
+ s.defaultWriteObject();
+ s.writeInt(values.size());
+ for (int i=0; i < values.size(); i++)
+ s.writeObject(values.get(i));
+ }
+
+ // Used when enumerating this attribute.
+ private class BasicAttributeEnumeration implements NamingEnumeration
+ {
+ int where = 0;
+
+ public BasicAttributeEnumeration ()
+ {
+ }
+
+ public void close () throws NamingException
+ {
+ }
+
+ public boolean hasMore () throws NamingException
+ {
+ return hasMoreElements ();
+ }
+
+ public Object next () throws NamingException
+ {
+ return nextElement ();
+ }
+
+ public boolean hasMoreElements ()
+ {
+ return where < values.size ();
+ }
+
+ public Object nextElement () throws NoSuchElementException
+ {
+ if (where == values.size ())
+ throw new NoSuchElementException ("no more elements");
+ return values.get (where++);
+ }
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/BasicAttributes.java b/libjava/classpath/javax/naming/directory/BasicAttributes.java
new file mode 100644
index 000000000..8b607a8cc
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/BasicAttributes.java
@@ -0,0 +1,284 @@
+/* BasicAttributes.java --
+ Copyright (C) 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @date June 22, 2001
+ */
+public class BasicAttributes implements Attributes
+{
+ private static final long serialVersionUID = 4980164073184639448L;
+
+ public BasicAttributes ()
+ {
+ this (false);
+ }
+
+ public BasicAttributes (boolean ignoreCase)
+ {
+ this.ignoreCase = ignoreCase;
+ this.attributes = new Vector<Attribute>();
+ }
+
+ public BasicAttributes (String attrID, Object val)
+ {
+ this (attrID, val, false);
+ }
+
+ public BasicAttributes (String attrID, Object val, boolean ignoreCase)
+ {
+ this.ignoreCase = ignoreCase;
+ attributes = new Vector<Attribute>();
+ attributes.add (new BasicAttribute (attrID, val));
+ }
+
+ public Object clone ()
+ {
+ // Slightly inefficient as we make a garbage Vector here.
+ BasicAttributes ba = new BasicAttributes (ignoreCase);
+ ba.attributes = (Vector<Attribute>) attributes.clone ();
+ return ba;
+ }
+
+ /**
+ * Returns true if and only if the given Object is an instance of
+ * Attributes, the given attributes both do or don't ignore case for
+ * IDs and the collection of attributes is the same.
+ */
+ public boolean equals (Object obj)
+ {
+ if (! (obj instanceof Attributes))
+ return false;
+
+ Attributes bs = (Attributes) obj;
+ if (ignoreCase != bs.isCaseIgnored()
+ || attributes.size () != bs.size ())
+ return false;
+
+ NamingEnumeration bas = bs.getAll();
+ while (bas.hasMoreElements())
+ {
+ Attribute a = (Attribute) bas.nextElement();
+ Attribute b = get(a.getID ());
+ if (! a.equals(b))
+ return false;
+ }
+
+ return true;
+ }
+
+ public Attribute get (String attrID)
+ {
+ for (int i = 0; i < attributes.size (); ++i)
+ {
+ Attribute at = attributes.get (i);
+ if ((ignoreCase && attrID.equalsIgnoreCase (at.getID ()))
+ || (! ignoreCase && attrID.equals (at.getID ())))
+ return at;
+ }
+
+ return null;
+ }
+
+ public NamingEnumeration<Attribute> getAll ()
+ {
+ return new BasicAttributesEnumeration();
+ }
+
+ public NamingEnumeration<String> getIDs ()
+ {
+ final NamingEnumeration<Attribute> attrs = getAll();
+ return new NamingEnumeration<String>() {
+ public boolean hasMore() throws NamingException
+ {
+ return attrs.hasMore();
+ }
+
+ public boolean hasMoreElements()
+ {
+ return attrs.hasMoreElements();
+ }
+
+ public String next() throws NamingException
+ {
+ return attrs.next().getID();
+ }
+
+ public String nextElement()
+ {
+ return attrs.nextElement().getID();
+ }
+
+ public void close() throws NamingException
+ {
+ attrs.close();
+ }
+ };
+ }
+
+ public int hashCode ()
+ {
+ int val = 0;
+ for (int i = 0; i < attributes.size (); ++i)
+ val += attributes.get (i).hashCode ();
+ return val;
+ }
+
+ public boolean isCaseIgnored ()
+ {
+ return ignoreCase;
+ }
+
+ public Attribute put (Attribute attr)
+ {
+ Attribute r = remove (attr.getID ());
+ attributes.add (attr);
+ return r;
+ }
+
+ public Attribute put (String attrID, Object val)
+ {
+ return put (new BasicAttribute (attrID, val));
+ }
+
+ public Attribute remove (String attrID)
+ {
+ for (int i = 0; i < attributes.size (); ++i)
+ {
+ Attribute at = (Attribute) attributes.get (i);
+ if ((ignoreCase && attrID.equalsIgnoreCase (at.getID ()))
+ || (! ignoreCase && attrID.equals (at.getID ())))
+ {
+ attributes.remove (i);
+ return at;
+ }
+ }
+
+ return null;
+ }
+
+ public int size ()
+ {
+ return attributes.size ();
+ }
+
+ public String toString ()
+ {
+ String r = "";
+ for (int i = 0; i < attributes.size (); ++i)
+ {
+ if (i > 0)
+ r += "; ";
+ r += attributes.get (i).toString ();
+ }
+ return r;
+ }
+
+ // This is set by the serialization spec.
+ private boolean ignoreCase;
+ // Package-private to avoid a trampoline.
+ transient Vector<Attribute> attributes;
+
+ private void readObject(ObjectInputStream s) throws IOException,
+ ClassNotFoundException
+ {
+ s.defaultReadObject();
+ int size = s.readInt();
+ attributes = new Vector<Attribute>(size);
+ for (int i = 0; i < size; i++)
+ attributes.add((Attribute) s.readObject());
+ }
+
+ private void writeObject(ObjectOutputStream s) throws IOException
+ {
+ s.defaultWriteObject();
+ s.writeInt(attributes.size());
+ for (int i = 0; i < attributes.size(); i++)
+ s.writeObject(attributes.get(i));
+ }
+
+ // Used when enumerating.
+ private class BasicAttributesEnumeration
+ implements NamingEnumeration<Attribute>
+ {
+ int where = 0;
+
+ public BasicAttributesEnumeration ()
+ {
+ }
+
+ public void close () throws NamingException
+ {
+ }
+
+ public boolean hasMore () throws NamingException
+ {
+ return hasMoreElements ();
+ }
+
+ public Attribute next () throws NamingException
+ {
+ return nextElement ();
+ }
+
+ public boolean hasMoreElements ()
+ {
+ return where < attributes.size ();
+ }
+
+ public Attribute nextElement () throws NoSuchElementException
+ {
+ if (where >= attributes.size ())
+ throw new NoSuchElementException ("no more elements");
+ Attribute at = attributes.get (where);
+ ++where;
+ return at;
+ }
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/DirContext.java b/libjava/classpath/javax/naming/directory/DirContext.java
new file mode 100644
index 000000000..d7d94a345
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/DirContext.java
@@ -0,0 +1,103 @@
+/* DirContext.java --
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+/**
+ * @author Warren Levy (warrenl@redhat.com)
+ * @date June 13, 2001
+ */
+
+public interface DirContext extends Context
+{
+ int ADD_ATTRIBUTE = 1;
+ int REPLACE_ATTRIBUTE = 2;
+ int REMOVE_ATTRIBUTE = 3;
+
+ Attributes getAttributes (String name) throws NamingException;
+ Attributes getAttributes (String name, String[] attrIds) throws NamingException;
+ Attributes getAttributes (Name name) throws NamingException;
+ Attributes getAttributes(Name name, String[] attrIds) throws NamingException;
+ void modifyAttributes(Name name, int mod_op, Attributes attrs) throws NamingException;
+ void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException;
+ void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException;
+ void modifyAttributes(String name, ModificationItem[] mods) throws NamingException;
+ void bind(Name name, Object obj, Attributes attrs) throws NamingException;
+ void bind(String name, Object obj, Attributes attrs) throws NamingException;
+ void rebind(Name name, Object obj, Attributes attrs) throws NamingException;
+ void rebind(String name, Object obj, Attributes attrs) throws NamingException;
+ DirContext createSubcontext(Name name, Attributes attrs) throws NamingException;
+ DirContext createSubcontext(String name, Attributes attrs) throws NamingException;
+ DirContext getSchema(Name name) throws NamingException;
+ DirContext getSchema(String name) throws NamingException;
+ DirContext getSchemaClassDefinition(Name name) throws NamingException;
+ DirContext getSchemaClassDefinition(String name) throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name, String filter,
+ SearchControls cons)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name, String filter,
+ SearchControls cons)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name, String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name, String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
+ throws NamingException;
+}
diff --git a/libjava/classpath/javax/naming/directory/InitialDirContext.java b/libjava/classpath/javax/naming/directory/InitialDirContext.java
new file mode 100644
index 000000000..68130b28c
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/InitialDirContext.java
@@ -0,0 +1,272 @@
+/* InitialDirContext.java --
+ Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.NoInitialContextException;
+import javax.naming.NotContextException;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @date June 25, 2001
+ */
+public class InitialDirContext extends InitialContext implements DirContext
+{
+ public InitialDirContext ()
+ throws NamingException
+ {
+ this (null);
+ }
+
+ protected InitialDirContext (boolean lazy)
+ throws NamingException
+ {
+ super (lazy);
+ }
+
+ public InitialDirContext (Hashtable<?, ?> environment)
+ throws NamingException
+ {
+ super (environment);
+ }
+
+ // The InitialContext docs suggest that this exist. And it does
+ // seem like a good idea. but the InitialDirContext docs indicate
+ // it cannot be non-private.
+ private DirContext getURLOrDefaultInitDirCtx (Name name)
+ throws NamingException
+ {
+ Context c = getURLOrDefaultInitCtx (name);
+ if (c == null)
+ throw new NoInitialContextException ();
+ else if (! (c instanceof DirContext))
+ throw new NotContextException ();
+ return (DirContext) c;
+ }
+
+ private DirContext getURLOrDefaultInitDirCtx (String name)
+ throws NamingException
+ {
+ Context c = getURLOrDefaultInitCtx (name);
+ if (c == null)
+ throw new NoInitialContextException ();
+ else if (! (c instanceof DirContext))
+ throw new NotContextException ();
+ return (DirContext) c;
+ }
+
+ public Attributes getAttributes (String name)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getAttributes (name);
+ }
+
+ public Attributes getAttributes (String name, String[] attrIds)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getAttributes (name, attrIds);
+ }
+
+ public Attributes getAttributes (Name name)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getAttributes (name);
+ }
+
+ public Attributes getAttributes(Name name, String[] attrIds)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getAttributes (name, attrIds);
+ }
+
+ public void modifyAttributes(Name name, int mod_op, Attributes attrs)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mod_op, attrs);
+ }
+
+ public void modifyAttributes(String name, int mod_op, Attributes attrs)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mod_op, attrs);
+ }
+
+ public void modifyAttributes(Name name, ModificationItem[] mods)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mods);
+ }
+
+ public void modifyAttributes(String name, ModificationItem[] mods)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mods);
+ }
+
+ public void bind(Name name, Object obj, Attributes attrs)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).bind (name, obj, attrs);
+ }
+
+ public void bind(String name, Object obj, Attributes attrs)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).bind (name, obj, attrs);
+ }
+
+ public void rebind(Name name, Object obj, Attributes attrs)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).rebind (name, obj, attrs);
+ }
+
+ public void rebind(String name, Object obj, Attributes attrs)
+ throws NamingException
+ {
+ getURLOrDefaultInitDirCtx (name).rebind (name, obj, attrs);
+ }
+
+ public DirContext createSubcontext(Name name, Attributes attrs)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).createSubcontext (name, attrs);
+ }
+
+ public DirContext createSubcontext(String name, Attributes attrs)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).createSubcontext (name, attrs);
+ }
+
+ public DirContext getSchema(Name name)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getSchema (name);
+ }
+
+ public DirContext getSchema(String name)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getSchema (name);
+ }
+
+ public DirContext getSchemaClassDefinition(Name name)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getSchemaClassDefinition (name);
+ }
+
+ public DirContext getSchemaClassDefinition(String name)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).getSchemaClassDefinition (name);
+ }
+
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
+ attributesToReturn);
+ }
+
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
+ attributesToReturn);
+ }
+
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
+ }
+
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
+ }
+
+ public NamingEnumeration<SearchResult> search(Name name, String filter,
+ SearchControls cons)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
+ }
+
+ public NamingEnumeration<SearchResult> search(String name, String filter,
+ SearchControls cons)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
+ }
+
+ public NamingEnumeration<SearchResult> search(Name name, String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
+ filterArgs, cons);
+ }
+
+ public NamingEnumeration<SearchResult> search(String name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
+ throws NamingException
+ {
+ return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
+ filterArgs, cons);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/InvalidAttributeIdentifierException.java b/libjava/classpath/javax/naming/directory/InvalidAttributeIdentifierException.java
new file mode 100644
index 000000000..afd9a902b
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/InvalidAttributeIdentifierException.java
@@ -0,0 +1,56 @@
+/* InvalidAttributeIdentifierException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class InvalidAttributeIdentifierException extends NamingException
+{
+ private static final long serialVersionUID = - 9036920266322999923L;
+
+ public InvalidAttributeIdentifierException ()
+ {
+ super ();
+ }
+
+ public InvalidAttributeIdentifierException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/InvalidAttributeValueException.java b/libjava/classpath/javax/naming/directory/InvalidAttributeValueException.java
new file mode 100644
index 000000000..a18adbfa2
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/InvalidAttributeValueException.java
@@ -0,0 +1,56 @@
+/* InvalidAttributeValueException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class InvalidAttributeValueException extends NamingException
+{
+ private static final long serialVersionUID = 8720050295499275011L;
+
+ public InvalidAttributeValueException ()
+ {
+ super ();
+ }
+
+ public InvalidAttributeValueException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/InvalidAttributesException.java b/libjava/classpath/javax/naming/directory/InvalidAttributesException.java
new file mode 100644
index 000000000..ac540e2d0
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/InvalidAttributesException.java
@@ -0,0 +1,56 @@
+/* InvalidAttributesException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class InvalidAttributesException extends NamingException
+{
+ private static final long serialVersionUID = 2607612850539889765L;
+
+ public InvalidAttributesException ()
+ {
+ super ();
+ }
+
+ public InvalidAttributesException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/InvalidSearchControlsException.java b/libjava/classpath/javax/naming/directory/InvalidSearchControlsException.java
new file mode 100644
index 000000000..9c716fa0f
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/InvalidSearchControlsException.java
@@ -0,0 +1,56 @@
+/* InvalidSearchControlsException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class InvalidSearchControlsException extends NamingException
+{
+ private static final long serialVersionUID = - 5124108943352665777L;
+
+ public InvalidSearchControlsException ()
+ {
+ super ();
+ }
+
+ public InvalidSearchControlsException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/InvalidSearchFilterException.java b/libjava/classpath/javax/naming/directory/InvalidSearchFilterException.java
new file mode 100644
index 000000000..21843cc01
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/InvalidSearchFilterException.java
@@ -0,0 +1,56 @@
+/* InvalidSearchFilterException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class InvalidSearchFilterException extends NamingException
+{
+ private static final long serialVersionUID = 2902700940682875441L;
+
+ public InvalidSearchFilterException ()
+ {
+ super ();
+ }
+
+ public InvalidSearchFilterException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/ModificationItem.java b/libjava/classpath/javax/naming/directory/ModificationItem.java
new file mode 100644
index 000000000..b7cb48e68
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/ModificationItem.java
@@ -0,0 +1,81 @@
+/* ModificationItem.java --
+ Copyright (C) 2001, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import java.io.Serializable;
+
+/**
+ * @author Warren Levy (warrenl@redhat.com)
+ * @date June 13, 2001
+ */
+
+public class ModificationItem implements Serializable
+{
+ private static final long serialVersionUID = 7573258562534746850L;
+ // Serialized fields.
+ private int mod_op;
+ private Attribute attr;
+
+ public ModificationItem(int mod_op, Attribute attr)
+ {
+ if (attr == null)
+ throw new IllegalArgumentException("attr is null");
+ if (mod_op != DirContext.ADD_ATTRIBUTE &&
+ mod_op != DirContext.REPLACE_ATTRIBUTE &&
+ mod_op != DirContext.REMOVE_ATTRIBUTE)
+ throw new IllegalArgumentException("mod_op is invalid");
+ this.mod_op = mod_op;
+ this.attr = attr;
+ }
+
+ public int getModificationOp()
+ {
+ return mod_op;
+ }
+
+ public Attribute getAttribute()
+ {
+ return attr;
+ }
+
+ public String toString()
+ {
+ return "mod_op=" + mod_op + ":" + "attr=" + attr.toString();
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/NoSuchAttributeException.java b/libjava/classpath/javax/naming/directory/NoSuchAttributeException.java
new file mode 100644
index 000000000..8eb5e9570
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/NoSuchAttributeException.java
@@ -0,0 +1,56 @@
+/* NoSuchAttributeException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class NoSuchAttributeException extends NamingException
+{
+ private static final long serialVersionUID = 4836415647935888137L;
+
+ public NoSuchAttributeException ()
+ {
+ super ();
+ }
+
+ public NoSuchAttributeException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/SchemaViolationException.java b/libjava/classpath/javax/naming/directory/SchemaViolationException.java
new file mode 100644
index 000000000..f60f32aad
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/SchemaViolationException.java
@@ -0,0 +1,56 @@
+/* SchemaViolationException.java --
+ Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.NamingException;
+
+public class SchemaViolationException extends NamingException
+{
+ private static final long serialVersionUID = - 3041762429525049663L;
+
+ public SchemaViolationException ()
+ {
+ super ();
+ }
+
+ public SchemaViolationException (String msg)
+ {
+ super (msg);
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/SearchControls.java b/libjava/classpath/javax/naming/directory/SearchControls.java
new file mode 100644
index 000000000..805e97170
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/SearchControls.java
@@ -0,0 +1,138 @@
+/* SearchControls.java --
+ Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import java.io.Serializable;
+
+/**
+ * @author Warren Levy (warrenl@redhat.com)
+ * @date June 5, 2001
+ */
+
+public class SearchControls implements Serializable
+{
+ private static final long serialVersionUID = - 2480540967773454797L;
+ public static final int OBJECT_SCOPE = 0;
+ public static final int ONELEVEL_SCOPE = 1;
+ public static final int SUBTREE_SCOPE = 2;
+
+ // Serialized fields.
+ private int searchScope;
+ private int timeLimit;
+ private boolean derefLink;
+ private boolean returnObj;
+ private long countLimit;
+ private String[] attributesToReturn;
+
+ public SearchControls()
+ {
+ this(ONELEVEL_SCOPE, 0L, 0, null, false, false);
+ }
+
+ public SearchControls(int scope, long countlim, int timelim, String[] attrs,
+ boolean retobj, boolean deref)
+ {
+ searchScope = scope;
+ timeLimit = timelim;
+ derefLink = deref;
+ returnObj = retobj;
+ countLimit = countlim;
+ attributesToReturn = attrs;
+ }
+
+ public int getSearchScope()
+ {
+ return searchScope;
+ }
+
+ public int getTimeLimit()
+ {
+ return timeLimit;
+ }
+
+ public boolean getDerefLinkFlag()
+ {
+ return derefLink;
+ }
+
+ public boolean getReturningObjFlag()
+ {
+ return returnObj;
+ }
+
+ public long getCountLimit()
+ {
+ return countLimit;
+ }
+
+ public String[] getReturningAttributes()
+ {
+ return attributesToReturn;
+ }
+
+ public void setSearchScope(int scope)
+ {
+ searchScope = scope;
+ }
+
+ public void setTimeLimit(int ms)
+ {
+ timeLimit = ms;
+ }
+
+ public void setDerefLinkFlag(boolean on)
+ {
+ derefLink = on;
+ }
+
+ public void setReturningObjFlag(boolean on)
+ {
+ returnObj = on;
+ }
+
+ public void setCountLimit(long limit)
+ {
+ countLimit = limit;
+ }
+
+ public void setReturningAttributes(String[] attrs)
+ {
+ attributesToReturn = attrs;
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/SearchResult.java b/libjava/classpath/javax/naming/directory/SearchResult.java
new file mode 100644
index 000000000..5d6a2b1f8
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/SearchResult.java
@@ -0,0 +1,95 @@
+/* SearchResult.java --
+ Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.naming.directory;
+
+import javax.naming.Binding;
+
+/**
+ * @author Warren Levy (warrenl@redhat.com)
+ * @date June 13, 2001
+ */
+
+public class SearchResult extends Binding
+{
+ private static final long serialVersionUID = - 9158063327699723172L;
+ // Serialized fields.
+ private Attributes attrs;
+
+ public SearchResult(String name, Object obj, Attributes attrs)
+ {
+ super(name, obj);
+ this.attrs = attrs;
+ }
+
+ public SearchResult(String name, Object obj, Attributes attrs,
+ boolean isRelative)
+ {
+ super(name, obj, isRelative);
+ this.attrs = attrs;
+ }
+
+ public SearchResult(String name, String className, Object obj,
+ Attributes attrs)
+ {
+ super(name, className, obj);
+ this.attrs = attrs;
+ }
+
+ public SearchResult(String name, String className, Object obj,
+ Attributes attrs, boolean isRelative)
+ {
+ super(name, className, obj, isRelative);
+ this.attrs = attrs;
+ }
+
+ public Attributes getAttributes()
+ {
+ return attrs;
+ }
+
+ public void setAttributes(Attributes attrs)
+ {
+ this.attrs = attrs;
+ }
+
+ public String toString()
+ {
+ return super.toString() + ":" + attrs.toString();
+ }
+}
diff --git a/libjava/classpath/javax/naming/directory/package.html b/libjava/classpath/javax/naming/directory/package.html
new file mode 100644
index 000000000..6286dd2e4
--- /dev/null
+++ b/libjava/classpath/javax/naming/directory/package.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.naming.directory package.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.naming.directory</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>