You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/06/07 08:28:15 UTC
svn commit: r664290 [4/13] - in /directory/shared/branches/bigbang: ./
asn1/src/main/java/org/apache/directory/shared/asn1/
asn1/src/main/java/org/apache/directory/shared/asn1/ber/
asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/ asn1/s...
Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Fri Jun 6 23:28:06 2008
@@ -115,6 +115,7 @@
* an action is to be added or modified, this is where the work is to be done !
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$,
*/
public class LdapMessageGrammar extends AbstractGrammar
{
@@ -126,7 +127,7 @@
/** A speedup for logger */
static final boolean IS_DEBUG = log.isDebugEnabled();
-
+
/** The instance of grammar. LdapMessageGrammar is a singleton */
private static IGrammar instance = new LdapMessageGrammar();
@@ -157,9 +158,9 @@
// The next state will be LDAP_MESSAGE_STATE
//
// We will just check that the length is not null
- super.transitions[LdapStatesEnum.START_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.START_STATE, LdapStatesEnum.LDAP_MESSAGE_STATE, UniversalTag.SEQUENCE_TAG,
- new GrammarAction( "LdapMessage initialization" )
+ super.transitions[LdapStatesEnum.START_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.START_STATE, LdapStatesEnum.LDAP_MESSAGE_STATE, UniversalTag.SEQUENCE_TAG,
+ new GrammarAction( "LdapMessage initialization" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -200,9 +201,9 @@
//
// The message ID will be temporarely stored in the container, because we can't store it
// into an object.
- super.transitions[LdapStatesEnum.LDAP_MESSAGE_STATE][UniversalTag.INTEGER_TAG] =
- new GrammarTransition(LdapStatesEnum.LDAP_MESSAGE_STATE, LdapStatesEnum.MESSAGE_ID_STATE, UniversalTag.INTEGER_TAG,
- new GrammarAction( "Store MessageId" )
+ super.transitions[LdapStatesEnum.LDAP_MESSAGE_STATE][UniversalTag.INTEGER_TAG] = new GrammarTransition(
+ LdapStatesEnum.LDAP_MESSAGE_STATE, LdapStatesEnum.MESSAGE_ID_STATE, UniversalTag.INTEGER_TAG,
+ new GrammarAction( "Store MessageId" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -218,7 +219,7 @@
if ( tlv.getLength() == 0 )
{
log.error( "The messageId has a zero length. This is not allowed" );
-
+
// This will generate a PROTOCOL_ERROR
throw new DecoderException( "The messageId should not be null" );
}
@@ -282,9 +283,9 @@
// LdapMessage ::= ... UnBindRequest ...
// unbindRequest ::= [APPLICATION 2] NULL
// We have to switch to the UnBindRequest grammar
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.UNBIND_REQUEST_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.UNBIND_REQUEST_STATE, LdapConstants.UNBIND_REQUEST_TAG,
- new GrammarAction( "Unbind Request initialization" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.UNBIND_REQUEST_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.UNBIND_REQUEST_STATE, LdapConstants.UNBIND_REQUEST_TAG,
+ new GrammarAction( "Unbind Request initialization" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -298,15 +299,15 @@
// The Length should be null
if ( expectedLength != 0 )
{
- log.error( "The length of a UnBindRequest must be null, the actual value is {}",
- Integer.valueOf( expectedLength ) );
-
+ log.error( "The length of a UnBindRequest must be null, the actual value is {}", Integer
+ .valueOf( expectedLength ) );
+
// This will generate a PROTOCOL_ERROR
throw new DecoderException( "The length of a UnBindRequest must be null" );
}
-
+
UnBindRequest unBindRequest = new UnBindRequest();
-
+
unBindRequest.setParent( ldapMessage );
// And we associate it to the ldapMessage Object
@@ -326,9 +327,9 @@
// ... },
// controls [0] Controls OPTIONAL }
//
- super.transitions[LdapStatesEnum.UNBIND_REQUEST_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.UNBIND_REQUEST_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
+ super.transitions[LdapStatesEnum.UNBIND_REQUEST_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.UNBIND_REQUEST_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
// --------------------------------------------------------------------------------------------
// Transition from Message ID to DelRequest Message.
@@ -337,9 +338,9 @@
// delRequest ::= [APPLICATION 10] LDAPDN
//
// We store the DN to bve deleted into the DelRequest object
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.DEL_REQUEST_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.DEL_REQUEST_STATE, LdapConstants.DEL_REQUEST_TAG,
- new GrammarAction( "Init del Request" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.DEL_REQUEST_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.DEL_REQUEST_STATE, LdapConstants.DEL_REQUEST_TAG,
+ new GrammarAction( "Init del Request" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -366,20 +367,20 @@
else
{
byte[] dnBytes = tlv.getValue().getData();
-
+
try
{
entry = new LdapDN( dnBytes );
}
catch ( InvalidNameException ine )
{
- String msg = "The DN to delete : " + StringTools.utf8ToString( dnBytes ) +
- " (" + StringTools.dumpBytes( dnBytes )
- + ") is invalid";
+ String msg = "The DN to delete : " + StringTools.utf8ToString( dnBytes ) + " ("
+ + StringTools.dumpBytes( dnBytes ) + ") is invalid";
log.error( "{} : {}", msg, ine.getMessage() );
-
+
DeleteResponseImpl response = new DeleteResponseImpl( ldapMessage.getMessageId() );
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX,
+ LdapDN.EMPTY_LDAPDN, ine );
}
delRequest.setEntry( entry );
@@ -405,9 +406,9 @@
// ... },
// controls [0] Controls OPTIONAL }
//
- super.transitions[LdapStatesEnum.DEL_REQUEST_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.DEL_REQUEST_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
+ super.transitions[LdapStatesEnum.DEL_REQUEST_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.DEL_REQUEST_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
// --------------------------------------------------------------------------------------------
// Transition from Message ID to AbandonRequest Message.
@@ -416,9 +417,9 @@
// AbandonRequest ::= [APPLICATION 16] MessageID
//
// Create the AbandonRequest object, and store the ID in it
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.ABANDON_REQUEST_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.ABANDON_REQUEST_STATE, LdapConstants.ABANDON_REQUEST_TAG,
- new GrammarAction( "Init Abandon Request" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.ABANDON_REQUEST_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.ABANDON_REQUEST_STATE, LdapConstants.ABANDON_REQUEST_TAG,
+ new GrammarAction( "Init Abandon Request" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -453,7 +454,9 @@
if ( IS_DEBUG )
{
- log.debug( "AbandonMessage Id has been decoded : {}", Integer.valueOf( abandonnedMessageId ) );
+ log
+ .debug( "AbandonMessage Id has been decoded : {}", Integer
+ .valueOf( abandonnedMessageId ) );
}
ldapMessageContainer.grammarEndAllowed( true );
@@ -461,8 +464,9 @@
}
catch ( IntegerDecoderException ide )
{
- log.error( "The Abandonned Message Id {} is invalid : {}. The message ID must be between (0 .. 2 147 483 647)",
- StringTools.dumpBytes( value.getData() ), ide.getMessage() );
+ log.error( "The Abandonned Message Id {} is invalid : {}."
+ + " The message ID must be between (0 .. 2 147 483 647)", StringTools.dumpBytes( value
+ .getData() ), ide.getMessage() );
// This will generate a PROTOCOL_ERROR
throw new DecoderException( ide.getMessage() );
@@ -477,10 +481,10 @@
// ... },
// controls [0] Controls OPTIONAL }
//
- super.transitions[LdapStatesEnum.ABANDON_REQUEST_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.ABANDON_REQUEST_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.ABANDON_REQUEST_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.ABANDON_REQUEST_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Message ID to BindRequest Message.
// --------------------------------------------------------------------------------------------
@@ -488,10 +492,9 @@
// BindRequest ::= [APPLICATION 0] SEQUENCE { ...
//
// We have to allocate a BindRequest
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.BIND_REQUEST_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.BIND_REQUEST_STATE, LdapConstants.BIND_REQUEST_TAG,
- new GrammarAction(
- "Init BindRequest" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.BIND_REQUEST_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.BIND_REQUEST_STATE, LdapConstants.BIND_REQUEST_TAG,
+ new GrammarAction( "Init BindRequest" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -505,7 +508,7 @@
{
String msg = "The BindRequest must not be null";
log.error( msg );
-
+
// This will generate a PROTOCOL_ERROR
throw new DecoderException( msg );
}
@@ -523,9 +526,9 @@
// ....
//
// The Ldap version is parsed and stored into the BindRequest object
- super.transitions[LdapStatesEnum.BIND_REQUEST_STATE][UniversalTag.INTEGER_TAG] =
- new GrammarTransition( LdapStatesEnum.BIND_REQUEST_STATE, LdapStatesEnum.VERSION_STATE, UniversalTag.INTEGER_TAG,
- new GrammarAction( "Store version" )
+ super.transitions[LdapStatesEnum.BIND_REQUEST_STATE][UniversalTag.INTEGER_TAG] = new GrammarTransition(
+ LdapStatesEnum.BIND_REQUEST_STATE, LdapStatesEnum.VERSION_STATE, UniversalTag.INTEGER_TAG,
+ new GrammarAction( "Store version" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -562,7 +565,7 @@
return;
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from version to name
// --------------------------------------------------------------------------------------------
@@ -572,9 +575,9 @@
// ....
//
// The Ldap version is parsed and stored into the BindRequest object
- super.transitions[LdapStatesEnum.VERSION_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.VERSION_STATE, LdapStatesEnum.NAME_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store Bind Name value" )
+ super.transitions[LdapStatesEnum.VERSION_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.VERSION_STATE, LdapStatesEnum.NAME_STATE, UniversalTag.OCTET_STRING_TAG, new GrammarAction(
+ "Store Bind Name value" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -601,14 +604,14 @@
}
catch ( InvalidNameException ine )
{
- String msg = "Incorrect DN given : " + StringTools.utf8ToString( dnBytes ) +
- " (" + StringTools.dumpBytes( dnBytes )
- + ") is invalid";
+ String msg = "Incorrect DN given : " + StringTools.utf8ToString( dnBytes ) + " ("
+ + StringTools.dumpBytes( dnBytes ) + ") is invalid";
log.error( "{} : {}", msg, ine.getMessage() );
-
+
BindResponseImpl response = new BindResponseImpl( ldapMessage.getMessageId() );
-
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX,
+ LdapDN.EMPTY_LDAPDN, ine );
}
}
@@ -620,7 +623,7 @@
return;
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from name to Simple Authentication
// --------------------------------------------------------------------------------------------
@@ -633,9 +636,9 @@
// ...
//
// We have to create an Authentication Object to store the credentials.
- super.transitions[LdapStatesEnum.NAME_STATE][LdapConstants.BIND_REQUEST_SIMPLE_TAG] =
- new GrammarTransition( LdapStatesEnum.NAME_STATE, LdapStatesEnum.SIMPLE_STATE, LdapConstants.BIND_REQUEST_SIMPLE_TAG,
- new GrammarAction( "Store Bind Simple Authentication value" )
+ super.transitions[LdapStatesEnum.NAME_STATE][LdapConstants.BIND_REQUEST_SIMPLE_TAG] = new GrammarTransition(
+ LdapStatesEnum.NAME_STATE, LdapStatesEnum.SIMPLE_STATE, LdapConstants.BIND_REQUEST_SIMPLE_TAG,
+ new GrammarAction( "Store Bind Simple Authentication value" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -680,10 +683,10 @@
// ... },
// controls [0] Controls OPTIONAL }
//
- super.transitions[LdapStatesEnum.SIMPLE_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.SIMPLE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.SIMPLE_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.SIMPLE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from name to SASL Authentication
// --------------------------------------------------------------------------------------------
@@ -697,9 +700,9 @@
// ...
//
// We have to create an Authentication Object to store the credentials.
- super.transitions[LdapStatesEnum.NAME_STATE][LdapConstants.BIND_REQUEST_SASL_TAG] =
- new GrammarTransition( LdapStatesEnum.NAME_STATE, LdapStatesEnum.SASL_STATE, LdapConstants.BIND_REQUEST_SASL_TAG,
- new GrammarAction( "Initialize Bind SASL Authentication" )
+ super.transitions[LdapStatesEnum.NAME_STATE][LdapConstants.BIND_REQUEST_SASL_TAG] = new GrammarTransition(
+ LdapStatesEnum.NAME_STATE, LdapStatesEnum.SASL_STATE, LdapConstants.BIND_REQUEST_SASL_TAG,
+ new GrammarAction( "Initialize Bind SASL Authentication" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -713,10 +716,10 @@
{
String msg = "The SaslCredential must not be null";
log.error( msg );
-
+
BindResponseImpl response = new BindResponseImpl( ldapMessage.getMessageId() );
-
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_CREDENTIALS,
+
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_CREDENTIALS,
bindRequestMessage.getName(), null );
}
@@ -727,7 +730,7 @@
bindRequestMessage.setAuthentication( authentication );
- if ( IS_DEBUG )
+ if ( IS_DEBUG )
{
log.debug( "The SaslCredential has been created" );
}
@@ -744,9 +747,9 @@
// ...
//
// We have to store the mechanism.
- super.transitions[LdapStatesEnum.SASL_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.SASL_STATE, LdapStatesEnum.MECHANISM_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store SASL mechanism" )
+ super.transitions[LdapStatesEnum.SASL_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.SASL_STATE, LdapStatesEnum.MECHANISM_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store SASL mechanism" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -780,7 +783,7 @@
return;
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from Mechanism to Credentials
// --------------------------------------------------------------------------------------------
@@ -789,21 +792,21 @@
// credentials OCTET STRING OPTIONAL }
//
// We have to store the mechanism.
- super.transitions[LdapStatesEnum.MECHANISM_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.MECHANISM_STATE, LdapStatesEnum.CREDENTIALS_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store SASL credentials" )
+ super.transitions[LdapStatesEnum.MECHANISM_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.MECHANISM_STATE, LdapStatesEnum.CREDENTIALS_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store SASL credentials" )
{
public void action( IAsn1Container container )
{
LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-
+
BindRequest bindRequestMessage = ldapMessageContainer.getLdapMessage().getBindRequest();
-
+
// Get the Value and store it in the BindRequest
TLV tlv = ldapMessageContainer.getCurrentTLV();
-
+
SaslCredentials credentials = bindRequestMessage.getSaslAuthentication();
-
+
// We have to handle the special case of a 0 length
// credentials
if ( tlv.getLength() == 0 )
@@ -814,18 +817,18 @@
{
credentials.setCredentials( tlv.getValue().getData() );
}
-
+
// We can have an END transition
ldapMessageContainer.grammarEndAllowed( true );
if ( IS_DEBUG )
{
log.debug( "The credentials are : {}", credentials.getCredentials() );
}
-
+
return;
}
} );
-
+
// --------------------------------------------------------------------------------------------
// transition from from Mechanism to Controls.
// --------------------------------------------------------------------------------------------
@@ -833,10 +836,10 @@
// ... },
// controls [0] Controls OPTIONAL }
//
- super.transitions[LdapStatesEnum.MECHANISM_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.MECHANISM_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.MECHANISM_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.MECHANISM_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// transition from credentials to Controls.
// --------------------------------------------------------------------------------------------
@@ -844,19 +847,19 @@
// ... },
// controls [0] Controls OPTIONAL }
//
- super.transitions[LdapStatesEnum.CREDENTIALS_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.CREDENTIALS_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.CREDENTIALS_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.CREDENTIALS_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from MessageId to BindResponse message
// --------------------------------------------------------------------------------------------
// LdapMessage ::= ... BindResponse ...
// BindResponse ::= [APPLICATION 1] SEQUENCE { ...
// We have to switch to the BindResponse grammar
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.BIND_RESPONSE_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.BIND_RESPONSE_STATE, LdapConstants.BIND_RESPONSE_TAG,
- new GrammarAction( "Init BindReponse" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.BIND_RESPONSE_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.BIND_RESPONSE_STATE, LdapConstants.BIND_RESPONSE_TAG,
+ new GrammarAction( "Init BindReponse" )
{
public void action( IAsn1Container container )
{
@@ -888,9 +891,9 @@
// ...
//
// Stores the result code into the Bind Response object
- super.transitions[LdapStatesEnum.BIND_RESPONSE_STATE][UniversalTag.ENUMERATED_TAG] =
- new GrammarTransition( LdapStatesEnum.BIND_RESPONSE_STATE, LdapStatesEnum.RESULT_CODE_BR_STATE, UniversalTag.ENUMERATED_TAG,
- new ResultCodeAction() );
+ super.transitions[LdapStatesEnum.BIND_RESPONSE_STATE][UniversalTag.ENUMERATED_TAG] = new GrammarTransition(
+ LdapStatesEnum.BIND_RESPONSE_STATE, LdapStatesEnum.RESULT_CODE_BR_STATE, UniversalTag.ENUMERATED_TAG,
+ new ResultCodeAction() );
// --------------------------------------------------------------------------------------------
// Transition from Result Code BR to Matched DN BR
@@ -901,9 +904,9 @@
// ...
//
// Stores the matched DN
- super.transitions[LdapStatesEnum.RESULT_CODE_BR_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.RESULT_CODE_BR_STATE, LdapStatesEnum.MATCHED_DN_BR_STATE, UniversalTag.OCTET_STRING_TAG,
- new MatchedDNAction() );
+ super.transitions[LdapStatesEnum.RESULT_CODE_BR_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.RESULT_CODE_BR_STATE, LdapStatesEnum.MATCHED_DN_BR_STATE, UniversalTag.OCTET_STRING_TAG,
+ new MatchedDNAction() );
// --------------------------------------------------------------------------------------------
// Transition from Matched DN BR to Error Message BR
@@ -914,9 +917,9 @@
// ...
//
// Stores the error message
- super.transitions[LdapStatesEnum.MATCHED_DN_BR_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.MATCHED_DN_BR_STATE, LdapStatesEnum.ERROR_MESSAGE_BR_STATE, UniversalTag.OCTET_STRING_TAG,
- new ErrorMessageAction() );
+ super.transitions[LdapStatesEnum.MATCHED_DN_BR_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.MATCHED_DN_BR_STATE, LdapStatesEnum.ERROR_MESSAGE_BR_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ErrorMessageAction() );
// --------------------------------------------------------------------------------------------
// Transition from Error Message BR to Server SASL credentials
@@ -926,9 +929,9 @@
// serverSaslCreds [7] OCTET STRING OPTIONAL }
//
// Stores the sasl credentials
- super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE][LdapConstants.SERVER_SASL_CREDENTIAL_TAG] =
- new GrammarTransition( LdapStatesEnum.ERROR_MESSAGE_BR_STATE, LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE, LdapConstants.SERVER_SASL_CREDENTIAL_TAG,
- new ServerSASLCredsAction() );
+ super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE][LdapConstants.SERVER_SASL_CREDENTIAL_TAG] = new GrammarTransition(
+ LdapStatesEnum.ERROR_MESSAGE_BR_STATE, LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE,
+ LdapConstants.SERVER_SASL_CREDENTIAL_TAG, new ServerSASLCredsAction() );
// --------------------------------------------------------------------------------------------
// Transition from Error Message BR to Referrals BR
@@ -939,9 +942,10 @@
//
// Initialiaze the referrals list
super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.ERROR_MESSAGE_BR_STATE, LdapStatesEnum.REFERRALS_BR_STATE, LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
- new InitReferralsAction() );
-
+ new GrammarTransition(
+ LdapStatesEnum.ERROR_MESSAGE_BR_STATE, LdapStatesEnum.REFERRALS_BR_STATE,
+ LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG, new InitReferralsAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Referrals BR to Referral BR
// --------------------------------------------------------------------------------------------
@@ -949,10 +953,10 @@
// URI ::= LDAPString
//
// Add a first Referral
- super.transitions[LdapStatesEnum.REFERRALS_BR_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.REFERRALS_BR_STATE, LdapStatesEnum.REFERRAL_BR_STATE, UniversalTag.OCTET_STRING_TAG,
- new ReferralAction() );
-
+ super.transitions[LdapStatesEnum.REFERRALS_BR_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.REFERRALS_BR_STATE, LdapStatesEnum.REFERRAL_BR_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ReferralAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Referral BR to Referral BR
// --------------------------------------------------------------------------------------------
@@ -960,9 +964,9 @@
// URI ::= LDAPString
//
// Adda new Referral
- super.transitions[LdapStatesEnum.REFERRAL_BR_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.REFERRAL_BR_STATE, LdapStatesEnum.REFERRAL_BR_STATE, UniversalTag.OCTET_STRING_TAG,
- new ReferralAction() );
+ super.transitions[LdapStatesEnum.REFERRAL_BR_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.REFERRAL_BR_STATE, LdapStatesEnum.REFERRAL_BR_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ReferralAction() );
// --------------------------------------------------------------------------------------------
// Transition from Referral BR to Server SASL Credentials
@@ -971,9 +975,9 @@
// URI ::= LDAPString
//
// Adda new Referral
- super.transitions[LdapStatesEnum.REFERRAL_BR_STATE][LdapConstants.SERVER_SASL_CREDENTIAL_TAG] =
- new GrammarTransition( LdapStatesEnum.REFERRAL_BR_STATE, LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE, LdapConstants.SERVER_SASL_CREDENTIAL_TAG,
- new ServerSASLCredsAction() );
+ super.transitions[LdapStatesEnum.REFERRAL_BR_STATE][LdapConstants.SERVER_SASL_CREDENTIAL_TAG] = new GrammarTransition(
+ LdapStatesEnum.REFERRAL_BR_STATE, LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE,
+ LdapConstants.SERVER_SASL_CREDENTIAL_TAG, new ServerSASLCredsAction() );
// --------------------------------------------------------------------------------------------
// Transition from Referral BR to Controls
@@ -983,9 +987,9 @@
// controls [0] Controls OPTIONAL }
//
// Adda new Referral
- super.transitions[LdapStatesEnum.REFERRAL_BR_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.REFERRAL_BR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
+ super.transitions[LdapStatesEnum.REFERRAL_BR_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.REFERRAL_BR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
// --------------------------------------------------------------------------------------------
// Transition from Error Message BR to controls
@@ -995,10 +999,10 @@
// controls [0] Controls OPTIONAL }
//
//
- super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.ERROR_MESSAGE_BR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.ERROR_MESSAGE_BR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Server SASL credentials to Controls
// --------------------------------------------------------------------------------------------
@@ -1006,9 +1010,9 @@
// ... },
// controls [0] Controls OPTIONAL }
//
- super.transitions[LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
+ super.transitions[LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
// --------------------------------------------------------------------------------------------
// Transition from Result Code to Matched DN
@@ -1019,9 +1023,9 @@
// ...
//
// Stores the matched DN
- super.transitions[LdapStatesEnum.RESULT_CODE_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.RESULT_CODE_STATE, LdapStatesEnum.MATCHED_DN_STATE, UniversalTag.OCTET_STRING_TAG,
- new MatchedDNAction() );
+ super.transitions[LdapStatesEnum.RESULT_CODE_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.RESULT_CODE_STATE, LdapStatesEnum.MATCHED_DN_STATE, UniversalTag.OCTET_STRING_TAG,
+ new MatchedDNAction() );
// --------------------------------------------------------------------------------------------
// Transition from Matched DN to Error Message
@@ -1032,9 +1036,9 @@
// ...
//
// Stores the error message
- super.transitions[LdapStatesEnum.MATCHED_DN_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.MATCHED_DN_STATE, LdapStatesEnum.ERROR_MESSAGE_STATE, UniversalTag.OCTET_STRING_TAG,
- new ErrorMessageAction() );
+ super.transitions[LdapStatesEnum.MATCHED_DN_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.MATCHED_DN_STATE, LdapStatesEnum.ERROR_MESSAGE_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ErrorMessageAction() );
// --------------------------------------------------------------------------------------------
// Transition from Error Message to Referrals
@@ -1045,9 +1049,9 @@
//
// Initialiaze the referrals list
super.transitions[LdapStatesEnum.ERROR_MESSAGE_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.ERROR_MESSAGE_STATE, LdapStatesEnum.REFERRALS_STATE, LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
- new GrammarAction(
- "Init referrals list" )
+ new GrammarTransition(
+ LdapStatesEnum.ERROR_MESSAGE_STATE, LdapStatesEnum.REFERRALS_STATE,
+ LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG, new GrammarAction( "Init referrals list" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1055,7 +1059,7 @@
LdapMessage ldapMessage = ldapMessageContainer.getLdapMessage();
LdapResponse response = ldapMessage.getLdapResponse();
LdapResult ldapResult = response.getLdapResult();
-
+
TLV tlv = ldapMessageContainer.getCurrentTLV();
// If we hae a Referrals sequence, then it should not be empty
@@ -1064,7 +1068,7 @@
{
String msg = "The Referrals must not be null";
log.error( msg );
-
+
// This will generate a PROTOCOL_ERROR
throw new DecoderException( msg );
}
@@ -1072,7 +1076,7 @@
ldapResult.initReferrals();
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from Referrals to Referral
// --------------------------------------------------------------------------------------------
@@ -1080,10 +1084,10 @@
// URI ::= LDAPString
//
// Add a first Referral
- super.transitions[LdapStatesEnum.REFERRALS_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.REFERRALS_STATE, LdapStatesEnum.REFERRAL_STATE, UniversalTag.OCTET_STRING_TAG,
- new ReferralAction() );
-
+ super.transitions[LdapStatesEnum.REFERRALS_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.REFERRALS_STATE, LdapStatesEnum.REFERRAL_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ReferralAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Referral to Referral
// --------------------------------------------------------------------------------------------
@@ -1091,9 +1095,9 @@
// URI ::= LDAPString
//
// Adda new Referral
- super.transitions[LdapStatesEnum.REFERRAL_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.REFERRAL_STATE, LdapStatesEnum.REFERRAL_STATE, UniversalTag.OCTET_STRING_TAG,
- new ReferralAction() );
+ super.transitions[LdapStatesEnum.REFERRAL_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.REFERRAL_STATE, LdapStatesEnum.REFERRAL_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ReferralAction() );
// --------------------------------------------------------------------------------------------
// Transition from Referral to Controls
@@ -1103,9 +1107,9 @@
// controls [0] Controls OPTIONAL }
//
// Adda new Referral
- super.transitions[LdapStatesEnum.REFERRAL_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.REFERRAL_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
+ super.transitions[LdapStatesEnum.REFERRAL_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.REFERRAL_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
// --------------------------------------------------------------------------------------------
// Transition from Error Message to controls
@@ -1115,10 +1119,10 @@
// controls [0] Controls OPTIONAL }
//
//
- super.transitions[LdapStatesEnum.ERROR_MESSAGE_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.ERROR_MESSAGE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.ERROR_MESSAGE_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.ERROR_MESSAGE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from MessageId to SearchResultEntry Message.
// --------------------------------------------------------------------------------------------
@@ -1126,9 +1130,9 @@
// SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
//
// Initialize the searchResultEntry object
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.SEARCH_RESULT_ENTRY_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE, LdapConstants.SEARCH_RESULT_ENTRY_TAG,
- new GrammarAction( "Init SearchResultEntry" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.SEARCH_RESULT_ENTRY_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE,
+ LdapConstants.SEARCH_RESULT_ENTRY_TAG, new GrammarAction( "Init SearchResultEntry" )
{
public void action( IAsn1Container container )
{
@@ -1150,9 +1154,9 @@
// ...
//
// Store the object name.
- super.transitions[LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE, LdapStatesEnum.OBJECT_NAME_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store search result entry object name Value" )
+ super.transitions[LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE, LdapStatesEnum.OBJECT_NAME_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store search result entry object name Value" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1181,8 +1185,8 @@
catch ( InvalidNameException ine )
{
// This is for the client side. We will never decode LdapResult on the server
- String msg = "The DN " + StringTools.dumpBytes( dnBytes )
- + "is invalid : " + ine.getMessage();
+ String msg = "The DN " + StringTools.dumpBytes( dnBytes ) + "is invalid : "
+ + ine.getMessage();
log.error( "{} : {}", msg, ine.getMessage() );
throw new DecoderException( msg, ine );
}
@@ -1196,7 +1200,7 @@
}
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from ObjectName to AttributesSR
// --------------------------------------------------------------------------------------------
@@ -1208,16 +1212,16 @@
// ...
//
// We may have no attributes. Just allows the grammar to end
- super.transitions[LdapStatesEnum.OBJECT_NAME_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.OBJECT_NAME_STATE, LdapStatesEnum.ATTRIBUTES_SR_STATE, UniversalTag.SEQUENCE_TAG,
- new GrammarAction( "Pop and end allowed" )
+ super.transitions[LdapStatesEnum.OBJECT_NAME_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.OBJECT_NAME_STATE, LdapStatesEnum.ATTRIBUTES_SR_STATE, UniversalTag.SEQUENCE_TAG,
+ new GrammarAction( "Pop and end allowed" )
{
public void action( IAsn1Container container ) throws DecoderException
{
container.grammarEndAllowed( true );
}
- } );
-
+ } );
+
// --------------------------------------------------------------------------------------------
// Transition from AttributesSR to PartialAttributesList
// --------------------------------------------------------------------------------------------
@@ -1229,9 +1233,10 @@
// ...
//
// nothing to do
- super.transitions[LdapStatesEnum.ATTRIBUTES_SR_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTES_SR_STATE, LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE, UniversalTag.SEQUENCE_TAG, null );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTES_SR_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTES_SR_STATE, LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE,
+ UniversalTag.SEQUENCE_TAG, null );
+
// --------------------------------------------------------------------------------------------
// Transition from AttributesSR to Controls
// --------------------------------------------------------------------------------------------
@@ -1240,10 +1245,10 @@
// controls [0] Controls OPTIONAL }
//
// Initialize the controls
- super.transitions[LdapStatesEnum.ATTRIBUTES_SR_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTES_SR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTES_SR_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTES_SR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from PartialAttributesList to typeSR
// --------------------------------------------------------------------------------------------
@@ -1256,9 +1261,9 @@
// ...
//
// Store the attribute's name.
- super.transitions[LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE, LdapStatesEnum.TYPE_SR_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store search result entry object name Value" )
+ super.transitions[LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE, LdapStatesEnum.TYPE_SR_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store search result entry object name Value" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1300,9 +1305,9 @@
// vals SET OF AttributeValue }
//
// We may have no value. Just allows the grammar to end
- super.transitions[LdapStatesEnum.TYPE_SR_STATE][UniversalTag.SET_TAG] =
- new GrammarTransition( LdapStatesEnum.TYPE_SR_STATE, LdapStatesEnum.VALS_SR_STATE, UniversalTag.SET_TAG,
- new GrammarAction( "Grammar end allowed" )
+ super.transitions[LdapStatesEnum.TYPE_SR_STATE][UniversalTag.SET_TAG] = new GrammarTransition(
+ LdapStatesEnum.TYPE_SR_STATE, LdapStatesEnum.VALS_SR_STATE, UniversalTag.SET_TAG, new GrammarAction(
+ "Grammar end allowed" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1320,10 +1325,10 @@
// AttributeValue ::= OCTET STRING
//
// Store the attribute value
- super.transitions[LdapStatesEnum.VALS_SR_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.VALS_SR_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, UniversalTag.OCTET_STRING_TAG,
- new SearchResultAttributeValueAction() );
-
+ super.transitions[LdapStatesEnum.VALS_SR_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALS_SR_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, UniversalTag.OCTET_STRING_TAG,
+ new SearchResultAttributeValueAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from ValsSR to PartialAttributesList
// --------------------------------------------------------------------------------------------
@@ -1332,9 +1337,9 @@
// vals SET OF AttributeValue }
//
// Loop when we don't have any attribute value. Nothing to do
- super.transitions[LdapStatesEnum.VALS_SR_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.VALS_SR_STATE, LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE, UniversalTag.SEQUENCE_TAG, null );
-
+ super.transitions[LdapStatesEnum.VALS_SR_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALS_SR_STATE, LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE, UniversalTag.SEQUENCE_TAG, null );
+
// --------------------------------------------------------------------------------------------
// Transition from ValsSR to Controls
// --------------------------------------------------------------------------------------------
@@ -1343,10 +1348,10 @@
// controls [0] Controls OPTIONAL }
//
// Initialize the controls
- super.transitions[LdapStatesEnum.VALS_SR_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.VALS_SR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.VALS_SR_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALS_SR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from AttributeValueSR to AttributeValueSR
// --------------------------------------------------------------------------------------------
@@ -1357,10 +1362,10 @@
// AttributeValue ::= OCTET STRING
//
// Store the attribute value
- super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, UniversalTag.OCTET_STRING_TAG,
- new SearchResultAttributeValueAction() );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE,
+ UniversalTag.OCTET_STRING_TAG, new SearchResultAttributeValueAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from AttributeValueSR to PartialAttributesList
// --------------------------------------------------------------------------------------------
@@ -1369,9 +1374,10 @@
// vals SET OF AttributeValue }
//
// Loop when we don't have any attribute value. Nothing to do
- super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE, UniversalTag.SEQUENCE_TAG, null );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE,
+ UniversalTag.SEQUENCE_TAG, null );
+
// --------------------------------------------------------------------------------------------
// Transition from AttributeValueSR to Controls
// --------------------------------------------------------------------------------------------
@@ -1380,19 +1386,19 @@
// controls [0] Controls OPTIONAL }
//
// Initialize the controls
- super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// SearchResultDone Message.
// --------------------------------------------------------------------------------------------
// LdapMessage ::= ... SearchResultDone ...
// SearchResultDone ::= [APPLICATION 5] SEQUENCE { ...
//
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.SEARCH_RESULT_DONE_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.SEARCH_RESULT_DONE_STATE, LdapConstants.SEARCH_RESULT_DONE_TAG,
- new GrammarAction( "Init search Result Done" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.SEARCH_RESULT_DONE_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.SEARCH_RESULT_DONE_STATE,
+ LdapConstants.SEARCH_RESULT_DONE_TAG, new GrammarAction( "Init search Result Done" )
{
public void action( IAsn1Container container )
{
@@ -1418,10 +1424,10 @@
// ...
//
// Stores the result code
- super.transitions[LdapStatesEnum.SEARCH_RESULT_DONE_STATE][UniversalTag.ENUMERATED_TAG] =
- new GrammarTransition( LdapStatesEnum.SEARCH_RESULT_DONE_STATE, LdapStatesEnum.RESULT_CODE_STATE, UniversalTag.ENUMERATED_TAG,
- new ResultCodeAction() );
-
+ super.transitions[LdapStatesEnum.SEARCH_RESULT_DONE_STATE][UniversalTag.ENUMERATED_TAG] = new GrammarTransition(
+ LdapStatesEnum.SEARCH_RESULT_DONE_STATE, LdapStatesEnum.RESULT_CODE_STATE, UniversalTag.ENUMERATED_TAG,
+ new ResultCodeAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Message ID to ModifyRequest Message
// --------------------------------------------------------------------------------------------
@@ -1429,9 +1435,9 @@
// ModifyRequest ::= [APPLICATION 6] SEQUENCE { ...
//
// Creates the Modify Request object
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.MODIFY_REQUEST_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.MODIFY_REQUEST_STATE, LdapConstants.MODIFY_REQUEST_TAG,
- new GrammarAction( "Init ModifyRequest" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.MODIFY_REQUEST_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.MODIFY_REQUEST_STATE, LdapConstants.MODIFY_REQUEST_TAG,
+ new GrammarAction( "Init ModifyRequest" )
{
public void action( IAsn1Container container )
{
@@ -1453,9 +1459,9 @@
// ...
//
// Stores the object DN
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.MODIFY_REQUEST_STATE, LdapStatesEnum.OBJECT_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store Modify request object Value" )
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.MODIFY_REQUEST_STATE, LdapStatesEnum.OBJECT_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store Modify request object Value" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1483,13 +1489,13 @@
}
catch ( InvalidNameException ine )
{
- String msg = "Invalid DN given : " + StringTools.utf8ToString( dnBytes ) +
- " (" + StringTools.dumpBytes( dnBytes ) +
- ") is invalid";
+ String msg = "Invalid DN given : " + StringTools.utf8ToString( dnBytes ) + " ("
+ + StringTools.dumpBytes( dnBytes ) + ") is invalid";
log.error( "{} : {}", msg, ine.getMessage() );
-
+
ModifyResponseImpl response = new ModifyResponseImpl( ldapMessage.getMessageId() );
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX,
+ LdapDN.EMPTY_LDAPDN, ine );
}
modifyRequest.setObject( object );
@@ -1511,9 +1517,9 @@
// ...
//
// Initialize the modifications list
- super.transitions[LdapStatesEnum.OBJECT_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.OBJECT_STATE, LdapStatesEnum.MODIFICATIONS_STATE, UniversalTag.SEQUENCE_TAG,
- new GrammarAction( "Init modifications array list" )
+ super.transitions[LdapStatesEnum.OBJECT_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.OBJECT_STATE, LdapStatesEnum.MODIFICATIONS_STATE, UniversalTag.SEQUENCE_TAG,
+ new GrammarAction( "Init modifications array list" )
{
public void action( IAsn1Container container )
{
@@ -1524,7 +1530,7 @@
modifyRequest.initModifications();
}
- } );
+ } );
// --------------------------------------------------------------------------------------------
// Transition from modifications to modification sequence
@@ -1535,8 +1541,8 @@
// ...
//
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFICATIONS_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.MODIFICATIONS_STATE, LdapStatesEnum.MODIFICATIONS_SEQ_STATE, UniversalTag.SEQUENCE_TAG, null );
+ super.transitions[LdapStatesEnum.MODIFICATIONS_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.MODIFICATIONS_STATE, LdapStatesEnum.MODIFICATIONS_SEQ_STATE, UniversalTag.SEQUENCE_TAG, null );
// --------------------------------------------------------------------------------------------
// Transition from modification sequence to operation
@@ -1548,9 +1554,9 @@
// ...
//
// Store operation type
- super.transitions[LdapStatesEnum.MODIFICATIONS_SEQ_STATE][UniversalTag.ENUMERATED_TAG] =
- new GrammarTransition( LdapStatesEnum.MODIFICATIONS_SEQ_STATE, LdapStatesEnum.OPERATION_STATE, UniversalTag.ENUMERATED_TAG,
- new GrammarAction( "Store operation type" )
+ super.transitions[LdapStatesEnum.MODIFICATIONS_SEQ_STATE][UniversalTag.ENUMERATED_TAG] = new GrammarTransition(
+ LdapStatesEnum.MODIFICATIONS_SEQ_STATE, LdapStatesEnum.OPERATION_STATE, UniversalTag.ENUMERATED_TAG,
+ new GrammarAction( "Store operation type" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1573,7 +1579,7 @@
String msg = "Invalid operation ( " + StringTools.dumpBytes( tlv.getValue().getData() )
+ "), it should be 0, 1 or 2";
log.error( msg );
-
+
// This will generate a PROTOCOL_ERROR
throw new DecoderException( msg );
}
@@ -1615,9 +1621,9 @@
// ...
//
// Nothing to do
- super.transitions[LdapStatesEnum.OPERATION_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.OPERATION_STATE, LdapStatesEnum.MODIFICATION_STATE, UniversalTag.SEQUENCE_TAG, null );
-
+ super.transitions[LdapStatesEnum.OPERATION_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.OPERATION_STATE, LdapStatesEnum.MODIFICATION_STATE, UniversalTag.SEQUENCE_TAG, null );
+
// --------------------------------------------------------------------------------------------
// Transition from modification to TypeMod
// --------------------------------------------------------------------------------------------
@@ -1632,9 +1638,9 @@
// ...
//
// Stores the type
- super.transitions[LdapStatesEnum.MODIFICATION_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.MODIFICATION_STATE, LdapStatesEnum.TYPE_MOD_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store type" )
+ super.transitions[LdapStatesEnum.MODIFICATION_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.MODIFICATION_STATE, LdapStatesEnum.TYPE_MOD_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store type" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1652,9 +1658,10 @@
{
String msg = "The type can't be null";
log.error( msg );
-
+
ModifyResponseImpl response = new ModifyResponseImpl( ldapMessage.getMessageId() );
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, modifyRequest.getObject(), null );
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
+ modifyRequest.getObject(), null );
}
else
{
@@ -1668,7 +1675,7 @@
}
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from TypeMod to vals
// --------------------------------------------------------------------------------------------
@@ -1683,9 +1690,9 @@
// vals SET OF AttributeValue }
//
// Initialize the list of values
- super.transitions[LdapStatesEnum.TYPE_MOD_STATE][UniversalTag.SET_TAG] =
- new GrammarTransition( LdapStatesEnum.TYPE_MOD_STATE, LdapStatesEnum.VALS_STATE, UniversalTag.SET_TAG,
- new GrammarAction( "Init Attribute vals" )
+ super.transitions[LdapStatesEnum.TYPE_MOD_STATE][UniversalTag.SET_TAG] = new GrammarTransition(
+ LdapStatesEnum.TYPE_MOD_STATE, LdapStatesEnum.VALS_STATE, UniversalTag.SET_TAG, new GrammarAction(
+ "Init Attribute vals" )
{
public void action( IAsn1Container container )
{
@@ -1705,8 +1712,8 @@
log.debug( "Some vals are to be decoded" );
}
- } );
-
+ } );
+
// --------------------------------------------------------------------------------------------
// Transition from vals to Attribute Value
// --------------------------------------------------------------------------------------------
@@ -1723,10 +1730,10 @@
// AttributeValue ::= OCTET STRING
//
// Stores a value
- super.transitions[LdapStatesEnum.VALS_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.VALS_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_STATE, UniversalTag.OCTET_STRING_TAG,
- new ModifyAttributeValueAction() );
-
+ super.transitions[LdapStatesEnum.VALS_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALS_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ModifyAttributeValueAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from vals to ModificationsSeq
// --------------------------------------------------------------------------------------------
@@ -1743,9 +1750,9 @@
// AttributeValue ::= OCTET STRING
//
// Nothing to do
- super.transitions[LdapStatesEnum.VALS_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.VALS_STATE, LdapStatesEnum.MODIFICATIONS_SEQ_STATE, UniversalTag.SEQUENCE_TAG, null );
-
+ super.transitions[LdapStatesEnum.VALS_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALS_STATE, LdapStatesEnum.MODIFICATIONS_SEQ_STATE, UniversalTag.SEQUENCE_TAG, null );
+
// --------------------------------------------------------------------------------------------
// Transition from vals to Controls
// --------------------------------------------------------------------------------------------
@@ -1754,10 +1761,10 @@
// controls [0] Controls OPTIONAL }
//
// Nothing to do
- super.transitions[LdapStatesEnum.VALS_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.VALS_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.VALS_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALS_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Attribute Value to Attribute Value
// --------------------------------------------------------------------------------------------
@@ -1774,10 +1781,10 @@
// AttributeValue ::= OCTET STRING
//
// Stores a value
- super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTE_VALUE_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_STATE, UniversalTag.OCTET_STRING_TAG,
- new ModifyAttributeValueAction() );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTE_VALUE_STATE, LdapStatesEnum.ATTRIBUTE_VALUE_STATE, UniversalTag.OCTET_STRING_TAG,
+ new ModifyAttributeValueAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Attribute Value to ModificationsSeq
// --------------------------------------------------------------------------------------------
@@ -1794,9 +1801,10 @@
// AttributeValue ::= OCTET STRING
//
// Nothing to do
- super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTE_VALUE_STATE, LdapStatesEnum.MODIFICATIONS_SEQ_STATE, UniversalTag.SEQUENCE_TAG, null );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTE_VALUE_STATE, LdapStatesEnum.MODIFICATIONS_SEQ_STATE, UniversalTag.SEQUENCE_TAG,
+ null );
+
// --------------------------------------------------------------------------------------------
// Transition from Attribute Value to Controls
// --------------------------------------------------------------------------------------------
@@ -1805,32 +1813,32 @@
// controls [0] Controls OPTIONAL }
//
// Nothing to do
- super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTE_VALUE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
-
+ super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTE_VALUE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
+
// --------------------------------------------------------------------------------------------
// ModifyResponse Message.
// --------------------------------------------------------------------------------------------
// LdapMessage ::= ... ModifyResponse ...
// ModifyResponse ::= [APPLICATION 7] SEQUENCE { ...
// We have to switch to the ModifyResponse grammar
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.MODIFY_RESPONSE_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.MODIFY_RESPONSE_STATE, LdapConstants.MODIFY_RESPONSE_TAG,
- new GrammarAction( "Init ModifyResponse" )
- {
- public void action( IAsn1Container container )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.MODIFY_RESPONSE_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.MODIFY_RESPONSE_STATE, LdapConstants.MODIFY_RESPONSE_TAG,
+ new GrammarAction( "Init ModifyResponse" )
{
+ public void action( IAsn1Container container )
+ {
- LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
- LdapMessage ldapMessage = ldapMessageContainer.getLdapMessage();
+ LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
+ LdapMessage ldapMessage = ldapMessageContainer.getLdapMessage();
- // We associate it to the ldapMessage Object
- ldapMessage.setProtocolOP( new ModifyResponse() );
+ // We associate it to the ldapMessage Object
+ ldapMessage.setProtocolOP( new ModifyResponse() );
- log.debug( "Modify response" );
- }
- } );
+ log.debug( "Modify response" );
+ }
+ } );
// --------------------------------------------------------------------------------------------
// ModifyResponse Message.
@@ -1843,10 +1851,10 @@
// ...
//
// Stores the result code
- super.transitions[LdapStatesEnum.MODIFY_RESPONSE_STATE][UniversalTag.ENUMERATED_TAG] =
- new GrammarTransition( LdapStatesEnum.MODIFY_RESPONSE_STATE, LdapStatesEnum.RESULT_CODE_STATE, UniversalTag.ENUMERATED_TAG,
- new ResultCodeAction() );
-
+ super.transitions[LdapStatesEnum.MODIFY_RESPONSE_STATE][UniversalTag.ENUMERATED_TAG] = new GrammarTransition(
+ LdapStatesEnum.MODIFY_RESPONSE_STATE, LdapStatesEnum.RESULT_CODE_STATE, UniversalTag.ENUMERATED_TAG,
+ new ResultCodeAction() );
+
// --------------------------------------------------------------------------------------------
// AddRequest Message.
// --------------------------------------------------------------------------------------------
@@ -1854,9 +1862,9 @@
// AddRequest ::= [APPLICATION 8] SEQUENCE { ...
//
// Initialize the AddRequest object
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.ADD_REQUEST_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.ADD_REQUEST_STATE, LdapConstants.ADD_REQUEST_TAG,
- new GrammarAction( "Init addRequest" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.ADD_REQUEST_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.ADD_REQUEST_STATE, LdapConstants.ADD_REQUEST_TAG,
+ new GrammarAction( "Init addRequest" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1871,7 +1879,7 @@
{
String msg = "The AddRequest must not be null";
log.error( msg );
-
+
// Will generate a PROTOCOL_ERROR
throw new DecoderException( msg );
}
@@ -1890,9 +1898,9 @@
// ...
//
// Stores the DN
- super.transitions[LdapStatesEnum.ADD_REQUEST_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.ADD_REQUEST_STATE, LdapStatesEnum.ENTRY_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store add request object Value" )
+ super.transitions[LdapStatesEnum.ADD_REQUEST_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.ADD_REQUEST_STATE, LdapStatesEnum.ENTRY_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store add request object Value" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -1908,12 +1916,13 @@
{
String msg = "Empty entry DN given";
log.error( msg );
-
+
AddResponseImpl response = new AddResponseImpl( ldapMessage.getMessageId() );
-
+
// I guess that trying to add an entry which DN is empty is a naming violation...
// Not 100% sure though ...
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.NAMING_VIOLATION, LdapDN.EMPTY_LDAPDN, null );
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.NAMING_VIOLATION,
+ LdapDN.EMPTY_LDAPDN, null );
}
else
{
@@ -1926,13 +1935,13 @@
}
catch ( InvalidNameException ine )
{
- String msg = "Invalid DN given : " + StringTools.utf8ToString( dnBytes ) +
- " (" + StringTools.dumpBytes( dnBytes ) +
- ") is invalid";
+ String msg = "Invalid DN given : " + StringTools.utf8ToString( dnBytes ) + " ("
+ + StringTools.dumpBytes( dnBytes ) + ") is invalid";
log.error( "{} : {}", msg, ine.getMessage() );
-
+
AddResponseImpl response = new AddResponseImpl( ldapMessage.getMessageId() );
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX,
+ LdapDN.EMPTY_LDAPDN, ine );
}
addRequest.setEntry( entry );
@@ -1952,9 +1961,9 @@
// AttributeList ::= SEQUENCE OF ...
//
// Initialize the attribute list
- super.transitions[LdapStatesEnum.ENTRY_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.ENTRY_STATE, LdapStatesEnum.ATTRIBUTES_STATE, UniversalTag.SEQUENCE_TAG,
- new GrammarAction( "Init attributes array list" )
+ super.transitions[LdapStatesEnum.ENTRY_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.ENTRY_STATE, LdapStatesEnum.ATTRIBUTES_STATE, UniversalTag.SEQUENCE_TAG, new GrammarAction(
+ "Init attributes array list" )
{
public void action( IAsn1Container container )
{
@@ -1966,15 +1975,15 @@
addRequest.initAttributes();
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from Attributes to Attribute
// --------------------------------------------------------------------------------------------
// AttributeList ::= SEQUENCE OF SEQUENCE {
//
// We don't do anything in this transition. The attribute will be created when we met the type
- super.transitions[LdapStatesEnum.ATTRIBUTES_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTES_STATE, LdapStatesEnum.ATTRIBUTE_STATE, UniversalTag.SEQUENCE_TAG, null );
+ super.transitions[LdapStatesEnum.ATTRIBUTES_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTES_STATE, LdapStatesEnum.ATTRIBUTE_STATE, UniversalTag.SEQUENCE_TAG, null );
// --------------------------------------------------------------------------------------------
// Transition from Attribute to type
@@ -1986,9 +1995,9 @@
// AttributeDescription LDAPString
//
// We store the type in the current attribute
- super.transitions[LdapStatesEnum.ATTRIBUTE_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.ATTRIBUTE_STATE, LdapStatesEnum.TYPE_STATE, UniversalTag.OCTET_STRING_TAG,
- new GrammarAction( "Store attribute type" )
+ super.transitions[LdapStatesEnum.ATTRIBUTE_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.ATTRIBUTE_STATE, LdapStatesEnum.TYPE_STATE, UniversalTag.OCTET_STRING_TAG,
+ new GrammarAction( "Store attribute type" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -2003,12 +2012,13 @@
if ( tlv.getLength() == 0 )
{
- String msg = "Null or empty types are not allowed";
+ String msg = "Null or empty types are not allowed";
log.error( msg );
AddResponseImpl response = new AddResponseImpl( ldapMessage.getMessageId() );
-
- throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, addRequest.getEntry(), null );
+
+ throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
+ addRequest.getEntry(), null );
}
String type = StringTools.getType( tlv.getValue().getData() );
@@ -2021,7 +2031,7 @@
}
}
} );
-
+
// --------------------------------------------------------------------------------------------
// Transition from type to vals
// --------------------------------------------------------------------------------------------
@@ -2030,9 +2040,9 @@
// vals SET OF AttributeValue }
//
// Nothing to do here.
- super.transitions[LdapStatesEnum.TYPE_STATE][UniversalTag.SET_TAG] =
- new GrammarTransition( LdapStatesEnum.TYPE_STATE, LdapStatesEnum.VALUES_STATE, UniversalTag.SET_TAG, null );
-
+ super.transitions[LdapStatesEnum.TYPE_STATE][UniversalTag.SET_TAG] = new GrammarTransition(
+ LdapStatesEnum.TYPE_STATE, LdapStatesEnum.VALUES_STATE, UniversalTag.SET_TAG, null );
+
// --------------------------------------------------------------------------------------------
// Transition from vals to Value
// --------------------------------------------------------------------------------------------
@@ -2043,10 +2053,9 @@
// AttributeValue OCTET STRING
//
// Store the value into the current attribute
- super.transitions[LdapStatesEnum.VALUES_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.VALUES_STATE, LdapStatesEnum.VALUE_STATE, UniversalTag.OCTET_STRING_TAG,
- new ValueAction() );
-
+ super.transitions[LdapStatesEnum.VALUES_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALUES_STATE, LdapStatesEnum.VALUE_STATE, UniversalTag.OCTET_STRING_TAG, new ValueAction() );
+
// --------------------------------------------------------------------------------------------
// Transition from Value to Value
// --------------------------------------------------------------------------------------------
@@ -2057,9 +2066,8 @@
// AttributeValue OCTET STRING
//
// Store the value into the current attribute
- super.transitions[LdapStatesEnum.VALUE_STATE][UniversalTag.OCTET_STRING_TAG] =
- new GrammarTransition( LdapStatesEnum.VALUE_STATE, LdapStatesEnum.VALUE_STATE, UniversalTag.OCTET_STRING_TAG,
- new ValueAction() );
+ super.transitions[LdapStatesEnum.VALUE_STATE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALUE_STATE, LdapStatesEnum.VALUE_STATE, UniversalTag.OCTET_STRING_TAG, new ValueAction() );
// --------------------------------------------------------------------------------------------
// Transition from Value to Attribute
@@ -2067,8 +2075,8 @@
// AttributeList ::= SEQUENCE OF SEQUENCE {
//
// Nothing to do here.
- super.transitions[LdapStatesEnum.VALUE_STATE][UniversalTag.SEQUENCE_TAG] =
- new GrammarTransition( LdapStatesEnum.VALUE_STATE, LdapStatesEnum.ATTRIBUTE_STATE, UniversalTag.SEQUENCE_TAG, null );
+ super.transitions[LdapStatesEnum.VALUE_STATE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALUE_STATE, LdapStatesEnum.ATTRIBUTE_STATE, UniversalTag.SEQUENCE_TAG, null );
// --------------------------------------------------------------------------------------------
// Transition from Value to Controls
@@ -2076,9 +2084,9 @@
// AttributeList ::= SEQUENCE OF SEQUENCE {
//
// Initialize the controls
- super.transitions[LdapStatesEnum.VALUE_STATE][LdapConstants.CONTROLS_TAG] =
- new GrammarTransition( LdapStatesEnum.VALUE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
- new ControlsInitAction() );
+ super.transitions[LdapStatesEnum.VALUE_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
+ LdapStatesEnum.VALUE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
+ new ControlsInitAction() );
// --------------------------------------------------------------------------------------------
// AddResponse Message.
@@ -2086,9 +2094,9 @@
// LdapMessage ::= ... AddResponse ...
// AddResponse ::= [APPLICATION 9] LDAPResult
//
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.ADD_RESPONSE_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.ADD_RESPONSE_STATE, LdapConstants.ADD_RESPONSE_TAG,
- new GrammarAction( "Init AddResponse" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.ADD_RESPONSE_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.ADD_RESPONSE_STATE, LdapConstants.ADD_RESPONSE_TAG,
+ new GrammarAction( "Init AddResponse" )
{
public void action( IAsn1Container container ) throws DecoderException
{
@@ -2135,19 +2143,19 @@
// ...
//
// Stores the result code
- super.transitions[LdapStatesEnum.ADD_RESPONSE_STATE][UniversalTag.ENUMERATED_TAG] =
- new GrammarTransition( LdapStatesEnum.ADD_RESPONSE_STATE, LdapStatesEnum.RESULT_CODE_STATE, UniversalTag.ENUMERATED_TAG,
- new ResultCodeAction() );
-
+ super.transitions[LdapStatesEnum.ADD_RESPONSE_STATE][UniversalTag.ENUMERATED_TAG] = new GrammarTransition(
+ LdapStatesEnum.ADD_RESPONSE_STATE, LdapStatesEnum.RESULT_CODE_STATE, UniversalTag.ENUMERATED_TAG,
+ new ResultCodeAction() );
+
// --------------------------------------------------------------------------------------------
// DelResponse Message.
// --------------------------------------------------------------------------------------------
// LdapMessage ::= ... DelResponse ...
// DelResponse ::= [APPLICATION 11] LDAPResult
// We have to switch to the DelResponse grammar
- super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.DEL_RESPONSE_TAG] =
- new GrammarTransition( LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.DEL_RESPONSE_STATE, LdapConstants.DEL_RESPONSE_TAG,
- new GrammarAction( "Init DelResponse" )
+ super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.DEL_RESPONSE_TAG] = new GrammarTransition(
+ LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.DEL_RESPONSE_STATE, LdapConstants.DEL_RESPONSE_TAG,
+ new GrammarAction( "Init DelResponse" )
{
public void action( IAsn1Container container )
[... 3232 lines stripped ...]