Skip to content
Permalink
Browse files
o Split the AdDirSync control into two classes: one for the request,
another for the response
o Separated the controls in two categories: request/response. Some
controls have a common OID for both type, which makes it difficult to
know which part to use when encoding or decoding them.
  • Loading branch information
elecharny committed Dec 1, 2018
1 parent 02735e3 commit 4e2f6115e6106252bfc8029f1511a695aa16c2e0
Show file tree
Hide file tree
Showing 41 changed files with 2,430 additions and 1,397 deletions.
@@ -6,16 +6,16 @@
* 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.
*
* under the License.
*
*/

package org.apache.directory.api.dsmlv2.request;
@@ -80,7 +80,7 @@
public final class Dsmlv2Grammar extends AbstractGrammar implements Grammar
{
private LdapApiService codec = LdapApiServiceFactory.getSingleton();

/** Some literal */
private static final String BATCH_REQUEST = "batchRequest";
private static final String ABANDON_REQUEST = "abandonRequest";
@@ -222,7 +222,7 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException
String attributeValue;
// requestID
attributeValue = xpp.getAttributeValue( "", REQUEST_ID );

if ( attributeValue != null )
{
abandonRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -234,10 +234,10 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException
throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
}
}

// abandonID
attributeValue = xpp.getAttributeValue( "", "abandonID" );

if ( attributeValue != null )
{
try
@@ -276,7 +276,7 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException
String attributeValue;
// requestID
attributeValue = xpp.getAttributeValue( "", REQUEST_ID );

if ( attributeValue != null )
{
addRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -288,10 +288,10 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException
throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
}
}

// dn
attributeValue = xpp.getAttributeValue( "", "dn" );

if ( attributeValue != null )
{
try
@@ -372,7 +372,7 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException

// Getting the value
String nextText = xpp.nextText();

if ( !Strings.isEmpty( nextText ) )
{
try
@@ -1850,17 +1850,17 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException
try
{
ExprNode exprNode = searchRequestDecorator.getFilterNode();

if ( exprNode == null )
{
throw new IllegalStateException( I18n.err( I18n.ERR_03041_NO_FILTER_ELEMENT ) );
}

searchRequest.setFilter( exprNode );
}
catch ( LdapSchemaException lse )
{

}
}
};
@@ -1962,7 +1962,7 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException

// Getting the value
String nextText = xpp.nextText();

if ( !Strings.isEmpty( nextText ) )
{
if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
@@ -2008,7 +2008,7 @@ public void action( Dsmlv2Container container ) throws XmlPullParserException
throw new XmlPullParserException( I18n.err( I18n.ERR_03034_INCORRECT_TYPE_VALUE ), xpp, null );
}

control = codec.newControl( codec.newControl( attributeValue ) );
control = codec.newControl( codec.newRequestControl( attributeValue ) );
( ( Request ) container.getBatchRequest().getCurrentRequest() ).addControl( control );
}
else

0 comments on commit 4e2f611

Please sign in to comment.