directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seman...@apache.org
Subject svn commit: r1735231 - in /directory/shared/trunk/ldap: codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/ extras/codec-api/src/checkstyle/ extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permiss...
Date Wed, 16 Mar 2016 14:02:38 GMT
Author: semancik
Date: Wed Mar 16 14:02:37 2016
New Revision: 1735231

URL: http://svn.apache.org/viewvc?rev=1735231&view=rev
Log:
Support for Permissive Modify control (a.k.a. ease modify restrictions, 1.2.840.113556.1.4.1413)
in the API.

Added:
    directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/
    directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModify.java
    directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModifyImpl.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyFactory.java
Modified:
    directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
    directory/shared/trunk/ldap/extras/codec-api/src/checkstyle/suppressions.xml

Modified: directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java?rev=1735231&r1=1735230&r2=1735231&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
(original)
+++ directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/CodecFactoryUtil.java
Wed Mar 16 14:02:37 2016
@@ -37,6 +37,8 @@ import org.apache.directory.api.ldap.cod
 import org.apache.directory.api.ldap.extras.controls.ad.AdShowDeleted;
 import org.apache.directory.api.ldap.extras.controls.ad.AdDirSync;
 import org.apache.directory.api.ldap.extras.controls.ad_impl.AdShowDeletedFactory;
+import org.apache.directory.api.ldap.extras.controls.permissiveModify.PermissiveModify;
+import org.apache.directory.api.ldap.extras.controls.permissiveModify_impl.PermissiveModifyFactory;
 import org.apache.directory.api.ldap.extras.controls.ad_impl.AdDirSyncFactory;
 import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy;
 import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory;
@@ -166,6 +168,10 @@ public final class CodecFactoryUtil
         ControlFactory<AdShowDeleted> adDeletedFactory = new AdShowDeletedFactory(
apiService );
         controlFactories.put( adDeletedFactory.getOid(), adDeletedFactory );
         LOG.info( "Registered pre-bundled control factory: {}", adDeletedFactory.getOid()
);
+        
+        ControlFactory<PermissiveModify> permissiveModifyFactory = new PermissiveModifyFactory(
apiService );
+        controlFactories.put( permissiveModifyFactory.getOid(), permissiveModifyFactory );
+        LOG.info( "Registered pre-bundled control factory: {}", permissiveModifyFactory.getOid()
);
     }
 
 

Modified: directory/shared/trunk/ldap/extras/codec-api/src/checkstyle/suppressions.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/checkstyle/suppressions.xml?rev=1735231&r1=1735230&r2=1735231&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/checkstyle/suppressions.xml (original)
+++ directory/shared/trunk/ldap/extras/codec-api/src/checkstyle/suppressions.xml Wed Mar 16
14:02:37 2016
@@ -27,4 +27,5 @@
     <!-- Contol inferfaces that don't declare any new method -->
     <suppress files="org.apache.directory.api.ldap.extras.extended" checks="InterfaceIsType"
/>
     <suppress files="org.apache.directory.api.ldap.extras.controls.ad" checks="InterfaceIsType"
/>
+    <suppress files="org.apache.directory.api.ldap.extras.controls.permissiveModify" checks="InterfaceIsType"
/>
 </suppressions>

Added: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModify.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModify.java?rev=1735231&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModify.java
(added)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModify.java
Wed Mar 16 14:02:37 2016
@@ -0,0 +1,35 @@
+/*
+ * 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.extras.controls.permissiveModify;
+
+
+import org.apache.directory.api.ldap.model.message.Control;
+
+
+/**
+ * The Permissive Modify control. This is telling the server to ease modify restrictions.
+ * Allows add of duplicate value or delete of non-existing value.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface PermissiveModify extends Control
+{
+    /** The Permissive Modify control OID */
+    String OID = "1.2.840.113556.1.4.1413";
+}

Added: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModifyImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModifyImpl.java?rev=1735231&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModifyImpl.java
(added)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/PermissiveModifyImpl.java
Wed Mar 16 14:02:37 2016
@@ -0,0 +1,50 @@
+/*
+ * 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.extras.controls.permissiveModify;
+
+import org.apache.directory.api.ldap.model.message.controls.AbstractControl;
+
+
+/**
+ * The Permissive Modify control implementation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class PermissiveModifyImpl extends AbstractControl implements PermissiveModify
+{
+    /**
+     * Default constructor
+     */
+    public PermissiveModifyImpl()
+    {
+        super( OID );
+    }
+
+
+    /**
+     * Sets criticality when creating.
+     * 
+     * @param isCritical true if critical, false otherwise.
+     */
+    public PermissiveModifyImpl( boolean isCritical )
+    {
+        super( OID );
+        setCritical( isCritical );
+    }
+}
\ No newline at end of file

Added: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyDecorator.java?rev=1735231&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyDecorator.java
(added)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyDecorator.java
Wed Mar 16 14:02:37 2016
@@ -0,0 +1,77 @@
+/*
+ *  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.extras.controls.permissiveModify_impl;
+
+
+import java.nio.ByteBuffer;
+
+import org.apache.directory.api.asn1.Asn1Object;
+import org.apache.directory.api.asn1.DecoderException;
+import org.apache.directory.api.asn1.EncoderException;
+import org.apache.directory.api.ldap.codec.api.CodecControl;
+import org.apache.directory.api.ldap.codec.api.ControlDecorator;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.extras.controls.permissiveModify.PermissiveModify;
+
+
+/**
+ * The Permissive Modify control decorator.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class PermissiveModifyDecorator extends ControlDecorator<PermissiveModify> implements
CodecControl<PermissiveModify>, PermissiveModify
+{
+    /**
+     * Default constructor
+     */
+    public PermissiveModifyDecorator( LdapApiService codec, PermissiveModify control )
+    {
+        super( codec, control );
+    }
+
+
+    /**
+     * Returns the default control length.
+     */
+    public int computeLength()
+    {
+        return 0;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Asn1Object decode( byte[] controlBytes ) throws DecoderException
+    {
+        return this;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    {
+        return buffer;
+    }
+}

Added: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyFactory.java?rev=1735231&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyFactory.java
(added)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/PermissiveModifyFactory.java
Wed Mar 16 14:02:37 2016
@@ -0,0 +1,78 @@
+/*
+ *   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.extras.controls.permissiveModify_impl;
+
+
+import org.apache.directory.api.ldap.codec.api.CodecControl;
+import org.apache.directory.api.ldap.codec.api.ControlFactory;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.extras.controls.permissiveModify.PermissiveModify;
+import org.apache.directory.api.ldap.extras.controls.permissiveModify.PermissiveModifyImpl;
+
+
+/**
+ * A codec {@link ControlFactory} implementation for {@link PermissiveModify} controls.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class PermissiveModifyFactory implements ControlFactory<PermissiveModify>
+{
+    /** The LDAP codec responsible for encoding and decoding PermissiveModify Controls */
+    private LdapApiService codec;
+
+
+    /**
+     * Creates a new instance of PermissiveModifyFactory.
+     *
+     * @param codec The LDAP codec
+     */
+    public PermissiveModifyFactory( LdapApiService codec )
+    {
+        this.codec = codec;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getOid()
+    {
+        return PermissiveModify.OID;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public CodecControl<PermissiveModify> newCodecControl()
+    {
+        return new PermissiveModifyDecorator( codec, new PermissiveModifyImpl() );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public CodecControl<PermissiveModify> newCodecControl( PermissiveModify control
)
+    {
+        return new PermissiveModifyDecorator( codec, control );
+    }
+}



Mime
View raw message