All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.vt.middleware.ldap.bean.LdapAttribute Maven / Gradle / Ivy

There is a newer version: 3.3.9
Show newest version
/*
  $Id: LdapAttribute.java 1330 2010-05-23 22:10:53Z dfisher $

  Copyright (C) 2003-2010 Virginia Tech.
  All rights reserved.

  SEE LICENSE FOR MORE INFORMATION

  Author:  Middleware Services
  Email:   [email protected]
  Version: $Revision: 1330 $
  Updated: $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
*/
package edu.vt.middleware.ldap.bean;

import java.util.Set;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;

/**
 * LdapAttribute represents a single ldap attribute. Ldap attribute
 * values must be unique per http://tools.ietf.org/html/rfc4512#section-2.3. For
 * any given attribute, the values must all be of the same type.
 *
 * @author  Middleware Services
 * @version  $Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
 */
public interface LdapAttribute
{


  /**
   * This returns the name of this LdapAttribute.
   *
   * @return  String
   */
  String getName();


  /**
   * This returns the value(s) of this LdapAttribute.
   *
   * @return  Set
   */
  Set getValues();


  /**
   * This returns the value(s) of this LdapAttribute Values are
   * encoded in base64 format if the underlying value is of type byte[]. The
   * returned set is unmodifiable.
   *
   * @return  unmodifiable Set
   */
  Set getStringValues();


  /**
   * This sets this LdapAttribute using the supplied attribute.
   *
   * @param  attribute  Attribute
   *
   * @throws  NamingException  if the attribute values cannot be read
   */
  void setAttribute(final Attribute attribute)
    throws NamingException;


  /**
   * This sets the name of this LdapAttribute.
   *
   * @param  name  String
   */
  void setName(final String name);


  /**
   * This returns an Attribute that represents the values in this
   * LdapAttribute.
   *
   * @return  Attribute
   */
  Attribute toAttribute();
}