Package org.nasutekds.guitools.controlpanel.datamodel

Examples of org.nasutekds.guitools.controlpanel.datamodel.CustomSearchResult


    ServerDescriptor server = null;
    if (getInfo() != null)
    {
      server = getInfo().getServerDescriptor();
    }
    CustomSearchResult csr = null;
    if (server != null)
    {
      csr = server.getEntryCachesMonitor();
    }
    if (csr != null)
View Full Code Here


    }
    finally
    {
      srs.close();
    }
    CustomSearchResult csr = new CustomSearchResult(sr,
        ConfigConstants.DN_DEFAULT_SCHEMA_ROOT);

    schema = getBaseSchema();

    List<Object> attrs =
      csr.getAttributeValues(ConfigConstants.ATTR_ATTRIBUTE_TYPES_LC);
    Set<String> remainingAttrs = new HashSet<String>();
    for (Object o : attrs)
    {
      remainingAttrs.add((String)o);
    }

    while (!remainingAttrs.isEmpty())
    {
      DirectoryException lastException = null;
      boolean oneRegistered = false;
      Set<String> registeredAttrs = new HashSet<String>();
      for (String attrDefinition : remainingAttrs)
      {
        ByteStringBuilder sb = new ByteStringBuilder();
        sb.append(attrDefinition);
        try
        {
          AttributeType attrType =
            AttributeTypeSyntax.decodeAttributeType(sb, schema, false);
          schema.registerAttributeType(attrType, true);
          oneRegistered = true;
          registeredAttrs.add(attrDefinition);
        }
        catch (DirectoryException de)
        {
          lastException = de;
        }
      }
      if (!oneRegistered)
      {
        throw lastException;
      }
      remainingAttrs.removeAll(registeredAttrs);
    }

    List<Object> objectClasses =
      csr.getAttributeValues(ConfigConstants.ATTR_OBJECTCLASSES_LC);

    Set<String> remainingOcs = new HashSet<String>();
    for (Object o : objectClasses)
    {
      remainingOcs.add((String)o);
View Full Code Here

      while (en.hasMore())
      {
        sr = en.next();
      }

      return new CustomSearchResult(sr, dn);
    }
    finally
    {
      if (isInterrupted())
      {
View Full Code Here

        }
      }
    }
    else
    {
      CustomSearchResult csr = new CustomSearchResult(sr, searchBaseDN);
      String backendID = ConnectionUtils.getFirstValue(sr,
          "ds-backend-id");
      String entryCount = ConnectionUtils.getFirstValue(sr,
          "ds-backend-entry-count");
      Set<String> baseDnEntries = ConnectionUtils.getValues(sr,
View Full Code Here

  private void handleTaskSearchResult(SearchResult sr,
      String searchBaseDN,
      Collection<TaskEntry> taskEntries, List<OpenDsException> ex)
  throws NamingException
  {
    CustomSearchResult csr = new CustomSearchResult(sr, searchBaseDN);
    try
    {
      if (isTaskEntry(csr))
      {
        taskEntries.add(new TaskEntry(csr.getEntry()));
      }
    }
    catch (OpenDsException ode)
    {
      ex.add(ode);
View Full Code Here

    ServerDescriptor server = null;
    if (getInfo() != null)
    {
      server = getInfo().getServerDescriptor();
    }
    CustomSearchResult csr = null;
    if (server != null)
    {
      csr = server.getSystemInformationMonitor();
    }
    if (csr != null)
View Full Code Here

    ServerDescriptor server = null;
    if (getInfo() != null)
    {
      server = getInfo().getServerDescriptor();
    }
    CustomSearchResult csr = null;
    if (server != null)
    {
      csr = server.getRootMonitor();
    }
    if (csr != null)
View Full Code Here

    Set<TaskEntry> list = new HashSet<TaskEntry>();
    Random r = new Random();
    int numberTasks = r.nextInt(10);
    for (int i= 0; i<numberTasks; i++)
    {
      CustomSearchResult csr =
        new CustomSearchResult("cn=mytask"+i+",cn=tasks");
      String p = "ds-task-";
      String[] attrNames =
      {
          p + "id",
          p + "class-name",
          p + "state",
          p + "scheduled-start-time",
          p + "actual-start-time",
          p + "completion-time",
          p + "dependency-id",
          p + "failed-dependency-action",
          p + "log-message",
          p + "notify-on-error",
          p + "notify-on-completion",
          p + "ds-recurring-task-schedule"
      };
      String[] values =
      {
          "ID",
          "TheClassName",
          "TheState",
          "Schedule Start Time",
          "Actual Start Time",
          "Completion Time",
          "Dependency ID",
          "Failed Dependency Action",
          "Log Message.                              Should be pretty long"+
          "Log Message.                              Should be pretty long"+
          "Log Message.                              Should be pretty long"+
          "Log Message.                              Should be pretty long"+
          "Log Message.                              Should be pretty long",
          "Notify On Error",
          "Notify On Completion",
          "Recurring Task Schedule"
      };
      for (int j=0; j < attrNames.length; j++)
      {
        List<Object> attrValues = new ArrayList<Object>(1);
        attrValues.add(values[j] + r.nextInt());
        csr.set(attrNames[j], attrValues);
      }
      try
      {
        Entry entry = getEntry(csr);
        TaskEntry task = new TaskEntry(entry);
        list.add(task);
      }
      catch (Throwable t)
      {
        LOG.log(Level.SEVERE, "Error getting entry '"+csr.getDN()+"': "+t, t);
      }
    }
    return list;
  }
View Full Code Here

  private Set<TaskEntry> createDummyTaskList()
  {
    Set<TaskEntry> list = new HashSet<TaskEntry>();
    for (int i= 0; i<10; i++)
    {
      CustomSearchResult csr =
        new CustomSearchResult("cn=mytask"+i+",cn=tasks");
      String p = "ds-task-";
      String[] attrNames =
      {
          p + "id",
          p + "class-name",
          p + "state",
          p + "scheduled-start-time",
          p + "actual-start-time",
          p + "completion-time",
          p + "dependency-id",
          p + "failed-dependency-action",
          p + "log-message",
          p + "notify-on-error",
          p + "notify-on-completion",
          p + "ds-recurring-task-schedule"
      };
      String[] values =
      {
          "A very 29-backup - Sun Mar 29 00:00:00 MET 2009",
          "A long task type",
          "A very long task status",
          "Schedule Start Time",
          "Actual Start Time",
          "Completion Time",
          "Dependency ID",
          "Failed Dependency Action",
          "Log Message.                              Should be pretty long\n"+
          "Log Message.                              Should be pretty long\n"+
          "Log Message.                              Should be pretty long\n"+
          "Log Message.                              Should be pretty long\n"+
          "Log Message.                              Should be pretty long\n",
          "Notify On Error",
          "Notify On Completion",
          "Recurring Task Schedule"
      };
      for (int j=0; j < attrNames.length; j++)
      {
        List<Object> attrValues = new ArrayList<Object>(1);
        attrValues.add(values[j]);
        csr.set(attrNames[j], attrValues);
      }
      try
      {
        Entry entry = getEntry(csr);
        TaskEntry task = new TaskEntry(entry);
        list.add(task);
      }
      catch (Throwable t)
      {
        LOG.log(Level.SEVERE, "Error getting entry '"+csr.getDN()+"': "+t, t);
      }
    }
    return list;
  }
View Full Code Here

    }
  }

  private void updatePanel(ObjectClassValue newValue)
  {
    CustomSearchResult oldResult = searchResult;
    CustomSearchResult newResult = new CustomSearchResult(searchResult.getDN());

    for (String attrName : schemaReadOnlyAttributesLowerCase)
    {
      List<Object> values = searchResult.getAttributeValues(attrName);
      if (!values.isEmpty())
      {
        newResult.set(attrName, values);
      }
    }
    ignoreEntryChangeEvents = true;

    Schema schema = getInfo().getServerDescriptor().getSchema();
    if (schema != null)
    {
      ArrayList<String> attributes = new ArrayList<String>();
      ArrayList<String> ocs = new ArrayList<String>();
      if (newValue.getStructural() != null)
      {
        ocs.add(newValue.getStructural().toLowerCase());
      }
      for (String oc : newValue.getAuxiliary())
      {
        ocs.add(oc.toLowerCase());
      }
      for (String oc : ocs)
      {
        ObjectClass objectClass = schema.getObjectClass(oc);
        if (objectClass != null)
        {
          for (AttributeType attr : objectClass.getRequiredAttributeChain())
          {
            attributes.add(attr.getNameOrOID().toLowerCase());
          }
          for (AttributeType attr : objectClass.getOptionalAttributeChain())
          {
            attributes.add(attr.getNameOrOID().toLowerCase());
          }
        }
      }
      for (String attrName : editableOperationalAttrNames)
      {
        attributes.add(attrName.toLowerCase());
      }
      for (String attrName : hmEditors.keySet())
      {
        String attrNoOptions =
          Utilities.getAttributeNameWithoutOptions(attrName);
        if (!attributes.contains(attrNoOptions))
        {
          continue;
        }
        if (isPassword(attrName))
        {
          List<String> newPwds = getNewPasswords(attrName);
          if (newPwds.equals(lastUserPasswords.get(attrName)))
          {
            List<Object> oldValues = searchResult.getAttributeValues(attrName);
            newResult.set(attrName, oldValues);
          }
          else
          {
            setValues(newResult, attrName);
          }
View Full Code Here

TOP

Related Classes of org.nasutekds.guitools.controlpanel.datamodel.CustomSearchResult

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.