Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.AttributeType


          objectClasses.put(objectClass, ocName);
        }
      }
      else
      {
        AttributeType attrType = DirectoryServer.getAttributeType(lowerName);
        if (attrType == null)
        {
          attrType = DirectoryServer.getDefaultAttributeType(attrName);
        }

        AttributeBuilder builder = new AttributeBuilder(attribute, true);
        for (Object value : this.getAttributeValues(attrName))
        {
          ByteString bs;
          if (value instanceof byte[])
          {
            bs = ByteString.wrap((byte[])value);
          }
          else
          {
            bs = ByteString.valueOf(value.toString());
          }
          AttributeValue attributeValue =
            AttributeValues.create(attrType, bs);
          builder.add(attributeValue);
        }
        List<org.nasutekds.server.types.Attribute> attrList =
          new ArrayList<org.nasutekds.server.types.Attribute>(1);
        attrList.add(builder.toAttribute());

        if (attrType.isOperational())
        {
          operationalAttributes.put(attrType, attrList);
        }
        else
        {
View Full Code Here


    for (int i=0; i<comps.length; i++)
    {
      comps[i].setVisible(!index.isDatabaseIndex());
    }

    AttributeType attr = index.getAttributeType();
    repopulateTypesPanel(attr);

    if (index.isDatabaseIndex())
    {
      entryLimit.setText("");
View Full Code Here

    attributes.addItemListener(new ItemListener()
    {
      public void itemStateChanged(ItemEvent ev)
      {
        String n = getAttributeName();
        AttributeType attr = null;
        if (n != null)
        {
          attr = schema.getAttributeType(n.toLowerCase());
        }
        repopulateTypesPanel(attr);
View Full Code Here

   * @param entry the entry to retrieve an attribute value from.
   * @param pwdAttrName attribute name to retrieve the value for.
   * @return <CODE>AttributeValue</CODE> or <CODE>null</CODE>.
   */
  private AttributeValue getAttrValue(Entry entry, String pwdAttrName) {
    AttributeType pwdAttrType = DirectoryServer.getAttributeType(
            pwdAttrName, true);
    List<Attribute> pwdAttrList = entry.getAttribute(pwdAttrType);
    if ((pwdAttrList != null) && (!pwdAttrList.isEmpty()))
    {
      for (Attribute attr : pwdAttrList)
View Full Code Here

      {
        ByteStringBuilder sb = new ByteStringBuilder();
        sb.append(attrDefinition);
        try
        {
          AttributeType attrType =
            AttributeTypeSyntax.decodeAttributeType(sb, schema, false);
          schema.registerAttributeType(attrType, true);
          oneRegistered = true;
          registeredAttrs.add(attrDefinition);
        }
View Full Code Here

  {
    boolean hasUserPassword = false;
    Schema schema = getInfo().getServerDescriptor().getSchema();
    if ((ocs != null) && (schema != null))
    {
      AttributeType attr = schema.getAttributeType(
          ServerConstants.ATTR_USER_PASSWORD);
      for (String oc : ocs)
      {
        ObjectClass objectClass = schema.getObjectClass(oc);
        if ((objectClass != null) && (attr != null))
View Full Code Here

        objectclassesToKeep.add(oc);
      }
    }
    for (String name : attrsToKeep)
    {
      AttributeType attr = sc.getAttributeType(name.toLowerCase());
      if (attr != null)
      {
        attributesToKeep.add(attr);
      }
    }
View Full Code Here

    if (o != null)
    {
      Schema schema = getInfo().getServerDescriptor().getSchema();
      if (schema != null)
      {
        AttributeType attr = schema.getAttributeType(o.toLowerCase());
        if (attr != null)
        {
          notifySchemaSelectionListeners(attr);
        }
      }
View Full Code Here

   */
  @Test(dataProvider = "testDecodeValueLegalData")
  public void testDecodeValue(String value) {
    AttributeTypePropertyDefinition.setCheckSchema(true);
    AttributeTypePropertyDefinition d = createPropertyDefinition();
    AttributeType expected = DirectoryServer.getAttributeType(value);
    assertEquals(d.decodeValue(value), expected);
  }
View Full Code Here

   */
  @Test(dataProvider = "testDecodeValueIllegalData")
  public void testDecodeValue3(String value) {
    AttributeTypePropertyDefinition.setCheckSchema(false);
    AttributeTypePropertyDefinition d = createPropertyDefinition();
    AttributeType type = d.decodeValue(value);
    assertEquals(type.getNameOrOID(), value);

    // Make sure to turn schema checking back on so that other tests which
    // depend on it don't fail.
    AttributeTypePropertyDefinition.setCheckSchema(true);
  }
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.