Added some syntax checker for teh Bootparameter NIS AT; Updated the SCM part in pom.xml
diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BootParameterSyntaxChecker.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BootParameterSyntaxChecker.java
new file mode 100644
index 0000000..ab956ae
--- /dev/null
+++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BootParameterSyntaxChecker.java
@@ -0,0 +1,295 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
+
+
+import org.apache.directory.api.i18n.I18n;
+import org.apache.directory.api.ldap.model.constants.SchemaConstants;
+import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
+import org.apache.directory.api.util.Strings;
+
+
+/**
+ * A SyntaxChecker which verifies that a value is a BootParameter according to
+ * RFC 2307 :
+ * <pre>
+ * bootparameter = key "=" server ":" path
+ * key = keystring
+ * server = keystring
+ * path = keystring
+ * </pre>
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@SuppressWarnings("serial")
+public final class BootParameterSyntaxChecker extends SyntaxChecker
+{
+ /**
+ * A static instance of BootParameterSyntaxChecker
+ */
+ public static final BootParameterSyntaxChecker INSTANCE =
+ new BootParameterSyntaxChecker( SchemaConstants.BOOT_PARAMETER_SYNTAX );
+
+ /**
+ * A static Builder for this class
+ */
+ public static final class Builder extends SCBuilder<BootParameterSyntaxChecker>
+ {
+ /**
+ * The Builder constructor
+ */
+ private Builder()
+ {
+ super( SchemaConstants.BOOT_PARAMETER_SYNTAX );
+ }
+
+
+ /**
+ * Create a new instance of BootParameterSyntaxChecker
+ * @return A new instance of BootParameterSyntaxChecker
+ */
+ @Override
+ public BootParameterSyntaxChecker build()
+ {
+ return new BootParameterSyntaxChecker( oid );
+ }
+ }
+
+
+ /**
+ * Creates a new instance of BootParameterSyntaxChecker.
+ *
+ * @param oid The OID to use for this SyntaxChecker
+ */
+ private BootParameterSyntaxChecker( String oid )
+ {
+ super( oid );
+ }
+
+
+ /**
+ * @return An instance of the Builder for this class
+ */
+ public static Builder builder()
+ {
+ return new Builder();
+ }
+
+
+ private int parseKeyString( String strValue, int pos, char limit )
+ {
+ try
+ {
+ char c = strValue.charAt( pos );
+
+ // The end of the keyString
+ if ( c == limit )
+ {
+ return pos;
+ }
+
+ // We must have a first alphabetic char
+ if ( Character.isUpperCase( c ) || Character.isLowerCase( c ) )
+ {
+ pos++;
+ }
+ else
+ {
+ return -1;
+ }
+
+ c = strValue.charAt( pos );
+
+ while ( c != limit )
+ {
+ if ( Character.isUpperCase( c ) || Character.isLowerCase( c ) || Character.isDigit( c )
+ || ( c == '-' ) || ( c == ';' ) || ( c == '_' ) )
+ {
+ pos++;
+ }
+ else
+ {
+ return -1;
+ }
+
+ c = strValue.charAt( pos );
+ }
+
+ return pos;
+ }
+ catch ( IndexOutOfBoundsException ioobe )
+ {
+ return -1;
+ }
+ }
+
+
+ private int parseKeyString( String strValue, int pos )
+ {
+ try
+ {
+ char c = strValue.charAt( pos );
+
+ // We must have a first alphabetic char
+ if ( Character.isUpperCase( c ) || Character.isLowerCase( c ) )
+ {
+ pos++;
+ }
+ else
+ {
+ return -1;
+ }
+
+ while ( pos < strValue.length() )
+ {
+ c = strValue.charAt( pos );
+
+ if ( Character.isUpperCase( c ) || Character.isLowerCase( c ) || Character.isDigit( c )
+ || ( c == '-' ) || ( c == ';' ) || ( c == '_' ) )
+ {
+ pos++;
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ return pos;
+ }
+ catch ( IndexOutOfBoundsException ioobe )
+ {
+ return -1;
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isValidSyntax( Object value )
+ {
+ String strValue;
+
+ if ( value == null )
+ {
+ if ( LOG.isDebugEnabled() )
+ {
+ LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
+ }
+
+ return false;
+ }
+
+ if ( value instanceof String )
+ {
+ strValue = ( String ) value;
+ }
+ else if ( value instanceof byte[] )
+ {
+ strValue = Strings.utf8ToString( ( byte[] ) value );
+ }
+ else
+ {
+ strValue = value.toString();
+ }
+
+ // The BootParameter must at least contain a '=' and a ':', plus 3 keyStrings
+ if ( strValue.length() < 5 )
+ {
+ if ( LOG.isDebugEnabled() )
+ {
+ LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, value ) );
+ }
+
+ return false;
+ }
+
+ // The key
+ int pos = parseKeyString( strValue, 0, '=' );
+
+ if ( pos == -1 )
+ {
+ if ( LOG.isDebugEnabled() )
+ {
+ LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, value ) );
+ }
+
+ return false;
+ }
+
+ if ( strValue.charAt( pos ) != '=' )
+ {
+ if ( LOG.isDebugEnabled() )
+ {
+ LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, value ) );
+ }
+
+ return false;
+ }
+ else
+ {
+ pos++;
+ }
+
+ // The server
+ pos = parseKeyString( strValue, pos, ':' );
+
+ if ( pos == -1 )
+ {
+ if ( LOG.isDebugEnabled() )
+ {
+ LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, value ) );
+ }
+
+ return false;
+ }
+
+ if ( strValue.charAt( pos ) != ':' )
+ {
+ if ( LOG.isDebugEnabled() )
+ {
+ LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, value ) );
+ }
+
+ return false;
+ }
+ else
+ {
+ pos++;
+ }
+
+ // The path
+ pos = parseKeyString( strValue, pos );
+
+ if ( pos == -1 )
+ {
+ if ( LOG.isDebugEnabled() )
+ {
+ LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, value ) );
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BootParameterSyntaxCheckerTest.java b/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BootParameterSyntaxCheckerTest.java
new file mode 100644
index 0000000..2a556f7
--- /dev/null
+++ b/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BootParameterSyntaxCheckerTest.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.ldap.model.schema.syntaxes;
+
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.apache.directory.api.ldap.model.schema.syntaxCheckers.BootParameterSyntaxChecker;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.parallel.Execution;
+import org.junit.jupiter.api.parallel.ExecutionMode;
+
+/**
+ * Test cases for BootParameterSyntaxChecker.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@Execution(ExecutionMode.CONCURRENT)
+public class BootParameterSyntaxCheckerTest
+{
+ BootParameterSyntaxChecker checker = BootParameterSyntaxChecker.INSTANCE;
+
+
+ @Test
+ public void testNullString()
+ {
+ assertFalse( checker.isValidSyntax( null ) );
+ }
+
+
+ @Test
+ public void testEmptyString()
+ {
+ assertFalse( checker.isValidSyntax( "" ) );
+ }
+
+
+ @Test
+ public void testWrongCase()
+ {
+ assertFalse( checker.isValidSyntax( "a=b" ) );
+ assertFalse( checker.isValidSyntax( "a" ) );
+ assertFalse( checker.isValidSyntax( "a = b : c" ) );
+ assertFalse( checker.isValidSyntax( "a=b:" ) );
+ assertFalse( checker.isValidSyntax( "#=b:c" ) );
+ assertFalse( checker.isValidSyntax( "a=:c" ) );
+ assertFalse( checker.isValidSyntax( "1=b:c" ) );
+ }
+
+
+ @Test
+ public void testCorrectCase()
+ {
+ assertTrue( checker.isValidSyntax( "a=b:c" ) );
+ assertTrue( checker.isValidSyntax( "a2c=d_f:gHi" ) );
+ }
+}
diff --git a/pom.xml b/pom.xml
index cf2409c..3628834 100644
--- a/pom.xml
+++ b/pom.xml
@@ -643,8 +643,8 @@
<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/directory-ldap-api.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/directory-ldap-api.git</developerConnection>
- <url>https://gitbox.apache.org/repos/asf?p=directory-ldap-api.git;a=shortlog;h=refs/remotes/tags/${project.scm.tag}</url>
- <tag>HEAD</tag>
+ <url>https://github.com/apache/directory-ldap-api/tree/${project.scm.tag}</url>
+ <tag>master</tag>
</scm>
<reporting>