public void addAttribute(String attrName,String value) throws SMSException {
  Set attrValues=null;
  if (attrSet == null) {
    attrSet=new CaseInsensitiveHashMap();
  }
 else   if (attrSet.containsKey(attrName)) {
    attrValues=(Set)attrSet.get(attrName);
    if (attrValues.contains(value)) {
      if (debug.messageEnabled()) {
        debug.message("SMSEntry: Duplicate value for addition");
      }
      throw (new SMSException(LdapException.newLdapException(ResultCode.ATTRIBUTE_OR_VALUE_EXISTS,getBundleString(IUMSConstants.SMS_ATTR_OR_VAL_EXISTS)),"sms-ATTR_OR_VAL_EXISTS"));
    }
  }
  if (attrValues == null) {
    attrValues=new HashSet();
  }
  attrValues.add(value);
  attrSet.put(attrName,attrValues);
  if (modSet == null) {
    modSet=new HashSet();
  }
  modSet.add(new ModificationItem(DirContext.ADD_ATTRIBUTE,new BasicAttribute(attrName,value)));
}

public void addAttribute ( String attrName , String value ) throws SMSException { Set attrValues = null ; if ( attrSet == null ) { attrSet = new CaseInsensitiveHashMap ( ) ; } else if ( attrSet . containsKey ( attrName ) ) { attrValues = ( Set ) attrSet . get ( attrName ) ; if ( attrValues . contains ( value ) ) { if ( debug . messageEnabled ( ) ) { debug . message ( "SMSEntry: Duplicate value for addition" ) ; } throw ( new SMSException ( LdapException . newLdapException ( ResultCode . ATTRIBUTE_OR_VALUE_EXISTS , getBundleString ( IUMSConstants . SMS_ATTR_OR_VAL_EXISTS ) ) , "sms-ATTR_OR_VAL_EXISTS" ) ) ; } } if ( attrValues == null ) { attrValues = new HashSet ( ) ; } attrValues . add ( value ) ; attrSet . put ( attrName , attrValues ) ; if ( modSet == null ) { modSet = new HashSet ( ) ; } modSet . add ( new ModificationItem ( DirContext . ADD_ATTRIBUTE , new BasicAttribute ( attrName , value ) ) ) ; }
adds the attribute value to the given attribute name . it is stored locally and is not written to the directory .
