Package org.nasutekds.server.api

Examples of org.nasutekds.server.api.AttributeSyntax


      if (! overwriteExisting)
      {
        String oid = toLowerCase(syntax.getOID());
        if (syntaxes.containsKey(oid))
        {
          AttributeSyntax conflictingSyntax = syntaxes.get(oid);

          Message message = ERR_SCHEMA_CONFLICTING_SYNTAX_OID.
              get(syntax.getSyntaxName(), oid,
                  conflictingSyntax.getSyntaxName());
          throw new DirectoryException(
                         ResultCode.CONSTRAINT_VIOLATION, message);
        }
      }
View Full Code Here


           directoryServer.schema.getAttributeType(
                OBJECTCLASS_ATTRIBUTE_TYPE_NAME);

      if (directoryServer.objectClassAttributeType == null)
      {
        AttributeSyntax oidSyntax =
             directoryServer.schema.getSyntax(SYNTAX_OID_NAME);
        if (oidSyntax == null)
        {
          try
          {
View Full Code Here

   *          default is acceptable, or <CODE>null</CODE> otherwise.
   */
  public static AttributeSyntax getAttributeSyntax(String oid,
                                                   boolean allowDefault)
  {
    AttributeSyntax syntax = directoryServer.schema.getSyntax(oid);
    if ((syntax == null) && allowDefault)
    {
      return getDefaultAttributeSyntax();
    }

View Full Code Here

    // out what it is and how to treat what comes after it, then repeat until
    // we get to the end of the value.  But before we start, set default values
    // for everything else we might need to know.
    ConcurrentHashMap<String,String> names =
         new ConcurrentHashMap<String,String>();
    AttributeSyntax syntax = null;
    ConcurrentHashMap<String,CopyOnWriteArrayList<String>> extraProperties =
         new ConcurrentHashMap<String,CopyOnWriteArrayList<String>>();


    while (true)
View Full Code Here

    if(lowerTokenName.equals("x-subst"))
    {
      StringBuilder woidBuffer = new StringBuilder();
      pos = readQuotedString(lowerStr, woidBuffer, pos);
      String syntaxOID = woidBuffer.toString();
      AttributeSyntax subSyntax = schema.getSyntax(syntaxOID);
      if(subSyntax == null)
      {
        Message message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_SYNTAX.get(
            String.valueOf(oid), syntaxOID);
        throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
View Full Code Here

  public void testConstructorDefaultMatchingRules() throws Exception {
    AttributeTypeBuilder builder = new AttributeTypeBuilder(
        "testType", "1.2.3");
    AttributeType type = builder.getInstance();

    AttributeSyntax syntax = DirectoryServer
        .getDefaultAttributeSyntax();
    Assert.assertEquals(type.getApproximateMatchingRule(), syntax
        .getApproximateMatchingRule());
    Assert.assertEquals(type.getEqualityMatchingRule(), syntax
        .getEqualityMatchingRule());
    Assert.assertEquals(type.getOrderingMatchingRule(), syntax
        .getOrderingMatchingRule());
    Assert.assertEquals(type.getSubstringMatchingRule(), syntax
        .getSubstringMatchingRule());
  }
View Full Code Here

   */
  @Test
  public void testConstructorMatchingRules() throws Exception {
    AttributeTypeBuilder builder = new AttributeTypeBuilder(
        "testType", "1.2.3");
    AttributeSyntax syntax = DirectoryServer.getDefaultStringSyntax();
    builder.setApproximateMatchingRule(syntax
        .getApproximateMatchingRule());
    builder.setEqualityMatchingRule(syntax.getEqualityMatchingRule());
    builder.setOrderingMatchingRule(syntax.getOrderingMatchingRule());
    builder.setSubstringMatchingRule(syntax
        .getSubstringMatchingRule());
    AttributeType type = builder.getInstance();

    Assert.assertEquals(type.getApproximateMatchingRule(), syntax
        .getApproximateMatchingRule());
    Assert.assertEquals(type.getEqualityMatchingRule(), syntax
        .getEqualityMatchingRule());
    Assert.assertEquals(type.getOrderingMatchingRule(), syntax
        .getOrderingMatchingRule());
    Assert.assertEquals(type.getSubstringMatchingRule(), syntax
        .getSubstringMatchingRule());
  }
View Full Code Here

   */
  @Test(dependsOnMethods = "testConstructorMatchingRules")
  public void testConstructorInheritsMatchingRules() throws Exception {
    AttributeTypeBuilder builder = new AttributeTypeBuilder(
        "parentType", "1.2.3");
    AttributeSyntax syntax = DirectoryServer.getDefaultStringSyntax();
    builder.setApproximateMatchingRule(syntax
        .getApproximateMatchingRule());
    builder.setEqualityMatchingRule(syntax.getEqualityMatchingRule());
    builder.setOrderingMatchingRule(syntax.getOrderingMatchingRule());
    builder.setSubstringMatchingRule(syntax
        .getSubstringMatchingRule());

    AttributeType parent = builder.getInstance();

    builder.setPrimaryName("childType");
View Full Code Here

TOP

Related Classes of org.nasutekds.server.api.AttributeSyntax

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.