You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2016/03/24 09:51:39 UTC
svn commit: r1736405 - in /directory/shared/trunk/ldap:
codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/
extras/codec-api/ extras/codec-api/src/checkstyle/
extras/codec-api/src/main/java/org/apache/directory/api/ldap/extra...
Author: elecharny
Date: Thu Mar 24 08:51:38 2016
New Revision: 1736405
URL: http://svn.apache.org/viewvc?rev=1736405&view=rev
Log: (empty)
Added:
directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/
directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotifications.java
directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotificationsImpl.java
directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/
directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsDecorator.java
directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsFactory.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/pom.xml
directory/shared/trunk/ldap/extras/codec-api/src/checkstyle/suppressions.xml
directory/shared/trunk/ldap/extras/codec/pom.xml
directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java
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=1736405&r1=1736404&r2=1736405&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 Thu Mar 24 08:51:38 2016
@@ -40,6 +40,8 @@ import org.apache.directory.api.ldap.ext
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.changeNotifications.ChangeNotifications;
+import org.apache.directory.api.ldap.extras.controls.changeNotifications_impl.ChangeNotificationsFactory;
import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy;
import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory;
import org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone.SyncDoneValue;
@@ -172,6 +174,10 @@ public final class CodecFactoryUtil
ControlFactory<PermissiveModify> permissiveModifyFactory = new PermissiveModifyFactory( apiService );
controlFactories.put( permissiveModifyFactory.getOid(), permissiveModifyFactory );
LOG.info( "Registered pre-bundled control factory: {}", permissiveModifyFactory.getOid() );
+
+ ControlFactory<ChangeNotifications> changeNotificationsFactory = new ChangeNotificationsFactory( apiService );
+ controlFactories.put( changeNotificationsFactory.getOid(), changeNotificationsFactory );
+ LOG.info( "Registered pre-bundled control factory: {}", changeNotificationsFactory.getOid() );
}
Modified: directory/shared/trunk/ldap/extras/codec-api/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/pom.xml?rev=1736405&r1=1736404&r2=1736405&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/pom.xml (original)
+++ directory/shared/trunk/ldap/extras/codec-api/pom.xml Thu Mar 24 08:51:38 2016
@@ -66,6 +66,7 @@
<Export-Package>
org.apache.directory.api.ldap.extras.controls;version=${project.version};-noimport:=true,
org.apache.directory.api.ldap.extras.controls.ad;version=${project.version};-noimport:=true,
+ org.apache.directory.api.ldap.extras.controls.changeNotifications_impl;version=${project.version},
org.apache.directory.api.ldap.extras.controls.permissiveModify;version=${project.version};-noimport:=true,
org.apache.directory.api.ldap.extras.controls.ppolicy;version=${project.version};-noimport:=true,
org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone;version=${project.version};-noimport:=true,
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=1736405&r1=1736404&r2=1736405&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 Thu Mar 24 08:51:38 2016
@@ -24,8 +24,9 @@
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
- <!-- Contol inferfaces that don't declare any new method -->
+ <!-- Control 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" />
+ <suppress files="org.apache.directory.api.ldap.extras.controls.changeNotifications" checks="InterfaceIsType" />
</suppressions>
Added: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotifications.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotifications.java?rev=1736405&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotifications.java (added)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotifications.java Thu Mar 24 08:51:38 2016
@@ -0,0 +1,34 @@
+/*
+ * 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.changeNotifications;
+
+
+import org.apache.directory.api.ldap.model.message.Control;
+
+
+/**
+ * The Active Directory ChangeNotifications control. This is the equivalent of the PersistentSearch control
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface ChangeNotifications extends Control
+{
+ /** The Deleted control OID */
+ String OID = "1.2.840.113556.1.4.528";
+}
Added: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotificationsImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotificationsImpl.java?rev=1736405&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotificationsImpl.java (added)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/ChangeNotificationsImpl.java Thu Mar 24 08:51:38 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.changeNotifications;
+
+import org.apache.directory.api.ldap.model.message.controls.AbstractControl;
+
+/**
+ * Simple Microsoft AD ChangeNotifications implementation class.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ChangeNotificationsImpl extends AbstractControl implements ChangeNotifications
+{
+ /**
+ * Default constructor.
+ */
+ public ChangeNotificationsImpl()
+ {
+ super( OID );
+ }
+
+
+ /**
+ * Creates instance and sets criticality at same time.
+ *
+ * @param isCritical true if critical, false otherwise
+ */
+ public ChangeNotificationsImpl( boolean isCritical )
+ {
+ super( OID );
+ setCritical( isCritical );
+ }
+}
\ No newline at end of file
Modified: directory/shared/trunk/ldap/extras/codec/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/pom.xml?rev=1736405&r1=1736404&r2=1736405&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/pom.xml (original)
+++ directory/shared/trunk/ldap/extras/codec/pom.xml Thu Mar 24 08:51:38 2016
@@ -106,6 +106,7 @@
</Export-Package>
<Export-Package>
org.apache.directory.api.ldap.extras.controls.ad_impl;version=${project.version};-noimport:=true,
+ org.apache.directory.api.ldap.extras.controls.changeNotifications_impl;version=${project.version};-noimport:=true,
org.apache.directory.api.ldap.extras.controls.permissiveModify_impl;version=${project.version};-noimport:=true,
org.apache.directory.api.ldap.extras.controls.ppolicy_impl;version=${project.version};-noimport:=true,
org.apache.directory.api.ldap.extras.controls.syncrepl_impl;version=${project.version};-noimport:=true,
@@ -130,6 +131,7 @@
org.apache.directory.api.ldap.codec.osgi;version=${project.version},
org.apache.directory.api.ldap.extras.controls;version=${project.version},
org.apache.directory.api.ldap.extras.controls.ad;version=${project.version},
+ org.apache.directory.api.ldap.extras.controls.changeNotifications;version=${project.version},
org.apache.directory.api.ldap.extras.controls.permissiveModify;version=${project.version},
org.apache.directory.api.ldap.extras.controls.ppolicy;version=${project.version},
org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone;version=${project.version},
Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java?rev=1736405&r1=1736404&r2=1736405&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java (original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java Thu Mar 24 08:51:38 2016
@@ -26,6 +26,10 @@ import org.apache.directory.api.ldap.ext
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.ad_impl.AdDirSyncFactory;
+import org.apache.directory.api.ldap.extras.controls.changeNotifications.ChangeNotifications;
+import org.apache.directory.api.ldap.extras.controls.changeNotifications_impl.ChangeNotificationsFactory;
+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.ppolicy.PasswordPolicy;
import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory;
import org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone.SyncDoneValue;
@@ -131,6 +135,21 @@ public class ExtrasBundleActivator imple
*/
private void registerExtrasControls( LdapApiService codec )
{
+ ControlFactory<AdDirSync> adDirSyncFactory = new AdDirSyncFactory( codec );
+ codec.registerControl( adDirSyncFactory );
+
+ ControlFactory<AdShowDeleted> adDeletedFactory = new AdShowDeletedFactory( codec );
+ codec.registerControl( adDeletedFactory );
+
+ ControlFactory<ChangeNotifications> changeNotificationsFactory = new ChangeNotificationsFactory( codec );
+ codec.registerControl( changeNotificationsFactory );
+
+ ControlFactory<PasswordPolicy> passwordPolicyFactory = new PasswordPolicyFactory( codec );
+ codec.registerControl( passwordPolicyFactory );
+
+ ControlFactory<PermissiveModify> permissiveModifyFactory = new PermissiveModifyFactory( codec );
+ codec.registerControl( permissiveModifyFactory );
+
ControlFactory<SyncDoneValue> syncDoneValuefactory = new SyncDoneValueFactory( codec );
codec.registerControl( syncDoneValuefactory );
@@ -143,9 +162,6 @@ public class ExtrasBundleActivator imple
ControlFactory<SyncStateValue> syncStateValuefactory = new SyncStateValueFactory( codec );
codec.registerControl( syncStateValuefactory );
- ControlFactory<PasswordPolicy> passwordPolicyFactory = new PasswordPolicyFactory( codec );
- codec.registerControl( passwordPolicyFactory );
-
ControlFactory<VirtualListViewRequest> virtualListViewRequestFactory = new VirtualListViewRequestFactory( codec );
codec.registerControl( virtualListViewRequestFactory );
@@ -153,11 +169,7 @@ public class ExtrasBundleActivator imple
codec );
codec.registerControl( virtualListViewResponseFactory );
- ControlFactory<AdDirSync> adDirSyncFactory = new AdDirSyncFactory( codec );
- codec.registerControl( adDirSyncFactory );
- ControlFactory<AdShowDeleted> adDeletedFactory = new AdShowDeletedFactory( codec );
- codec.registerControl( adDeletedFactory );
}
Added: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsDecorator.java?rev=1736405&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsDecorator.java (added)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsDecorator.java Thu Mar 24 08:51:38 2016
@@ -0,0 +1,76 @@
+/*
+ * 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.changeNotifications_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.ControlDecorator;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.extras.controls.changeNotifications.ChangeNotifications;
+
+
+/**
+ * A decorating wrapper for a ChangeNotifications Control.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ChangeNotificationsDecorator extends ControlDecorator<ChangeNotifications> implements ChangeNotifications
+{
+
+ /**
+ * Default constructor
+ */
+ public ChangeNotificationsDecorator( LdapApiService codec, ChangeNotifications control )
+ {
+ super( codec, control );
+ }
+
+
+ /**
+ * Returns 0 every time.
+ */
+ public int computeLength()
+ {
+ return 0;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ 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/changeNotifications_impl/ChangeNotificationsFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsFactory.java?rev=1736405&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsFactory.java (added)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/ChangeNotificationsFactory.java Thu Mar 24 08:51:38 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.changeNotifications_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.changeNotifications.ChangeNotifications;
+import org.apache.directory.api.ldap.extras.controls.changeNotifications.ChangeNotificationsImpl;
+
+
+/**
+ * A codec {@link ControlFactory} implementation for {@link ChangeNotifications} control.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ChangeNotificationsFactory implements ControlFactory<ChangeNotifications>
+{
+ /** The LDAP codec responsible for encoding and decoding Controls */
+ private LdapApiService codec;
+
+
+ /**
+ * Creates a new instance of ChangeNotificationsFactory.
+ *
+ * @param codec The LDAP codec
+ */
+ public ChangeNotificationsFactory( LdapApiService codec )
+ {
+ this.codec = codec;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getOid()
+ {
+ return ChangeNotifications.OID;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public CodecControl<ChangeNotifications> newCodecControl()
+ {
+ return new ChangeNotificationsDecorator( codec, new ChangeNotificationsImpl() );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public CodecControl<ChangeNotifications> newCodecControl( ChangeNotifications control )
+ {
+ return new ChangeNotificationsDecorator( codec, control );
+ }
+}