directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r431239 - in /directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions: Syntax.java SyntaxChecker.java
Date Sun, 13 Aug 2006 20:55:29 GMT
Author: akarasulu
Date: Sun Aug 13 13:55:28 2006
New Revision: 431239

URL: http://svn.apache.org/viewvc?rev=431239&view=rev
Log:
adding Syntax and SyntaxChecker interfaces

Added:
    directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/Syntax.java
    directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/SyntaxChecker.java

Added: directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/Syntax.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/Syntax.java?rev=431239&view=auto
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/Syntax.java
(added)
+++ directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/Syntax.java
Sun Aug 13 13:55:28 2006
@@ -0,0 +1,48 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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.server2.schema.descriptions;
+
+
+import javax.naming.NamingException;
+
+
+/**
+ * A syntax definition. Each attribute stored in a directory has a defined
+ * syntax (i.e. data type) which constrains the structure and format of its
+ * values.  
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface Syntax extends SchemaObject
+{
+    /**
+     * Gets whether or not the Syntax is human readible.
+     * 
+     * @return true if the syntax can be interpretted by humans, false otherwise
+     */
+    boolean isHumanReadible();
+
+
+    /**
+     * Gets the SyntaxChecker used to validate values in accordance with this
+     * Syntax.
+     * 
+     * @return the SyntaxChecker
+     */
+    SyntaxChecker getSyntaxChecker() throws NamingException;
+}

Added: directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/SyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/SyntaxChecker.java?rev=431239&view=auto
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/SyntaxChecker.java
(added)
+++ directory/sandbox/akarasulu/apacheds-2.0/schema/descriptions/src/main/java/org/apache/directory/server2/schema/descriptions/SyntaxChecker.java
Sun Aug 13 13:55:28 2006
@@ -0,0 +1,58 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed 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.server2.schema.descriptions;
+
+
+import javax.naming.NamingException;
+
+
+/**
+ * Used to validate values of a particular syntax.  This interface does not
+ * correlate to any LDAP or X.500 construct. It has been created as a means to
+ * enforce a syntax within the server.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface SyntaxChecker
+{
+    /**
+     * Gets the OID of the attribute syntax.
+     * 
+     * @return the object identifier of the Syntax this SyntaxChecker validates
+     */
+    String getSyntaxOid();
+
+
+    /**
+     * Determines if the attribute's value conforms to the attribute syntax.
+     * 
+     * @param value the value of some attribute with the syntax
+     * @return true if the value is in the valid syntax, false otherwise
+     */
+    boolean isValidSyntax( Object value );
+
+
+    /**
+     * Asserts whether or not the attribute's value conforms to the attribute
+     * syntax.
+     * 
+     * @param value the value of some attribute with the syntax
+     * @throws NamingException if the value does not conform to the attribute syntax.
+     */
+    void assertSyntax( Object a_value ) throws NamingException;
+}



Mime
View raw message