diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-16 00:30:23 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-16 00:30:23 +0000 |
| commit | c8875fb97fc03779a5bba09872227b1d08e5d52a (patch) | |
| tree | a0b991cf5866ae1d616639b906ac001811d74508 /libjava/classpath/javax/naming/directory | |
| parent | c40c1730800ed292b6db39a83d592476fa59623c (diff) | |
| download | ppe42-gcc-c8875fb97fc03779a5bba09872227b1d08e5d52a.tar.gz ppe42-gcc-c8875fb97fc03779a5bba09872227b1d08e5d52a.zip | |
Initial revision
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/naming/directory')
19 files changed, 1921 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 00000000000..59bf66dabc8 --- /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 00000000000..46614245282 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/AttributeInUseException.java @@ -0,0 +1,54 @@ +/* AttributeInUseException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..4ef6fc20b66 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/AttributeModificationException.java @@ -0,0 +1,77 @@ +/* AttributeModificationException.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.NamingException; + +/** + * @author Warren Levy (warrenl@redhat.com) + * @date June 14, 2001 + */ + +public class AttributeModificationException extends NamingException +{ + // 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 00000000000..3d5ef9f4fa7 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/Attributes.java @@ -0,0 +1,62 @@ +/* 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 getAll(); + NamingEnumeration 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 00000000000..047036585e4 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/BasicAttribute.java @@ -0,0 +1,337 @@ +/* BasicAttribute.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.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 + */ +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 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 (); + } + + 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 (); + 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) 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); + } + + // Used when enumerating this attribute. + private class BasicAttributeEnumeration implements NamingEnumeration + { + int where = -1; + + 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 + 1 >= values.size ()) + throw new NoSuchElementException ("no more elements"); + ++where; + 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 00000000000..37ec195771e --- /dev/null +++ b/libjava/classpath/javax/naming/directory/BasicAttributes.java @@ -0,0 +1,238 @@ +/* BasicAttributes.java -- + Copyright (C) 2000, 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.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 (); + } + + public BasicAttributes (String attrID, Object val) + { + this (attrID, val, false); + } + + public BasicAttributes (String attrID, Object val, boolean ignoreCase) + { + this.ignoreCase = ignoreCase; + attributes = new Vector (); + 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) 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 = (Attribute) attributes.get (i); + if ((ignoreCase && attrID.equalsIgnoreCase (at.getID ())) + || (! ignoreCase && attrID.equals (at.getID ()))) + return at; + } + + return null; + } + + public NamingEnumeration getAll () + { + return new BasicAttributesEnumeration (false); + } + + public NamingEnumeration getIDs () + { + return new BasicAttributesEnumeration (true); + } + + 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 attributes; + + // Used when enumerating. + private class BasicAttributesEnumeration implements NamingEnumeration + { + int where = 0; + boolean id; + + public BasicAttributesEnumeration (boolean id) + { + this.id = id; + } + + public void close () throws NamingException + { + } + + public boolean hasMore () throws NamingException + { + return hasMoreElements (); + } + + public Object next () throws NamingException + { + return nextElement (); + } + + public boolean hasMoreElements () + { + return where < attributes.size (); + } + + public Object nextElement () throws NoSuchElementException + { + if (where >= attributes.size ()) + throw new NoSuchElementException ("no more elements"); + Attribute at = (Attribute) attributes.get (where); + ++where; + return id ? (Object) at.getID () : (Object) at; + } + } +} diff --git a/libjava/classpath/javax/naming/directory/DirContext.java b/libjava/classpath/javax/naming/directory/DirContext.java new file mode 100644 index 00000000000..002cb78a913 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/DirContext.java @@ -0,0 +1,83 @@ +/* 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 search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException; + NamingEnumeration search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException; + NamingEnumeration search(Name name, Attributes matchingAttributes) throws NamingException; + NamingEnumeration search(String name, Attributes matchingAttributes) throws NamingException; + NamingEnumeration search(Name name, String filter, SearchControls cons) throws NamingException; + NamingEnumeration search(String name, String filter, SearchControls cons) throws NamingException; + NamingEnumeration search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException; + NamingEnumeration 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 00000000000..c946f416bff --- /dev/null +++ b/libjava/classpath/javax/naming/directory/InitialDirContext.java @@ -0,0 +1,265 @@ +/* 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 search(Name name, Attributes matchingAttributes, + String[] attributesToReturn) + throws NamingException + { + return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes, + attributesToReturn); + } + + public NamingEnumeration search(String name, Attributes matchingAttributes, + String[] attributesToReturn) + throws NamingException + { + return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes, + attributesToReturn); + } + + public NamingEnumeration search(Name name, Attributes matchingAttributes) + throws NamingException + { + return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes); + } + + public NamingEnumeration search(String name, Attributes matchingAttributes) + throws NamingException + { + return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes); + } + + public NamingEnumeration search(Name name, String filter, + SearchControls cons) + throws NamingException + { + return getURLOrDefaultInitDirCtx (name).search (name, filter, cons); + } + + public NamingEnumeration search(String name, String filter, + SearchControls cons) + throws NamingException + { + return getURLOrDefaultInitDirCtx (name).search (name, filter, cons); + } + + public NamingEnumeration search(Name name, String filterExpr, + Object[] filterArgs, SearchControls cons) + throws NamingException + { + return getURLOrDefaultInitDirCtx (name).search (name, filterExpr, + filterArgs, cons); + } + + public NamingEnumeration 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 00000000000..af1a8c7a27f --- /dev/null +++ b/libjava/classpath/javax/naming/directory/InvalidAttributeIdentifierException.java @@ -0,0 +1,54 @@ +/* InvalidAttributeIdentifierException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..b667fa9a732 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/InvalidAttributeValueException.java @@ -0,0 +1,54 @@ +/* InvalidAttributeValueException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..ad7f7c1c111 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/InvalidAttributesException.java @@ -0,0 +1,54 @@ +/* InvalidAttributesException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..594e5d1bfe5 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/InvalidSearchControlsException.java @@ -0,0 +1,54 @@ +/* InvalidSearchControlsException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..127b381ea6d --- /dev/null +++ b/libjava/classpath/javax/naming/directory/InvalidSearchFilterException.java @@ -0,0 +1,54 @@ +/* InvalidSearchFilterException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..f0a69f56a8c --- /dev/null +++ b/libjava/classpath/javax/naming/directory/ModificationItem.java @@ -0,0 +1,80 @@ +/* ModificationItem.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 java.io.Serializable; + +/** + * @author Warren Levy (warrenl@redhat.com) + * @date June 13, 2001 + */ + +public class ModificationItem implements Serializable +{ + // 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 00000000000..cff9f95b7e5 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/NoSuchAttributeException.java @@ -0,0 +1,54 @@ +/* NoSuchAttributeException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..a11e50f2002 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/SchemaViolationException.java @@ -0,0 +1,54 @@ +/* SchemaViolationException.java -- + Copyright (C) 2000, 2001 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 +{ + 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 00000000000..4cc789d52e1 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/SearchControls.java @@ -0,0 +1,137 @@ +/* SearchControls.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; + +/** + * @author Warren Levy (warrenl@redhat.com) + * @date June 5, 2001 + */ + +public class SearchControls implements Serializable +{ + 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 00000000000..a6d5490df99 --- /dev/null +++ b/libjava/classpath/javax/naming/directory/SearchResult.java @@ -0,0 +1,94 @@ +/* SearchResult.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 javax.naming.Binding; + +/** + * @author Warren Levy (warrenl@redhat.com) + * @date June 13, 2001 + */ + +public class SearchResult extends Binding +{ + // 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 00000000000..6286dd2e4ae --- /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> |

