Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.Attribute


       }

       EntryHistorical entryHist = EntryHistorical.newInstanceFromEntry(entry);
       lastChangeNumberPurgedFromHist = entryHist.getOldestCN();
       entryHist.setPurgeDelay(this.histPurgeDelayInMilliSec);
       Attribute attr = entryHist.encodeAndPurge();
       count += entryHist.getLastPurgedValuesCount();
       List<Modification> mods = new LinkedList<Modification>();
       Modification mod;
       mod = new Modification(ModificationType.REPLACE, attr);
       mods.add(mod);
View Full Code Here


          {
            needsMerge = true;

            if (attrList != null && attrList.getValue().size() == 1)
            {
              Attribute a = attrList.getValue().get(0);
              if (!a.hasOptions())
              {
                needsMerge = false;
                tmp.add(new LDAPAttribute(a));
              }
            }

            if (needsMerge)
            {
              AttributeBuilder builder =
                  new AttributeBuilder(attrList.getKey());
              for (Attribute a : attrList.getValue())
              {
                builder.addAll(a);
              }
              tmp.add(new LDAPAttribute(builder.toAttribute()));
            }
          }

          attrs = entry.getOperationalAttributes();
          for (Map.Entry<AttributeType, List<Attribute>> attrList : attrs
              .entrySet())
          {
            needsMerge = true;

            if (attrList != null && attrList.getValue().size() == 1)
            {
              Attribute a = attrList.getValue().get(0);
              if (!a.hasOptions())
              {
                needsMerge = false;
                tmp.add(new LDAPAttribute(a));
              }
            }
View Full Code Here

         new HashMap<AttributeType,List<Attribute>>();


    for (LDAPAttribute a : getAttributes())
    {
      Attribute     attr     = a.toAttribute();
      AttributeType attrType = attr.getAttributeType();

      if (attrType.isObjectClassType())
      {
        for (ByteString os : a.getValues())
        {
          String ocName = os.toString();
          ObjectClass oc =
               DirectoryServer.getObjectClass(toLowerCase(ocName));
          if (oc == null)
          {
            oc = DirectoryServer.getDefaultObjectClass(ocName);
          }

          objectClasses.put(oc ,ocName);
        }
      }
      else if (attrType.isOperational())
      {
        List<Attribute> attrs = operationalAttributes.get(attrType);
        if (attrs == null)
        {
          attrs = new ArrayList<Attribute>(1);
          attrs.add(attr);
          operationalAttributes.put(attrType, attrs);
        }
        else
        {
          attrs.add(attr);
        }
      }
      else
      {
        List<Attribute> attrs = userAttributes.get(attrType);
        if (attrs == null)
        {
          attrs = new ArrayList<Attribute>(1);
          attrs.add(attr);
          userAttributes.put(attrType, attrs);
        }
        else
        {
          // Check to see if any of the existing attributes in the list have the
          // same set of options.  If so, then add the values to that attribute.
          boolean attributeSeen = false;
          for (int i = 0; i < attrs.size(); i++) {
            Attribute ea = attrs.get(i);
            if (ea.optionsEqual(attr.getOptions()))
            {
              AttributeBuilder builder = new AttributeBuilder(ea);
              builder.addAll(attr);
              attrs.set(i, builder.toAttribute());
              attributeSeen = true;
View Full Code Here

  }

  private String getSingleStringValue(Entry entry, String attrName) {
    List<Attribute> attrList = entry.getAttribute(attrName);
    if (attrList != null && attrList.size() == 1) {
      Attribute attr = attrList.get(0);
      if (!attr.isEmpty()) {
        return attr.iterator().next().getValue().toString();
      }
    }
    return "";
  }
View Full Code Here

    ServerSocket serverLdapSocket = new ServerSocket();
    serverLdapSocket.setReuseAddress(true);
    serverLdapSocket.bind(new InetSocketAddress(localHost, 0));
    long serverLdapPort = serverLdapSocket.getLocalPort();
    serverLdapSocket.close();
    Attribute a=Attributes.create(ATTR_LISTEN_PORT, String.valueOf(serverLdapPort));
    handlerEntry.addAttribute(a,null);
    LDAPConnectionHandlerCfg config =
      getConfiguration(handlerEntry);
    LDAPConnectionHandler handler = new LDAPConnectionHandler();
    handler.initializeConnectionHandler(config);
View Full Code Here

         throws Exception
  {
    String mapperDN = "cn=Subject Attribute to User Attribute," +
                      "cn=Certificate Mappers,cn=config";

    Attribute a =
      Attributes.empty(DirectoryServer.getAttributeType(
                            "ds-cfg-subject-attribute-mapping"));

    ArrayList<Modification> mods = new ArrayList<Modification>();
    mods.add(new Modification(ModificationType.DELETE, a));
View Full Code Here

    // Finalize this cache so it can be reconfigured.
    super.cache.finalizeEntryCache();

    // Configure this cache as LRU.
    Entry newCacheConfigEntry = cacheConfigEntry.duplicate(true);
    Attribute cacheConfigTypeAttr =
      Attributes.create("ds-cfg-cache-type", "LRU");
    newCacheConfigEntry.addAttribute(cacheConfigTypeAttr, null);
    super.configuration = AdminTestCaseUtils.getConfiguration(
      EntryCacheCfgDefn.getInstance(), newCacheConfigEntry);
View Full Code Here

    super.cache.finalizeEntryCache();

    // Configure this cache as persistent cache with
    // unlimited number of entries.
    Entry newCacheConfigEntry = cacheConfigEntry.duplicate(true);
    Attribute cacheConfigPersistAttr =
      Attributes.create("ds-cfg-persistent-cache", "true");
    newCacheConfigEntry.addAttribute(cacheConfigPersistAttr, null);
    Attribute cacheConfigMaxAttr =
      Attributes.create("ds-cfg-max-entries", Integer.toString(super.MAXENTRIES));
    newCacheConfigEntry.removeAttribute(cacheConfigMaxAttr, null);
    super.configuration = AdminTestCaseUtils.getConfiguration(
      EntryCacheCfgDefn.getInstance(), newCacheConfigEntry);
View Full Code Here

    String shutListName=LDAPConnHandler.getShutdownListenerName();
    SSLClientAuthPolicy policy = LDAPConnHandler.getSSLClientAuthPolicy();
    Collection<ClientConnection> cons=LDAPConnHandler.getClientConnections();
    LDAPConnHandler.processServerShutdown(reasonMsg);
    //Reset some things for the SSL handler
    Attribute useSSL=Attributes.create(ATTR_USE_SSL, String.valueOf(false));
    Attribute startTls=Attributes.create(ATTR_ALLOW_STARTTLS, String.valueOf(false));
    AttributeType attrType=DirectoryServer.getAttributeType(ATTR_LISTEN_PORT, true);
    Attribute a=Attributes.empty(attrType);
    LDAPHandlerEntry.removeAttribute(a, null);
    LDAPHandlerEntry.removeAttribute(useSSL, null);
    LDAPHandlerEntry.removeAttribute(startTls, null);
    Attribute useSSL1=Attributes.create(ATTR_USE_SSL, String.valueOf(true));
    Attribute startTls1=Attributes.create(ATTR_ALLOW_STARTTLS, String.valueOf(false));
    LDAPHandlerEntry.addAttribute(useSSL1,null);
    LDAPHandlerEntry.addAttribute(startTls1,null);
    LDAPConnectionHandler LDAPSConnHandler = getLDAPHandlerInstance(LDAPHandlerEntry);
    LDAPSConnHandler.finalizeConnectionHandler(reasonMsg);
    LDAPConnHandler.processServerShutdown(reasonMsg);
View Full Code Here

        "ds-cfg-ssl-cert-nickname: server-cert",
        "ds-cfg-key-manager-provider: cn=JKS,cn=Key Manager Providers,cn=config",
        "ds-cfg-trust-manager-provider: cn=JKS,cn=Trust Manager Providers,cn=config");

    // Add some invalid attrs and some duplicate attrs
    Attribute a2=Attributes.create(ATTR_LISTEN_PORT, String.valueOf(389));
    Attribute a2a=Attributes.create(ATTR_LISTEN_PORT, String.valueOf(70000));
    Attribute a3=Attributes.create(ATTR_LISTEN_ADDRESS, "localhost");
    Attribute a3a=Attributes.create(ATTR_LISTEN_ADDRESS, "FAFASFSDFSADFASDFSDFSDAFAS");
    Attribute a4=Attributes.create(ATTR_ACCEPT_BACKLOG, String.valueOf(Long.MAX_VALUE));
    Attribute a5=Attributes.create(ATTR_ALLOWED_CLIENT, "129.800.990.45");
    Attribute a6=Attributes.create(ATTR_DENIED_CLIENT, "129.");
    Attribute a7=Attributes.create(ATTR_ALLOW_LDAPV2, "45");
    Attribute a8=Attributes.create(ATTR_KEEP_LDAP_STATS, "45");
    Attribute a9=Attributes.create(ATTR_SEND_REJECTION_NOTICE, "45");
    Attribute a10=Attributes.create(ATTR_USE_TCP_KEEPALIVE, "45");
    Attribute a11=Attributes.create(ATTR_USE_TCP_NODELAY, "45");
    Attribute a12=Attributes.create(ATTR_ALLOW_REUSE_ADDRESS, "45");
    Attribute a13=Attributes.create(ATTR_MAX_REQUEST_SIZE, "45 FLUBBERBYTES");
    Attribute a14=Attributes.create(ATTR_USE_SSL, "45");
    Attribute a15=Attributes.create(ATTR_ALLOW_STARTTLS, "45");
    BadHandlerEntry.addAttribute(a2, null);
    BadHandlerEntry.addAttribute(a3, null);
    BadHandlerEntry.addAttribute(a2a, null);
    BadHandlerEntry.addAttribute(a3a, null);
    BadHandlerEntry.addAttribute(a4, null);
View Full Code Here

TOP

Related Classes of org.nasutekds.server.types.Attribute

Copyright © 2018 www.massapicom. 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.