You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by GitBox <gi...@apache.org> on 2018/03/18 17:05:47 UTC

[GitHub] elecharny closed pull request #1: Adding PolicyHints classes to enable passwordpolicy validation when s���

elecharny closed pull request #1: Adding PolicyHints classes to enable passwordpolicy validation when s…
URL: https://github.com/apache/directory-ldap-api/pull/1
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ad/policyHints/LdapServerPolicyHintsOid.java b/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ad/policyHints/LdapServerPolicyHintsOid.java
new file mode 100644
index 000000000..e806b4311
--- /dev/null
+++ b/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ad/policyHints/LdapServerPolicyHintsOid.java
@@ -0,0 +1,36 @@
+/*
+ *  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.ad.policyHints;
+
+
+import org.apache.directory.api.ldap.model.message.Control;
+
+
+public interface LdapServerPolicyHintsOid extends Control
+{
+    /** This control OID */
+    String OID = "1.2.840.113556.1.4.2239";
+
+
+    int getFlags();
+
+
+    void setFlags( int flags );
+}
\ No newline at end of file
diff --git a/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ad/policyHints/LdapServerPolicyHintsOidImpl.java b/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ad/policyHints/LdapServerPolicyHintsOidImpl.java
new file mode 100644
index 000000000..0cd06f252
--- /dev/null
+++ b/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ad/policyHints/LdapServerPolicyHintsOidImpl.java
@@ -0,0 +1,48 @@
+/*
+ *  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.ad.policyHints;
+
+
+import org.apache.directory.api.ldap.model.message.controls.AbstractControl;
+
+
+public class LdapServerPolicyHintsOidImpl extends AbstractControl implements LdapServerPolicyHintsOid
+{
+    /** This control OID */
+    private int flags;
+
+
+    public LdapServerPolicyHintsOidImpl()
+    {
+        super( OID );
+    }
+
+
+    public int getFlags()
+    {
+        return flags;
+    }
+
+
+    public void setFlags( int flags )
+    {
+        this.flags = flags;
+    }
+}
\ No newline at end of file
diff --git a/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidContainer.java b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidContainer.java
new file mode 100644
index 000000000..c92f4fa8d
--- /dev/null
+++ b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidContainer.java
@@ -0,0 +1,117 @@
+/*
+ *  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.policyHints_impl;
+
+
+import org.apache.directory.api.asn1.ber.AbstractContainer;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.extras.controls.ad.policyHints.LdapServerPolicyHintsOid;
+
+
+/**
+ * A container for the LdapServerPolicyHintsOid request control.
+ */
+public class LdapServerPolicyHintsOidContainer extends AbstractContainer
+{
+    private LdapServerPolicyHintsOidDecorator control;
+
+    private LdapApiService codec;
+
+
+    /**
+     * Creates a new LdapServerPolicyHintsOidContainer instance
+     *
+     * @param codec
+     *            The LDAP Service to use
+     */
+    public LdapServerPolicyHintsOidContainer( LdapApiService codec )
+    {
+        super();
+        this.codec = codec;
+        setGrammar( LdapServerPolicyHintsOidGrammar.getInstance() );
+        setTransition( LdapServerPolicyHintsOidStates.START_STATE );
+    }
+
+
+    /**
+     * Creates a new VirtualListViewRequestContainer instance
+     *
+     * @param control
+     *            The VLV control
+     * @param codec
+     *            The LDAP Service to use
+     */
+    public LdapServerPolicyHintsOidContainer( LdapServerPolicyHintsOidDecorator control, LdapApiService codec )
+    {
+        this( codec );
+        decorate( control );
+    }
+
+
+    /**
+     * @return The LdapServerPolicyHintsOid control
+     */
+    public LdapServerPolicyHintsOidDecorator getDecorator()
+    {
+        return control;
+    }
+
+
+    /**
+     * Decorate the LdapServerPolicyHintsOid control
+     *
+     * @param control
+     *            The control to decorate
+     */
+    public void decorate( LdapServerPolicyHintsOid control )
+    {
+        if ( control instanceof LdapServerPolicyHintsOidDecorator )
+        {
+            this.control = ( LdapServerPolicyHintsOidDecorator ) control;
+        }
+        else
+        {
+            this.control = new LdapServerPolicyHintsOidDecorator( codec, control );
+        }
+    }
+
+
+    /**
+     * Sets the LdapServerPolicyHintsOid control
+     *
+     * @param control
+     *            The LdapServerPolicyHintsOid control
+     */
+    public void setLdapServerPolicyHintsOidRequestControl( LdapServerPolicyHintsOidDecorator control )
+    {
+        this.control = control;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void clean()
+    {
+        super.clean();
+        control = null;
+    }
+}
\ No newline at end of file
diff --git a/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidDecorator.java b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidDecorator.java
new file mode 100644
index 000000000..a7864f8f1
--- /dev/null
+++ b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidDecorator.java
@@ -0,0 +1,164 @@
+/*
+ *  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.policyHints_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.asn1.ber.Asn1Decoder;
+import org.apache.directory.api.asn1.ber.tlv.BerValue;
+import org.apache.directory.api.asn1.ber.tlv.TLV;
+import org.apache.directory.api.asn1.ber.tlv.UniversalTag;
+import org.apache.directory.api.i18n.I18n;
+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.ad.policyHints.LdapServerPolicyHintsOid;
+import org.apache.directory.api.ldap.extras.controls.ad.policyHints.LdapServerPolicyHintsOidImpl;
+
+
+public class LdapServerPolicyHintsOidDecorator extends ControlDecorator<LdapServerPolicyHintsOid>
+    implements LdapServerPolicyHintsOid
+{
+    private int seqLength;
+
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
+
+
+    /**
+     * Creates a new instance of LdapServerPolicyHintsOidDecorator.
+     *
+     * @param codec
+     *            The LDAP Service to use
+     */
+    public LdapServerPolicyHintsOidDecorator( LdapApiService codec )
+    {
+        this( codec, new LdapServerPolicyHintsOidImpl() );
+    }
+
+
+    /**
+     * Creates a new instance of LdapServerPolicyHintsOidDecorator.
+     *
+     * @param codec
+     *            The LDAP Service to use
+     * @param vlvRequest
+     *            The VLV request to use
+     */
+    public LdapServerPolicyHintsOidDecorator( LdapApiService codec, LdapServerPolicyHintsOid vlvRequest )
+    {
+        super( codec, vlvRequest );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int computeLength()
+    {
+        seqLength = 1 + 1 + BerValue.getNbBytes( getFlags() );
+
+        valueLength = 1 + TLV.getNbBytes( seqLength ) + seqLength;
+
+        return valueLength;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    {
+        if ( buffer == null )
+        {
+            throw new EncoderException( I18n.err( I18n.ERR_04023 ) );
+        }
+
+        buffer.put( UniversalTag.SEQUENCE.getValue() );
+        buffer.put( TLV.getBytes( seqLength ) );
+
+        BerValue.encode( buffer, getFlags() );
+
+        return buffer;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public byte[] getValue()
+    {
+        if ( value == null )
+        {
+            try
+            {
+                computeLength();
+                ByteBuffer buffer = ByteBuffer.allocate( valueLength );
+
+                value = encode( buffer ).array();
+            }
+            catch ( Exception e )
+            {
+                return null;
+            }
+        }
+
+        return value;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Asn1Object decode( byte[] controlBytes ) throws DecoderException
+    {
+        ByteBuffer buffer = ByteBuffer.wrap( controlBytes );
+        LdapServerPolicyHintsOidContainer container = new LdapServerPolicyHintsOidContainer( this, getCodecService() );
+        DECODER.decode( buffer, container );
+
+        return this;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int getFlags()
+    {
+        return getDecorated().getFlags();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setFlags( int flags )
+    {
+        getDecorated().setFlags( flags );
+    }
+}
\ No newline at end of file
diff --git a/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidFactory.java b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidFactory.java
new file mode 100644
index 000000000..c513c18d8
--- /dev/null
+++ b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidFactory.java
@@ -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.policyHints_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.ad.policyHints.LdapServerPolicyHintsOid;
+
+
+/**
+ * A {@link ControlFactory} for {@link LdapServerPolicyHintsOid} controls.
+ *
+ */
+public class LdapServerPolicyHintsOidFactory implements ControlFactory<LdapServerPolicyHintsOid>
+{
+    private LdapApiService codec;
+
+
+    /**
+     * Creates a new instance of LdapServerPolicyHintsOidFactory.
+     *
+     * @param codec
+     *            The codec for this factory.
+     */
+    public LdapServerPolicyHintsOidFactory( LdapApiService codec )
+    {
+        this.codec = codec;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getOid()
+    {
+        return LdapServerPolicyHintsOid.OID;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public CodecControl<LdapServerPolicyHintsOid> newCodecControl()
+    {
+        return new LdapServerPolicyHintsOidDecorator( codec );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public CodecControl<LdapServerPolicyHintsOid> newCodecControl( LdapServerPolicyHintsOid control )
+    {
+        return new LdapServerPolicyHintsOidDecorator( codec, control );
+    }
+}
diff --git a/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidGrammar.java b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidGrammar.java
new file mode 100644
index 000000000..25159c462
--- /dev/null
+++ b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidGrammar.java
@@ -0,0 +1,71 @@
+/*
+ *  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.policyHints_impl;
+
+
+import org.apache.directory.api.asn1.ber.grammar.AbstractGrammar;
+import org.apache.directory.api.asn1.ber.grammar.Grammar;
+import org.apache.directory.api.asn1.ber.grammar.GrammarTransition;
+import org.apache.directory.api.asn1.ber.tlv.UniversalTag;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The LdapServerPolicyHintsOid grammar
+ *
+ */
+public final class LdapServerPolicyHintsOidGrammar extends AbstractGrammar<LdapServerPolicyHintsOidContainer>
+{
+    static final Logger LOG = LoggerFactory.getLogger( LdapServerPolicyHintsOidGrammar.class );
+
+    static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+    private static Grammar<?> instance = new LdapServerPolicyHintsOidGrammar();
+
+
+    @SuppressWarnings("unchecked")
+    private LdapServerPolicyHintsOidGrammar()
+    {
+        setName( LdapServerPolicyHintsOidGrammar.class.getName() );
+
+        super.transitions = new GrammarTransition[LdapServerPolicyHintsOidStates.END_STATE.ordinal()][256];
+
+        super.transitions[LdapServerPolicyHintsOidStates.START_STATE.ordinal()][UniversalTag.SEQUENCE
+            .getValue()] = new GrammarTransition<LdapServerPolicyHintsOidContainer>(
+                LdapServerPolicyHintsOidStates.START_STATE, LdapServerPolicyHintsOidStates.LSPHO_SEQUENCE_STATE,
+                UniversalTag.SEQUENCE.getValue(), null );
+
+        super.transitions[LdapServerPolicyHintsOidStates.LSPHO_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER
+            .getValue()] = new GrammarTransition<LdapServerPolicyHintsOidContainer>(
+                LdapServerPolicyHintsOidStates.LSPHO_SEQUENCE_STATE,
+                LdapServerPolicyHintsOidStates.LSPHO_FLAGS_STATE, UniversalTag.INTEGER.getValue(),
+                new StoreFlags() );
+    }
+
+
+    /**
+     * @return the singleton instance of the LdapServerPolicyHintsOidGrammar
+     */
+    public static Grammar<?> getInstance()
+    {
+        return instance;
+    }
+}
\ No newline at end of file
diff --git a/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidStates.java b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidStates.java
new file mode 100644
index 000000000..1352389ee
--- /dev/null
+++ b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/LdapServerPolicyHintsOidStates.java
@@ -0,0 +1,87 @@
+/*
+ *  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.policyHints_impl;
+
+
+import org.apache.directory.api.asn1.ber.grammar.States;
+
+
+/**
+ * This class store the LdapServerPolicyHintsOid grammar constants. It is also
+ * used for debugging purposes.
+ *
+ */
+public enum LdapServerPolicyHintsOidStates implements States
+{
+    /** Initial state */
+    START_STATE,
+
+    /** LdapServerPolicyRequestValue ::= SEQUENCE transition */
+    LSPHO_SEQUENCE_STATE,
+
+    /** flags INTEGER transition */
+    LSPHO_FLAGS_STATE,
+
+    /** Final state */
+    END_STATE;
+
+    /**
+     * Get the grammar name
+     *
+     * @return The grammar name
+     */
+    public String getGrammarName()
+    {
+        return "LSPHO_GRAMMAR";
+    }
+
+
+    /**
+     * Get the string representing the state
+     *
+     * @param state
+     *            The state number
+     * @return The String representing the state
+     */
+    public String getState( int state )
+    {
+        return ( state == END_STATE.ordinal() ) ? "LSPHO_END_STATE" : name();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isEndState()
+    {
+        return this == END_STATE;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Enum<?> getStartState()
+    {
+        return START_STATE;
+    }
+}
\ No newline at end of file
diff --git a/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/StoreFlags.java b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/StoreFlags.java
new file mode 100644
index 000000000..90beb777e
--- /dev/null
+++ b/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/policyHints_impl/StoreFlags.java
@@ -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.policyHints_impl;
+
+
+import org.apache.directory.api.asn1.actions.AbstractReadInteger;
+
+
+/**
+ * The action used to store the Flags value
+ *
+ */
+public class StoreFlags extends AbstractReadInteger<LdapServerPolicyHintsOidContainer>
+{
+
+    /**
+     * Instantiates a new Flags action.
+     */
+    public StoreFlags()
+    {
+        super( "LdapServerPolicyHintsOid Flags" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void setIntegerValue( int value, LdapServerPolicyHintsOidContainer lsphoContainer )
+    {
+        lsphoContainer.getDecorator().setFlags( value );
+    }
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services