> On Jun 23, 2021, at 11:30 PM, Emmanuel Lécharny <[email protected]> wrote:
>
> On 24/06/2021 06:25, Stefan Seelmann wrote:
>> On 6/24/21 4:10 AM, Shawn McKinney wrote:
>>> The debugger tells me that api request controls are loaded in
>>> [StockCodecFactoryUtil](https://github.com/apache/directory-ldap-api/blob/master/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/StockCodecFactoryUtil.java)
>>>
>>> So, I added my RelaxControl into the api code space, and added this blurb
>>> to StockCodecFactoryUtil class:
>>>
>>> ```
>>> ControlFactory<RelaxControl> relaxControlFactory = new RelaxControlFactory(
>>> apiService );
>>> requestControlFactories.put( relaxControlFactory.getOid(),
>>> relaxControlFactory );
>>> ```
>>>
>>> Once registered the control is found by the runtime and things become …
>>> well Relaxed ;-)
>> I'm not sure if the control should be placed into api-ldap-codec-core or
>> better api-ldap-extras-codec (there's a ExtrasCodecFactoryUtil to
>> register controls) which contains, well, non-core control. Feel free to
>> commit it, then we can include it in the next release.
>
> Definitively in extra-codec.
>
OK, moving into these packages:
1.
directory-ldap-api/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/relax_impl:
RelaxControlFactory.java
2.
directory-ldap-api/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls:
RelaxControl.java
RelaxControlImpl.java
3. Registering control here:
ExtrasCodecFactoryUtil.java
>
>> The other option, if you don't want to add it to the LDAP API, is to
>> register it in Fortress. You can get a handle to the registries via
>> LdapNetworkConnection.getCodecService().registerRequestControl().
>
> Indeed. But I think it better fits the extra-codec part of the API, as it's
> not related to Fortress (it's a LDAP draft).
>
Will do, but have two problems to work out:
1. Checkstyle plugin flags the RelaxControl interface and fails compilation:
[INFO] --- maven-checkstyle-plugin:3.1.2:check (validate) @
api-ldap-extras-codec-api ---
[INFO] There is 1 error reported by Checkstyle 8.42 with directory-checks.xml
ruleset.
[ERROR]
src/main/java/org/apache/directory/api/ldap/extras/controls/relax/RelaxControl.java:[35,1]
(design) InterfaceIsType: interfaces should describe a type and hence have
methods.
FWICT, other controls do it the same way. That is, no public methods, only a
constant.
How do I get past this?
2. Need a way for this control to work in fortress before the next api release.
So, maybe I have it in both places for now? Still thinking about this one.
—
Shawn
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]