Examples of LDAPAttribute


Examples of com.day.ldap.LDAPAttribute

     * of the LDIF record.
     * @return an array of <CODE>LDAPAttribute</CODE> objects that
     * represent the attributes specified in the content of the LDIF record.
     */
    public LDAPAttribute[] getAttributes() {
        LDAPAttribute attrs[] = new LDAPAttribute[m_attrs.size()];
        for (int i = 0; i < m_attrs.size(); i++) {
            attrs[i] = (LDAPAttribute)m_attrs.elementAt(i);
        }
        return attrs;
    }
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

      DebugFile.writeln("LDAPNovell.addHive(" + sDN + "," + sCN + ")");
    }

    try {
      attrs = new LDAPAttributeSet();
      attrs.add(new LDAPAttribute("objectClass", new String[] {"dcObject",
                                  "organizationalUnit"}));
      attrs.add(new LDAPAttribute("dc", sCN));
      attrs.add(new LDAPAttribute("ou", sCN));
      oConn.add(new LDAPEntry(sDN, attrs));
    }
    catch (com.novell.ldap.LDAPException xcpt) {
      throw new com.knowgate.ldap.LDAPException(xcpt.getMessage(), xcpt);
    }
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

    if (DebugFile.trace) {
      DebugFile.writeln("LDAPNovell.addLeaf(" + sDN + ", ...)");
    }

    try {
      attrs.add(new LDAPAttribute("objectClass", new String[] {"inetOrgPerson",
                                  "organizationalPerson"}));
      oConn.add(new LDAPEntry(sDN, attrs));
    }
    catch (com.novell.ldap.LDAPException xcpt) {
      throw new com.knowgate.ldap.LDAPException(xcpt.getMessage() + " " + sDN, xcpt);
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

      if (!oRSet.wasNull()) {
        sFld = oFld.toString();
        sCol = oMDat.getColumnName(c).toLowerCase();
        if (!sCol.startsWith("control_")) {
          oAttrs.add(new LDAPAttribute(sCol, sFld));
        }
      }
    } // next

    return oAttrs;
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

                // New empty configuration
                GuacamoleConfiguration config = new GuacamoleConfiguration();

                // Get CN
                LDAPAttribute cn = entry.getAttribute("cn");
                if (cn == null)
                    throw new GuacamoleException("guacConfigGroup without cn");

                // Get protocol
                LDAPAttribute protocol = entry.getAttribute("guacConfigProtocol");
                if (protocol == null)
                    throw new GuacamoleException("guacConfigGroup without guacConfigProtocol");

                // Set protocol
                config.setProtocol(protocol.getStringValue());

                // Get parameters, if any
                LDAPAttribute parameterAttribute = entry.getAttribute("guacConfigParameter");
                if (parameterAttribute != null) {

                    // For each parameter
                    Enumeration<String> parameters = parameterAttribute.getStringValues();
                    while (parameters.hasMoreElements()) {

                        String parameter = parameters.nextElement();

                        // Parse parameter
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

          LDAPConnection.SCOPE_SUB, "(&(objectCategory=person)(objectClass=user))", null, Boolean.FALSE);

      while (ldapSearchResults.hasMore()){
        LDAPEntry ldapEntry = ldapSearchResults.next();
       
        LDAPAttribute ldapAttribute = ldapEntry.getAttribute("memberOf");
        if (ldapAttribute!=null){
          String memberOf = ldapAttribute.getStringValue();
          String[] items = memberOf.split(",");
          if (items!=null){
            Collection<String> cItems = Arrays.asList(items);;
            Iterator<String> it = cItems.iterator();
            while (it.hasNext()) {
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

   * @param ldapEntry
   * @param attribute
   * @return
   */
  public static Date getDate(LDAPEntry ldapEntry, String attribute){
    LDAPAttribute ldapAttribute = ldapEntry.getAttribute(attribute);
    if (ldapAttribute!=null){
      String cDate = ldapAttribute.getStringValue();
      SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
      try {
        // Sentido estricto, para que valide tambien que la fecha tenga sentido
        format.setLenient(Boolean.FALSE);
        return format.parse(cDate);
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

    }
    return null;
  }
 
  public static String getValue(LDAPEntry ldapEntry, String attribute){
    LDAPAttribute ldapAttribute = ldapEntry.getAttribute(attribute);
    if (ldapAttribute!=null){
      return ldapAttribute.getStringValue();
    }
    return "";
  }
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

   * @param ldapEntry
   * @param attribute
   * @return
   */
  public static Profile getProfile(LDAPEntry ldapEntry, String attribute){
    LDAPAttribute ldapAttribute = ldapEntry.getAttribute(attribute);
    if (ldapAttribute!=null){
      String memberOf = ldapAttribute.getStringValue();
      String[] items = memberOf.split(",");
      if (items!=null){
        Collection<String> cItems = Arrays.asList(items);;
        Iterator<String> it = cItems.iterator();
        while (it.hasNext()) {
View Full Code Here

Examples of com.novell.ldap.LDAPAttribute

            attributeSet = getAttributeSet(incert, getUserObjectClass(), certdn, email, true, true, password, extendedinformation);
          }

          try {
            attribute = getUserCertAttribute();
            LDAPAttribute certAttr = new LDAPAttribute(getUserCertAttribute(), incert.getEncoded());
            if (oldEntry != null) {
              String oldDn = oldEntry.getDN();
              if (getAddMultipleCertificates()) {
                modSet.add(new LDAPModification(LDAPModification.ADD, certAttr));                       
                if (log.isDebugEnabled()) {
                  log.debug("Appended new certificate in user entry; " + username+": "+oldDn);
                }
              } else {
                modSet.add(new LDAPModification(LDAPModification.REPLACE, certAttr));                                           
                if (log.isDebugEnabled()) {
                  log.debug("Replaced certificate in user entry; " + username+": "+oldDn);
                }
              }
            } else {
              attributeSet.add(certAttr);
              if (log.isDebugEnabled()) {
                log.debug("Added new certificate to user entry; " + username+": "+dn);
              }
            }
          } catch (CertificateEncodingException e) {
            String msg = intres.getLocalizedMessage("publisher.errorldapencodestore", "certificate");
            log.error(msg, e);
            throw new PublisherException(msg);               
          }
        } else if ((type == SecConst.CERTTYPE_SUBCA) || (type == SecConst.CERTTYPE_ROOTCA)) {
          if (log.isDebugEnabled()) {
            log.debug("Publishing CA certificate to first available server of " + getHostnames());
          }
          if (oldEntry != null) {
            modSet = getModificationSet(oldEntry, certdn, null, false, false, password);
          } else {
            objectclass = getCAObjectClass(); // just used for logging
            attributeSet = getAttributeSet(incert, getCAObjectClass(), certdn, null, true, false, password, extendedinformation);
          }
          try {
            attribute = getCACertAttribute();
            LDAPAttribute certAttr = new LDAPAttribute(getCACertAttribute(), incert.getEncoded());
            if (oldEntry != null) {
              modSet.add(new LDAPModification(LDAPModification.REPLACE, certAttr));
            } else {
              attributeSet.add(certAttr);
              // Also create using the crlattribute, it may be required
              LDAPAttribute crlAttr = new LDAPAttribute(getCRLAttribute(), getFakeCRL());
              attributeSet.add(crlAttr);
              // Also create using the arlattribute, it may be required
              LDAPAttribute arlAttr = new LDAPAttribute(getARLAttribute(), getFakeCRL());
              attributeSet.add(arlAttr);
              if (log.isDebugEnabled()) {
                log.debug("Added (fake) attribute for CRL and ARL.");
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.