Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.AttributeType


                certAttrName));
        configAcceptable = false;
        break;
      }

      AttributeType userAttrType =
           DirectoryServer.getAttributeType(userAttrName, false);
      if (userAttrType == null)
      {
        unacceptableReasons.add(ERR_SATUACM_NO_SUCH_ATTR.get(
                mapStr,
View Full Code Here


                String.valueOf(configEntryDN),
                certAttrName));
        break;
      }

      AttributeType userAttrType =
           DirectoryServer.getAttributeType(userAttrName, false);
      if (userAttrType == null)
      {
        if (resultCode == ResultCode.SUCCESS)
        {
View Full Code Here

    // - Objectclasses
    // - Attribute Syntax
    // - Matching Rule
    // - Name Form

    AttributeType attrType1 = DirectoryServer.getAttributeType(oid);
    if (attrType1 != null)
    {
      AttributeType attrType2 = DirectoryServer.getAttributeType(value2String);
      if (attrType2 == null)
      {
        return false;
      }
      else
View Full Code Here

    this.taskScheduler = taskScheduler;
    this.recurringTaskEntry = recurringTaskEntry;
    this.recurringTaskEntryDN = recurringTaskEntry.getDN();

    // Get the recurring task ID from the entry.  If there isn't one, then fail.
    AttributeType attrType = DirectoryServer.getAttributeType(
                                  ATTR_RECURRING_TASK_ID.toLowerCase());
    if (attrType == null)
    {
      attrType = DirectoryServer.getDefaultAttributeType(
                                      ATTR_RECURRING_TASK_ID);
View Full Code Here

      nextTask = task.getClass().newInstance();
      Entry nextTaskEntry = recurringTaskEntry.duplicate(false);
      SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmssSSS");
      String nextTaskID = task.getTaskID() + "-" + df.format(nextTaskDate);
      String nextTaskIDName = NAME_PREFIX_TASK + "id";
      AttributeType taskIDAttrType =
        DirectoryServer.getAttributeType(nextTaskIDName);
      Attribute nextTaskIDAttr = Attributes.create(
        taskIDAttrType, nextTaskID);
      nextTaskEntry.replaceAttribute(nextTaskIDAttr);
      RDN nextTaskRDN = RDN.decode(nextTaskIDName + "=" + nextTaskID);
      DN nextTaskDN = new DN(nextTaskRDN,
        taskScheduler.getTaskBackend().getScheduledTasksParentDN());
      nextTaskEntry.setDN(nextTaskDN);

      String nextTaskStartTimeName = NAME_PREFIX_TASK +
        "scheduled-start-time";
      AttributeType taskStartTimeAttrType =
        DirectoryServer.getAttributeType(nextTaskStartTimeName);
      Attribute nextTaskStartTimeAttr = Attributes.create(
        taskStartTimeAttrType, nextTaskStartTime);
      nextTaskEntry.replaceAttribute(nextTaskStartTimeAttr);
View Full Code Here

   */
  public Task entryToScheduledTask(Entry entry, Operation operation)
         throws DirectoryException
  {
    // Get the name of the class that implements the task logic.
    AttributeType attrType =
         DirectoryServer.getAttributeType(ATTR_TASK_CLASS.toLowerCase());
    if (attrType == null)
    {
      attrType = DirectoryServer.getDefaultAttributeType(ATTR_TASK_CLASS);
    }
View Full Code Here

        {
          excludeAllOperationalAttributes = true;
        }
        else
        {
          AttributeType attrType  = DirectoryServer.getAttributeType(lowerName);
          if (attrType == null)
          {
            attrType = DirectoryServer.getDefaultAttributeType(attrName);
          }

          excludeAttributes.add(attrType);
        }
      }
    }

    HashSet<AttributeType> includeAttributes;
    boolean includeAllUserAttributes = false;
    boolean includeAllOperationalAttributes = false;
    if (includeAttributeStrings == null)
    {
      includeAttributes = null;
    }
    else
    {
      includeAttributes = new HashSet<AttributeType>();
      for (String attrName : includeAttributeStrings.getValues())
      {
        String        lowerName = attrName.toLowerCase();
         if(lowerName.equals("*"))
        {
          includeAllUserAttributes = true;
        }
        else if(lowerName.equals("+"))
        {
          includeAllOperationalAttributes = true;
        }
        else
        {
          AttributeType attrType  = DirectoryServer.getAttributeType(lowerName);
          if (attrType == null)
          {
            attrType = DirectoryServer.getDefaultAttributeType(attrName);
          }

View Full Code Here

    }

    for (Modification m : modifyOperation.getModifications())
    {
      Attribute a = m.getAttribute();
      AttributeType t = a.getAttributeType();
      if (! config.getType().contains(t))
      {
        // This modification isn't for a unique attribute.
        continue;
      }

      switch (m.getModificationType())
      {
        case ADD:
        case REPLACE:
          for (AttributeValue v : a)
          {
            try
            {
              DN conflictDN = null;
              //Raise an exception if a conflicting concurrent operation is in
              //progress. Otherwise, store this attribute value with its
              //corresponding DN and proceed.
              if((conflictDN=
                      uniqueAttrValue2Dn.putIfAbsent(v, entryDN))==null)
              {
               conflictDN = getConflictingEntryDN(baseDNs, entryDN, config,
                                                   v);
              }
              if (conflictDN != null)
              {
                Message msg = ERR_PLUGIN_UNIQUEATTR_ATTR_NOT_UNIQUE.get(
                    t.getNameOrOID(), v.getValue().toString(),
                    conflictDN.toString());
                return PluginResult.PreOperation.stopProcessing(
                    ResultCode.CONSTRAINT_VIOLATION, msg);
              }
            }
            catch (DirectoryException de)
            {
              if (debugEnabled())
              {
                TRACER.debugCaught(DebugLogLevel.ERROR, de);
              }

              Message message = ERR_PLUGIN_UNIQUEATTR_INTERNAL_ERROR.get(
                                     de.getResultCode().toString(),
                                     de.getMessageObject());

              return PluginResult.PreOperation.stopProcessing(
                    DirectoryServer.getServerErrorResultCode(), message);
            }
          }
          break;

        case INCREMENT:
          // We could calculate the new value, but we'll just take it from the
          // updated entry.
          List<Attribute> attrList =
               modifyOperation.getModifiedEntry().getAttribute(t,
                                                               a.getOptions());
          if (attrList != null)
          {
            for (Attribute updatedAttr : attrList)
            {
              if (! updatedAttr.optionsEqual(a.getOptions()))
              {
                continue;
              }

              for (AttributeValue v : updatedAttr)
              {
                try
                {
                  DN conflictDN = null;
                  //Raise an exception if a conflicting concurrent operation is
                  //in progress. Otherwise, store this attribute value with its
                  //corresponding DN and proceed.
                  if((conflictDN=
                      uniqueAttrValue2Dn.putIfAbsent(v, entryDN))==null)
                  {
                    conflictDN = getConflictingEntryDN(baseDNs, entryDN,
                                                        config, v);
                  }
                  if (conflictDN != null)
                  {
                    Message msg = ERR_PLUGIN_UNIQUEATTR_ATTR_NOT_UNIQUE.get(
                        t.getNameOrOID(), v.getValue().toString(),
                        conflictDN.toString());
                    return PluginResult.PreOperation.stopProcessing(
                        ResultCode.CONSTRAINT_VIOLATION, msg);
                  }
                }
View Full Code Here

    }

    RDN newRDN = modifyDNOperation.getNewRDN();
    for (int i=0; i < newRDN.getNumValues(); i++)
    {
      AttributeType t = newRDN.getAttributeType(i);
      if (! config.getType().contains(t))
      {
        // We aren't interested in this attribute type.
        continue;
      }

      try
      {
        AttributeValue v = newRDN.getAttributeValue(i);
        DN conflictDN = null;
        //Raise an exception if a conflicting concurrent operation is in
        //progress. Otherwise, store this attribute value with its
        //corresponding DN and proceed.
        if((conflictDN=uniqueAttrValue2Dn.putIfAbsent(
                              v, modifyDNOperation.getEntryDN()))==null)
        {
          conflictDN = getConflictingEntryDN(baseDNs,
            modifyDNOperation.getEntryDN(), config, v);
        }
        if (conflictDN != null)
        {
          Message msg = ERR_PLUGIN_UNIQUEATTR_ATTR_NOT_UNIQUE.get(
              t.getNameOrOID(), v.getValue().toString(),
              conflictDN.toString());
          return PluginResult.PreOperation.stopProcessing(
              ResultCode.CONSTRAINT_VIOLATION, msg);
        }
      }
View Full Code Here

    }

    for (Modification m : modifyOperation.getModifications())
    {
      Attribute a = m.getAttribute();
      AttributeType t = a.getAttributeType();
      if (! config.getType().contains(t))
      {
        // This modification isn't for a unique attribute.
        continue;
      }

      switch (m.getModificationType())
      {
        case ADD:
        case REPLACE:
          for (AttributeValue v : a)
          {
            try
            {
              DN conflictDN = null;
              if((conflictDN=uniqueAttrValue2Dn.get(v)) == null)
              {
               conflictDN = getConflictingEntryDN(baseDNs, entryDN, config,
                                                    v);
              }
              if (conflictDN != null)
              {
                Message message = ERR_PLUGIN_UNIQUEATTR_SYNC_NOT_UNIQUE.get(
                                       t.getNameOrOID(),
                                       modifyOperation.getConnectionID(),
                                       modifyOperation.getOperationID(),
                                       v.getValue().toString(),
                                       entryDN.toString(),
                                       conflictDN.toString());
                DirectoryServer.sendAlertNotification(this,
                                     ALERT_TYPE_UNIQUE_ATTR_SYNC_CONFLICT,
                                     message);
              }
            }
            catch (DirectoryException de)
            {
              if (debugEnabled())
              {
                TRACER.debugCaught(DebugLogLevel.ERROR, de);
              }

              Message message = ERR_PLUGIN_UNIQUEATTR_INTERNAL_ERROR_SYNC.get(
                                    modifyOperation.getConnectionID(),
                                    modifyOperation.getOperationID(),
                                    entryDN.toString(),
                                    de.getResultCode().toString(),
                                    de.getMessageObject());
              DirectoryServer.sendAlertNotification(this,
                                   ALERT_TYPE_UNIQUE_ATTR_SYNC_ERROR, message);
            }
          }
          break;

        case INCREMENT:
          // We could calculate the new value, but we'll just take it from the
          // updated entry.
          List<Attribute> attrList =
               modifyOperation.getModifiedEntry().getAttribute(t,
                                                               a.getOptions());
          if (attrList != null)
          {
            for (Attribute updatedAttr : attrList)
            {
              if (! updatedAttr.optionsEqual(a.getOptions()))
              {
                continue;
              }

              for (AttributeValue v : updatedAttr)
              {
                try
                {
                  DN conflictDN = null;
                  if((conflictDN=uniqueAttrValue2Dn.get(v)) == null)
                  {
                   conflictDN = getConflictingEntryDN(baseDNs, entryDN,
                                                        config, v);
                  }
                  if (conflictDN != null)
                  {
                    Message message = ERR_PLUGIN_UNIQUEATTR_SYNC_NOT_UNIQUE.get(
                                           t.getNameOrOID(),
                                           modifyOperation.getConnectionID(),
                                           modifyOperation.getOperationID(),
                                           v.getValue().toString(),
                                           entryDN.toString(),
                                           conflictDN.toString());
View Full Code Here

TOP

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

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.