Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.RDN


      return null;
    }


    // Get the information about the RDN attributes.
    RDN rdn = dn.getRDN();
    int numAVAs = rdn.getNumValues();

    // If there is only one RDN attribute, then see which objectclass we should
    // use.
    ObjectClass structuralClass;
    if (numAVAs == 1)
    {
      AttributeType attrType = rdn.getAttributeType(0);

      if (attrType.hasName(ATTR_C))
      {
        structuralClass = DirectoryServer.getObjectClass(OC_COUNTRY, true);
      }
      else if (attrType.hasName(ATTR_DC))
      {
        structuralClass = DirectoryServer.getObjectClass(OC_DOMAIN, true);
      }
      else if (attrType.hasName(ATTR_O))
      {
        structuralClass = DirectoryServer.getObjectClass(OC_ORGANIZATION, true);
      }
      else if (attrType.hasName(ATTR_OU))
      {
        structuralClass =
             DirectoryServer.getObjectClass(OC_ORGANIZATIONAL_UNIT_LC, true);
      }
      else
      {
        structuralClass =
             DirectoryServer.getObjectClass(OC_UNTYPED_OBJECT_LC, true);
      }
    }
    else
    {
      structuralClass =
           DirectoryServer.getObjectClass(OC_UNTYPED_OBJECT_LC, true);
    }


    // Get the top and untypedObject classes to include in the entry.
    LinkedHashMap<ObjectClass,String> objectClasses =
         new LinkedHashMap<ObjectClass,String>(3);

    objectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP);
    objectClasses.put(structuralClass, structuralClass.getNameOrOID());


    // Iterate through the RDN attributes and add them to the set of user or
    // operational attributes.
    LinkedHashMap<AttributeType,List<Attribute>> userAttributes =
         new LinkedHashMap<AttributeType,List<Attribute>>();
    LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes =
         new LinkedHashMap<AttributeType,List<Attribute>>();

    boolean extensibleObjectAdded = false;
    for (int i=0; i < numAVAs; i++)
    {
      AttributeType attrType = rdn.getAttributeType(i);
      AttributeValue attrValue = rdn.getAttributeValue(i);
      String attrName = rdn.getAttributeName(i);

      // First, see if this type is allowed by the untypedObject class.  If not,
      // then we'll need to include the extensibleObject class.
      if ((! structuralClass.isRequiredOrOptional(attrType)) &&
          (! extensibleObjectAdded))
View Full Code Here


    }

    LinkedList<SearchFilter> filterComps = new LinkedList<SearchFilter>();
    for (int i=0; i < peerDN.getNumComponents(); i++)
    {
      RDN rdn = peerDN.getRDN(i);
      for (int j=0; j < rdn.getNumValues(); j++)
      {
        String lowerName = toLowerCase(rdn.getAttributeName(j));
        AttributeType attrType = attributeMap.get(lowerName);
        if (attrType != null)
        {
          filterComps.add(SearchFilter.createEqualityFilter(attrType,
                                            rdn.getAttributeValue(j)));
        }
      }
    }

    if (filterComps.isEmpty())
View Full Code Here

      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 +
View Full Code Here

    {
      // The entry is outside the scope of this plugin.
      return PluginResult.PreOperation.continueOperationProcessing();
    }

    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(
View Full Code Here

    {
      // The entry is outside the scope of this plugin.
      return;
    }

    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;
        if((conflictDN=uniqueAttrValue2Dn.get(v)) == null)
        {
         conflictDN = getConflictingEntryDN(baseDNs,
                             modifyDNOperation.getEntryDN(), config, v);
View Full Code Here

    {
      // The entry is outside the scope of this plugin.
      return PostOperation.continueOperationProcessing();
    }

    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;
      }
      AttributeValue v = newRDN.getAttributeValue(i);
      uniqueAttrValue2Dn.remove(v);
    }
    return PostOperation.continueOperationProcessing();
  }
View Full Code Here

      throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, message);
    }


    // Get the RDN for the requested DN and make sure it is single-valued.
    RDN entryRDN = entryDN.getRDN();
    if (entryRDN.isMultiValued())
    {
      Message message =
          ERR_MONITOR_MULTIVALUED_RDN.get(String.valueOf(entryDN));
      throw new DirectoryException(
              ResultCode.NO_SUCH_OBJECT, message, baseMonitorDN, null);
View Full Code Here

    monitorClasses.put(monitorOC, OC_MONITOR_BRANCH);

    HashMap<AttributeType,List<Attribute>> monitorUserAttrs =
      new LinkedHashMap<AttributeType,List<Attribute>>();

    RDN rdn = dn.getRDN();
    if (rdn != null)
    {
      // Add the RDN values
      for (int i=0; i<rdn.getNumValues(); i++)
      {
        AttributeType attributeType = rdn.getAttributeType(i);
        AttributeValue value = rdn.getAttributeValue(attributeType);
        Attribute attr = Attributes.create(attributeType, value);
        List<Attribute> attrList = new ArrayList<Attribute>(1);
        attrList.add(attr);
        monitorUserAttrs.put(attributeType, attrList);
      }
View Full Code Here

         new LinkedHashMap<AttributeType,List<Attribute>>(
                  monitorAttrs.size()+1);


    // Make sure to include the RDN attribute.
    RDN            entryRDN = entryDN.getRDN();
    AttributeType  rdnType  = entryRDN.getAttributeType(0);
    AttributeValue rdnValue = entryRDN.getAttributeValue(0);

    Attribute rdnAttr = Attributes.create(rdnType, rdnValue);
    ArrayList<Attribute> rdnList = new ArrayList<Attribute>(1);
    rdnList.add(rdnAttr);
    attrMap.put(rdnType, rdnList);
View Full Code Here

  @Override
  public boolean isAllowed(LocalBackendModifyDNOperation operation)
  {
    boolean ret = true;
    DN newSuperiorDN;
    RDN oldRDN = operation.getOriginalEntry().getDN().getRDN();
    RDN newRDN = operation.getNewRDN();
    if (!skipAccessCheck(operation))
    {
      // If this is a modifyDN move to a new superior, then check if the
      // superior DN has import accesss.
      if ((newSuperiorDN = operation.getNewSuperior()) != null)
View Full Code Here

TOP

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

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.