0N/A/*
2362N/A * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A
0N/Apackage javax.naming.directory;
0N/A
0N/Aimport java.util.Hashtable;
0N/Aimport java.util.Enumeration;
0N/A
0N/Aimport javax.naming.NamingException;
0N/Aimport javax.naming.NamingEnumeration;
0N/A
0N/A/**
0N/A * This interface represents a collection of attributes.
0N/A *<p>
0N/A * In a directory, named objects can have associated with them
0N/A * attributes. The Attributes interface represents a collection of attributes.
0N/A * For example, you can request from the directory the attributes
0N/A * associated with an object. Those attributes are returned in
0N/A * an object that implements the Attributes interface.
0N/A *<p>
0N/A * Attributes in an object that implements the Attributes interface are
0N/A * unordered. The object can have zero or more attributes.
0N/A * Attributes is either case-sensitive or case-insensitive (case-ignore).
0N/A * This property is determined at the time the Attributes object is
0N/A * created. (see BasicAttributes constructor for example).
0N/A * In a case-insensitive Attributes, the case of its attribute identifiers
0N/A * is ignored when searching for an attribute, or adding attributes.
0N/A * In a case-sensitive Attributes, the case is significant.
0N/A *<p>
0N/A * Note that updates to Attributes (such as adding or removing an attribute)
0N/A * do not affect the corresponding representation in the directory.
0N/A * Updates to the directory can only be effected
0N/A * using operations in the DirContext interface.
0N/A *
0N/A * @author Rosanna Lee
0N/A * @author Scott Seligman
0N/A *
0N/A * @see DirContext#getAttributes
0N/A * @see DirContext#modifyAttributes
0N/A * @see DirContext#bind
0N/A * @see DirContext#rebind
0N/A * @see DirContext#createSubcontext
0N/A * @see DirContext#search
0N/A * @see BasicAttributes
0N/A * @since 1.3
0N/A */
0N/A
0N/Apublic interface Attributes extends Cloneable, java.io.Serializable {
0N/A /**
0N/A * Determines whether the attribute set ignores the case of
0N/A * attribute identifiers when retrieving or adding attributes.
0N/A * @return true if case is ignored; false otherwise.
0N/A */
0N/A boolean isCaseIgnored();
0N/A
0N/A /**
0N/A * Retrieves the number of attributes in the attribute set.
0N/A *
0N/A * @return The nonnegative number of attributes in this attribute set.
0N/A */
0N/A int size();
0N/A
0N/A /**
0N/A * Retrieves the attribute with the given attribute id from the
0N/A * attribute set.
0N/A *
0N/A * @param attrID The non-null id of the attribute to retrieve.
0N/A * If this attribute set ignores the character
0N/A * case of its attribute ids, the case of attrID
0N/A * is ignored.
0N/A * @return The attribute identified by attrID; null if not found.
0N/A * @see #put
0N/A * @see #remove
0N/A */
0N/A Attribute get(String attrID);
0N/A
0N/A /**
0N/A * Retrieves an enumeration of the attributes in the attribute set.
0N/A * The effects of updates to this attribute set on this enumeration
0N/A * are undefined.
0N/A *
0N/A * @return A non-null enumeration of the attributes in this attribute set.
0N/A * Each element of the enumeration is of class <tt>Attribute</tt>.
0N/A * If attribute set has zero attributes, an empty enumeration
0N/A * is returned.
0N/A */
0N/A NamingEnumeration<? extends Attribute> getAll();
0N/A
0N/A /**
0N/A * Retrieves an enumeration of the ids of the attributes in the
0N/A * attribute set.
0N/A * The effects of updates to this attribute set on this enumeration
0N/A * are undefined.
0N/A *
0N/A * @return A non-null enumeration of the attributes' ids in
0N/A * this attribute set. Each element of the enumeration is
0N/A * of class String.
0N/A * If attribute set has zero attributes, an empty enumeration
0N/A * is returned.
0N/A */
0N/A NamingEnumeration<String> getIDs();
0N/A
0N/A /**
0N/A * Adds a new attribute to the attribute set.
0N/A *
0N/A * @param attrID non-null The id of the attribute to add.
0N/A * If the attribute set ignores the character
0N/A * case of its attribute ids, the case of attrID
0N/A * is ignored.
0N/A * @param val The possibly null value of the attribute to add.
0N/A * If null, the attribute does not have any values.
0N/A * @return The Attribute with attrID that was previous in this attribute set;
0N/A * null if no such attribute existed.
0N/A * @see #remove
0N/A */
0N/A Attribute put(String attrID, Object val);
0N/A
0N/A /**
0N/A * Adds a new attribute to the attribute set.
0N/A *
0N/A * @param attr The non-null attribute to add.
0N/A * If the attribute set ignores the character
0N/A * case of its attribute ids, the case of
0N/A * attr's identifier is ignored.
0N/A * @return The Attribute with the same ID as attr that was previous
0N/A * in this attribute set;
0N/A * null if no such attribute existed.
0N/A * @see #remove
0N/A */
0N/A Attribute put(Attribute attr);
0N/A
0N/A /**
0N/A * Removes the attribute with the attribute id 'attrID' from
0N/A * the attribute set. If the attribute does not exist, ignore.
0N/A *
0N/A * @param attrID The non-null id of the attribute to remove.
0N/A * If the attribute set ignores the character
0N/A * case of its attribute ids, the case of
0N/A * attrID is ignored.
0N/A * @return The Attribute with the same ID as attrID that was previous
0N/A * in the attribute set;
0N/A * null if no such attribute existed.
0N/A */
0N/A Attribute remove(String attrID);
0N/A
0N/A /**
0N/A * Makes a copy of the attribute set.
0N/A * The new set contains the same attributes as the original set:
0N/A * the attributes are not themselves cloned.
0N/A * Changes to the copy will not affect the original and vice versa.
0N/A *
0N/A * @return A non-null copy of this attribute set.
0N/A */
0N/A Object clone();
0N/A
0N/A /**
0N/A * Use serialVersionUID from JNDI 1.1.1 for interoperability
0N/A */
0N/A // static final long serialVersionUID = -7247874645443605347L;
0N/A}