1 20 21 package org.apache.directory.ldapstudio.dsmlv2.request; 22 23 24 import java.io.IOException ; 25 import java.lang.reflect.Array ; 26 import java.util.HashMap ; 27 28 import javax.naming.InvalidNameException ; 29 30 import org.apache.directory.ldapstudio.dsmlv2.AbstractGrammar; 31 import org.apache.directory.ldapstudio.dsmlv2.Dsmlv2Container; 32 import org.apache.directory.ldapstudio.dsmlv2.Dsmlv2StatesEnum; 33 import org.apache.directory.ldapstudio.dsmlv2.GrammarAction; 34 import org.apache.directory.ldapstudio.dsmlv2.GrammarTransition; 35 import org.apache.directory.ldapstudio.dsmlv2.IGrammar; 36 import org.apache.directory.ldapstudio.dsmlv2.ParserUtils; 37 import org.apache.directory.ldapstudio.dsmlv2.Tag; 38 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.OnError; 39 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.Processing; 40 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.ResponseOrder; 41 import org.apache.directory.shared.asn1.Asn1Object; 42 import org.apache.directory.shared.asn1.codec.DecoderException; 43 import org.apache.directory.shared.asn1.primitives.OID; 44 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion; 45 import org.apache.directory.shared.ldap.codec.Control; 46 import org.apache.directory.shared.ldap.codec.LdapConstants; 47 import org.apache.directory.shared.ldap.codec.abandon.AbandonRequest; 48 import org.apache.directory.shared.ldap.codec.add.AddRequest; 49 import org.apache.directory.shared.ldap.codec.bind.BindRequest; 50 import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication; 51 import org.apache.directory.shared.ldap.codec.compare.CompareRequest; 52 import org.apache.directory.shared.ldap.codec.del.DelRequest; 53 import org.apache.directory.shared.ldap.codec.extended.ExtendedRequest; 54 import org.apache.directory.shared.ldap.codec.modify.ModifyRequest; 55 import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequest; 56 import org.apache.directory.shared.ldap.codec.search.AndFilter; 57 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter; 58 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter; 59 import org.apache.directory.shared.ldap.codec.search.Filter; 60 import org.apache.directory.shared.ldap.codec.search.NotFilter; 61 import org.apache.directory.shared.ldap.codec.search.OrFilter; 62 import org.apache.directory.shared.ldap.codec.search.PresentFilter; 63 import org.apache.directory.shared.ldap.codec.search.SearchRequest; 64 import org.apache.directory.shared.ldap.codec.search.SubstringFilter; 65 import org.apache.directory.shared.ldap.message.ScopeEnum; 66 import org.apache.directory.shared.ldap.name.LdapDN; 67 import org.apache.directory.shared.ldap.name.Rdn; 68 import org.apache.directory.shared.ldap.util.Base64; 69 import org.apache.directory.shared.ldap.util.StringTools; 70 import org.xmlpull.v1.XmlPullParser; 71 import org.xmlpull.v1.XmlPullParserException; 72 73 74 80 public class Dsmlv2Grammar extends AbstractGrammar implements IGrammar 81 { 82 83 private static Dsmlv2Grammar instance = new Dsmlv2Grammar(); 84 85 86 89 @SuppressWarnings ("unchecked") 90 private Dsmlv2Grammar() 91 { 92 name = Dsmlv2Grammar.class.getName(); 93 statesEnum = Dsmlv2StatesEnum.getInstance(); 94 95 super.transitions = ( HashMap <Tag, GrammarTransition>[] ) Array.newInstance( HashMap .class, 200 );; 98 super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE] = new HashMap <Tag, GrammarTransition>(); 102 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 103 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP] = new HashMap <Tag, GrammarTransition>(); 104 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_END_TAG] = new HashMap <Tag, GrammarTransition>(); 105 106 super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE].put( new Tag( "batchRequest", Tag.START ), 109 new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, 110 batchRequestCreation ) ); 111 112 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG] 115 .put( new Tag( "batchRequest", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, 116 Dsmlv2StatesEnum.BATCHREQUEST_END_TAG, null ) ); 117 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "batchRequest", Tag.END ), 119 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.END_STATE, null ) ); 120 121 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "abandonRequest", Tag.START ), 124 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, 125 abandonRequestCreation ) ); 126 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "abandonRequest", Tag.START ), 128 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, 129 abandonRequestCreation ) ); 130 131 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "addRequest", Tag.START ), 134 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, 135 addRequestCreation ) ); 136 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "addRequest", Tag.START ), 138 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, 139 addRequestCreation ) ); 140 141 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "authRequest", Tag.START ), 144 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, 145 authRequestCreation ) ); 146 147 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "compareRequest", Tag.START ), 150 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG, 151 compareRequestCreation ) ); 152 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "compareRequest", Tag.START ), 154 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG, 155 compareRequestCreation ) ); 156 157 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "delRequest", Tag.START ), 160 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, 161 delRequestCreation ) ); 162 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "delRequest", Tag.START ), 164 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, 165 delRequestCreation ) ); 166 167 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "extendedRequest", Tag.START ), 170 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, 171 Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, extendedRequestCreation ) ); 172 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "extendedRequest", Tag.START ), 174 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, 175 extendedRequestCreation ) ); 176 177 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "modDNRequest", Tag.START ), 180 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, 181 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, modDNRequestCreation ) ); 182 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "modDNRequest", Tag.START ), 184 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, 185 modDNRequestCreation ) ); 186 187 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "modifyRequest", Tag.START ), 190 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, 191 modifyRequestCreation ) ); 192 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "modifyRequest", Tag.START ), 194 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, 195 modifyRequestCreation ) ); 196 197 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "searchRequest", Tag.START ), 200 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, 201 searchRequestCreation ) ); 202 super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "searchRequest", Tag.START ), 204 new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, 205 searchRequestCreation ) ); 206 207 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 211 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 212 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 213 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 214 215 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG] 217 .put( new Tag( "abandonRequest", Tag.END ), new GrammarTransition( 218 Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 219 220 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 222 new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, 223 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) ); 224 225 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG].put( 227 new Tag( "controlValue", Tag.START ), new GrammarTransition( 228 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, 229 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 230 231 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 233 new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG, 234 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) ); 235 236 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 238 new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, 239 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) ); 240 241 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 243 new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, 244 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) ); 245 246 super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG].put( new Tag( "abandonRequest", Tag.END ), 248 new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, 249 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 250 251 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 255 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 256 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 257 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 258 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG] = new HashMap <Tag, GrammarTransition>(); 259 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG] = new HashMap <Tag, GrammarTransition>(); 260 261 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG].put( new Tag( "addRequest", Tag.END ), 263 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 264 265 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 267 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, 268 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) ); 269 270 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ), 272 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, 273 Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 274 275 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 277 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG, 278 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) ); 279 280 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 282 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, 283 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) ); 284 285 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 287 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, 288 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) ); 289 290 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG].put( new Tag( "addRequest", Tag.END ), 292 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, 293 null ) ); 294 295 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG].put( new Tag( "attr", Tag.START ), 297 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, 298 addRequestAddAttribute ) ); 299 300 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG].put( new Tag( "attr", Tag.START ), 302 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, 303 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) ); 304 305 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG].put( new Tag( "attr", Tag.START ), 307 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, 308 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) ); 309 310 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG].put( new Tag( "attr", Tag.END ), 312 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, 313 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, null ) ); 314 315 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG].put( new Tag( "value", Tag.START ), 317 new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, 318 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddValue ) ); 319 320 super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG] 322 .put( new Tag( "addRequest", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, 323 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 324 325 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 329 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 330 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 331 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 332 333 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG].put( new Tag( "authRequest", Tag.END ), 335 new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 336 337 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 339 new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, 340 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) ); 341 342 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ), 344 new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, 345 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 346 347 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 349 new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG, 350 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) ); 351 352 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 354 new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, 355 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) ); 356 357 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 359 new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, 360 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) ); 361 362 super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG].put( new Tag( "authRequest", Tag.END ), 364 new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, 365 null ) ); 366 367 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 371 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 372 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 373 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 374 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG] = new HashMap <Tag, GrammarTransition>(); 375 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG] = new HashMap <Tag, GrammarTransition>(); 376 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 377 378 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 380 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG, 381 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) ); 382 383 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG].put( 385 new Tag( "controlValue", Tag.START ), new GrammarTransition( 386 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, 387 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 388 389 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 391 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG, 392 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) ); 393 394 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 396 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, 397 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) ); 398 399 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 401 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, 402 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) ); 403 404 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG].put( new Tag( "compareRequest", Tag.END ), 406 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, 407 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 408 409 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG].put( new Tag( "assertion", Tag.START ), 411 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, 412 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) ); 413 414 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG].put( new Tag( "assertion", Tag.START ), 416 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, 417 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) ); 418 419 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG].put( new Tag( "value", Tag.START ), 421 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, 422 Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG, compareRequestAddValue ) ); 423 424 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG].put( new Tag( "assertion", Tag.END ), 426 new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG, 427 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, null ) ); 428 429 super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG].put( 431 new Tag( "compareRequest", Tag.END ), new GrammarTransition( 432 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 433 434 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 438 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 439 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 440 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 441 442 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG].put( new Tag( "delRequest", Tag.END ), 444 new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 445 446 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 448 new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, 449 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) ); 450 451 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ), 453 new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, 454 Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 455 456 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 458 new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG, 459 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) ); 460 461 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 463 new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, 464 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) ); 465 466 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 468 new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, 469 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) ); 470 471 super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG].put( new Tag( "delRequest", Tag.END ), 473 new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, 474 null ) ); 475 476 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 480 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 481 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 482 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 483 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG] = new HashMap <Tag, GrammarTransition>(); 484 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 485 486 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 488 new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, 489 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) ); 490 491 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG].put( 493 new Tag( "controlValue", Tag.START ), new GrammarTransition( 494 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, 495 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 496 497 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 499 new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG, 500 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) ); 501 502 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 504 new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, 505 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) ); 506 507 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 509 new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, 510 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) ); 511 512 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG].put( 514 new Tag( "extendedRequest", Tag.END ), new GrammarTransition( 515 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 516 517 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG].put( new Tag( "requestName", Tag.START ), 519 new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, 520 Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) ); 521 522 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG].put( new Tag( "requestName", Tag.START ), 524 new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, 525 Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) ); 526 527 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG].put( new Tag( "extendedRequest", 529 Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, 530 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 531 532 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG].put( new Tag( "requestValue", 534 Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, 535 Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG, extendedRequestAddValue ) ); 536 537 super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG].put( new Tag( "extendedRequest", 539 Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG, 540 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 541 542 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 546 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 547 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 548 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 549 550 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG].put( new Tag( "modDNRequest", Tag.END ), 552 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, 553 null ) ); 554 555 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 557 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, 558 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) ); 559 560 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG].put( 562 new Tag( "controlValue", Tag.START ), new GrammarTransition( 563 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, 564 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 565 566 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 568 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG, 569 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) ); 570 571 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 573 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, 574 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) ); 575 576 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 578 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, 579 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) ); 580 581 super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG].put( new Tag( "modDNRequest", Tag.END ), 583 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, 584 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 585 586 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 590 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 591 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 592 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 593 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG] = new HashMap <Tag, GrammarTransition>(); 594 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG] = new HashMap <Tag, GrammarTransition>(); 595 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 596 597 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG] 599 .put( new Tag( "modifyRequest", Tag.END ), new GrammarTransition( 600 Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 601 602 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 604 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, 605 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) ); 606 607 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ), 609 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, 610 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 611 612 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 614 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG, 615 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) ); 616 617 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 619 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, 620 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) ); 621 622 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 624 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, 625 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) ); 626 627 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG].put( new Tag( "modifyRequest", Tag.END ), 629 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, 630 null ) ); 631 632 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG].put( new Tag( "modification", Tag.START ), 634 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, 635 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) ); 636 637 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG].put( new Tag( "modification", Tag.START ), 639 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, 640 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) ); 641 642 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG].put( 644 new Tag( "modification", Tag.START ), new GrammarTransition( 645 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, 646 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) ); 647 648 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG].put( 650 new Tag( "modification", Tag.END ), new GrammarTransition( 651 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, 652 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) ); 653 654 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG].put( new Tag( "value", Tag.START ), 656 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, 657 Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) ); 658 659 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG].put( new Tag( "value", Tag.START ), 661 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, 662 Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) ); 663 664 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG].put( new Tag( "modification", Tag.END ), 666 new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, 667 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) ); 668 669 super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG].put( 671 new Tag( "modifyRequest", Tag.END ), new GrammarTransition( 672 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 673 674 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG] = new HashMap <Tag, GrammarTransition>(); 678 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 679 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 680 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 681 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG] = new HashMap <Tag, GrammarTransition>(); 682 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG] = new HashMap <Tag, GrammarTransition>(); 683 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG] = new HashMap <Tag, GrammarTransition>(); 684 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 685 686 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG].put( new Tag( "control", Tag.START ), 688 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, 689 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) ); 690 691 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ), 693 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, 694 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); 695 696 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ), 698 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG, 699 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) ); 700 701 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ), 703 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, 704 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) ); 705 706 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ), 708 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, 709 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) ); 710 711 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG].put( new Tag( "attributes", Tag.END ), 713 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, 714 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) ); 715 716 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG].put( new Tag( "attribute", Tag.START ), 718 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, 719 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) ); 720 721 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG].put( new Tag( "attribute", Tag.END ), 723 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, 724 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, null ) ); 725 726 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG].put( new Tag( "attribute", Tag.START ), 728 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, 729 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) ); 730 731 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG].put( new Tag( "attributes", Tag.END ), 733 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, 734 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) ); 735 736 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG].put( new Tag( "searchRequest", Tag.END ), 738 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, 739 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); 740 741 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG] = new HashMap <Tag, GrammarTransition>(); 745 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG] = new HashMap <Tag, GrammarTransition>(); 746 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP] = new HashMap <Tag, GrammarTransition>(); 747 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG] = new HashMap <Tag, GrammarTransition>(); 748 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 749 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG] = new HashMap <Tag, GrammarTransition>(); 750 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG] = new HashMap <Tag, GrammarTransition>(); 751 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG] = new HashMap <Tag, GrammarTransition>(); 752 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG] = new HashMap <Tag, GrammarTransition>(); 753 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 754 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG] = new HashMap <Tag, GrammarTransition>(); 755 756 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG].put( new Tag( "filter", Tag.START ), 758 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, 759 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) ); 760 761 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG].put( new Tag( "filter", Tag.START ), 763 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, 764 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) ); 765 766 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "and", Tag.START ), 769 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 770 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) ); 771 772 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "and", Tag.START ), 774 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 775 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) ); 776 777 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "and", Tag.END ), 779 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 780 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) ); 781 782 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "or", Tag.START ), 785 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 786 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) ); 787 788 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "or", Tag.START ), 790 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 791 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) ); 792 793 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "or", Tag.END ), 795 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 796 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) ); 797 798 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "not", Tag.START ), 801 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 802 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) ); 803 804 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "not", Tag.START ), 806 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 807 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) ); 808 809 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "not", Tag.END ), 811 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 812 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) ); 813 814 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "substrings", Tag.START ), 817 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 818 Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) ); 819 820 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "substrings", Tag.START ), 822 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 823 Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) ); 824 825 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "equalityMatch", Tag.START ), 828 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 829 Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) ); 830 831 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "equalityMatch", Tag.START ), 833 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 834 Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) ); 835 836 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG].put( new Tag( "value", Tag.START ), 838 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, 839 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); 840 841 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "equalityMatch", Tag.END ), 843 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, 844 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); 845 846 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( 849 new Tag( "greaterOrEqual", Tag.START ), new GrammarTransition( 850 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 851 Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) ); 852 853 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "greaterOrEqual", Tag.START ), 855 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 856 Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) ); 857 858 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG].put( new Tag( "value", Tag.START ), 860 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, 861 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); 862 863 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "greaterOrEqual", Tag.END ), 865 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, 866 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); 867 868 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "lessOrEqual", Tag.START ), 871 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 872 Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) ); 873 874 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "lessOrEqual", Tag.START ), 876 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 877 Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) ); 878 879 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG].put( new Tag( "value", Tag.START ), 881 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, 882 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); 883 884 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "lessOrEqual", Tag.END ), 886 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, 887 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); 888 889 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "approxMatch", Tag.START ), 892 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 893 Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) ); 894 895 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "approxMatch", Tag.START ), 897 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 898 Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) ); 899 900 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG].put( new Tag( "value", Tag.START ), 902 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, 903 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); 904 905 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "approxMatch", Tag.END ), 907 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, 908 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); 909 910 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "present", Tag.START ), 913 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 914 Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) ); 915 916 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "present", Tag.START ), 918 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 919 Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) ); 920 921 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG].put( new Tag( "present", Tag.END ), 923 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, 924 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); 925 926 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( 929 new Tag( "extensibleMatch", Tag.START ), new GrammarTransition( 930 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, 931 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) ); 932 933 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "extensibleMatch", Tag.START ), 935 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 936 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) ); 937 938 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG].put( 940 new Tag( "value", Tag.START ), new GrammarTransition( 941 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, 942 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, extensibleMatchAddValue ) ); 943 944 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG].put( new Tag( 946 "extensibleMatch", Tag.END ), new GrammarTransition( 947 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 948 null ) ); 949 950 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "filter", Tag.END ), 953 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, 954 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, null ) ); 955 956 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG].put( new Tag( "attributes", Tag.START ), 958 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, 959 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, null ) ); 960 961 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG].put( new Tag( "searchRequest", Tag.END ), 963 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, 964 null ) ); 965 966 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG] = new HashMap <Tag, GrammarTransition>(); 970 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 971 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG] = new HashMap <Tag, GrammarTransition>(); 972 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG] = new HashMap <Tag, GrammarTransition>(); 973 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_END_TAG] = new HashMap <Tag, GrammarTransition>(); 974 975 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "substrings", Tag.END ), 977 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, 978 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); 979 980 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "initial", Tag.START ), 982 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, 983 Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, substringsFilterSetInitial ) ); 984 985 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG].put( new Tag( "any", Tag.START ), 987 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, 988 Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) ); 989 990 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG].put( new Tag( "final", Tag.START ), 992 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, 993 Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) ); 994 995 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG].put( new Tag( "substrings", Tag.END ), 997 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, 998 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) ); 999 1000 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "any", Tag.START ), 1002 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, 1003 Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) ); 1004 1005 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG].put( new Tag( "any", Tag.START ), 1007 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, 1008 Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) ); 1009 1010 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG].put( new Tag( "final", Tag.START ), 1012 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, 1013 Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) ); 1014 1015 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG].put( new Tag( "substrings", Tag.END ), 1017 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, 1018 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) ); 1019 1020 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "final", Tag.START ), 1022 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, 1023 Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) ); 1024 1025 super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG].put( new Tag( "substrings", Tag.END ), 1027 new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, 1028 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) ); 1029 1030 } 1032 1036 1039 private final GrammarAction batchRequestCreation = new GrammarAction( "Create Batch Request" ) 1040 { 1041 public void action( Dsmlv2Container container ) throws XmlPullParserException 1042 { 1043 BatchRequest batchRequest = new BatchRequest(); 1044 1045 container.setBatchRequest( batchRequest ); 1046 1047 XmlPullParser xpp = container.getParser(); 1048 1049 String attributeValue; 1051 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1053 if ( attributeValue != null ) 1054 { 1055 batchRequest.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1056 } 1057 attributeValue = xpp.getAttributeValue( "", "processing" ); 1059 if ( attributeValue != null ) 1060 { 1061 if ( "sequential".equals( attributeValue ) ) 1062 { 1063 batchRequest.setProcessing( Processing.SEQUENTIAL ); 1064 } 1065 else if ( "parallel".equals( attributeValue ) ) 1066 { 1067 batchRequest.setProcessing( Processing.PARALLEL ); 1068 } 1069 else 1070 { 1071 throw new XmlPullParserException( "Unknown value for 'processing' attribute.", xpp, null ); 1072 } 1073 } 1074 else 1075 { 1076 batchRequest.setProcessing( Processing.SEQUENTIAL ); 1077 } 1078 attributeValue = xpp.getAttributeValue( "", "onError" ); 1080 if ( attributeValue != null ) 1081 { 1082 if ( "resume".equals( attributeValue ) ) 1083 { 1084 batchRequest.setOnError( OnError.RESUME ); 1085 } 1086 else if ( "exit".equals( attributeValue ) ) 1087 { 1088 batchRequest.setOnError( OnError.EXIT ); 1089 } 1090 else 1091 { 1092 throw new XmlPullParserException( "Unknown value for 'onError' attribute.", xpp, null ); 1093 } 1094 } 1095 else 1096 { 1097 batchRequest.setOnError( OnError.EXIT ); 1098 } 1099 attributeValue = xpp.getAttributeValue( "", "responseOrder" ); 1101 if ( attributeValue != null ) 1102 { 1103 if ( "sequential".equals( attributeValue ) ) 1104 { 1105 batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL ); 1106 } 1107 else if ( "unordered".equals( attributeValue ) ) 1108 { 1109 batchRequest.setResponseOrder( ResponseOrder.UNORDERED ); 1110 } 1111 else 1112 { 1113 throw new XmlPullParserException( "Unknown value for 'responseOrder' attribute.", xpp, null ); 1114 } 1115 } 1116 else 1117 { 1118 batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL ); 1119 } 1120 } 1121 }; 1122 1123 1126 private final GrammarAction abandonRequestCreation = new GrammarAction( "Create Abandon Request" ) 1127 { 1128 public void action( Dsmlv2Container container ) throws XmlPullParserException 1129 { 1130 AbandonRequest abandonRequest = new AbandonRequest(); 1131 container.getBatchRequest().addRequest( abandonRequest ); 1132 1133 XmlPullParser xpp = container.getParser(); 1134 1135 String attributeValue; 1137 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1139 if ( attributeValue != null ) 1140 { 1141 abandonRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1142 } 1143 else 1144 { 1145 if ( ParserUtils.isRequestIdNeeded( container ) ) 1146 { 1147 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1148 } 1149 } 1150 attributeValue = xpp.getAttributeValue( "", "abandonID" ); 1152 if ( attributeValue != null ) 1153 { 1154 try 1155 { 1156 abandonRequest.setAbandonedMessageId( Integer.parseInt( attributeValue ) ); 1157 } 1158 catch ( NumberFormatException e ) 1159 { 1160 throw new XmlPullParserException( "the given abandonID is not an integer", xpp, null ); 1161 } 1162 } 1163 else 1164 { 1165 throw new XmlPullParserException( "abandonID attribute is required", xpp, null ); 1166 } 1167 } 1168 }; 1169 1170 1173 private final GrammarAction addRequestCreation = new GrammarAction( "Create Add Request" ) 1174 { 1175 public void action( Dsmlv2Container container ) throws XmlPullParserException 1176 { 1177 AddRequest addRequest = new AddRequest(); 1178 container.getBatchRequest().addRequest( addRequest ); 1179 addRequest.initAttributes(); 1181 XmlPullParser xpp = container.getParser(); 1182 1183 String attributeValue; 1185 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1187 if ( attributeValue != null ) 1188 { 1189 addRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1190 } 1191 else 1192 { 1193 if ( ParserUtils.isRequestIdNeeded( container ) ) 1194 { 1195 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1196 } 1197 } 1198 attributeValue = xpp.getAttributeValue( "", "dn" ); 1200 if ( attributeValue != null ) 1201 { 1202 try 1203 { 1204 addRequest.setEntry( new LdapDN( attributeValue ) ); 1205 } 1206 catch ( InvalidNameException e ) 1207 { 1208 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1209 } 1210 } 1211 else 1212 { 1213 throw new XmlPullParserException( "dn attribute is required", xpp, null ); 1214 } 1215 } 1216 }; 1217 1218 1221 private final GrammarAction addRequestAddAttribute = new GrammarAction( "Add Attribute to Add Request" ) 1222 { 1223 public void action( Dsmlv2Container container ) throws XmlPullParserException 1224 { 1225 AddRequest addRequest = ( AddRequest ) container.getBatchRequest().getCurrentRequest(); 1226 1227 XmlPullParser xpp = container.getParser(); 1228 1229 String attributeValue; 1231 attributeValue = xpp.getAttributeValue( "", "name" ); 1233 if ( attributeValue != null ) 1234 { 1235 addRequest.addAttributeType( attributeValue ); 1236 } 1237 else 1238 { 1239 throw new XmlPullParserException( "name attribute is required", xpp, null ); 1240 } 1241 } 1242 }; 1243 1244 1247 private final GrammarAction addRequestAddValue = new GrammarAction( "Add Value to Attribute" ) 1248 { 1249 public void action( Dsmlv2Container container ) throws XmlPullParserException 1250 { 1251 AddRequest addRequest = ( AddRequest ) container.getBatchRequest().getCurrentRequest(); 1252 1253 XmlPullParser xpp = container.getParser(); 1254 try 1255 { 1256 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 1258 1259 String nextText = xpp.nextText(); 1261 if ( !nextText.equals( "" ) ) 1262 { 1263 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 1264 { 1265 addRequest.addAttributeValue( Base64.decode( nextText.trim().toCharArray() ) ); 1266 } 1267 else 1268 { 1269 addRequest.addAttributeValue( nextText.trim() ); 1270 } 1271 } 1272 } 1273 catch ( IOException e ) 1274 { 1275 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 1276 } 1277 } 1278 }; 1279 1280 1283 private final GrammarAction authRequestCreation = new GrammarAction( "Create Auth Request" ) 1284 { 1285 public void action( Dsmlv2Container container ) throws XmlPullParserException 1286 { 1287 BindRequest authRequest = new BindRequest(); 1288 container.getBatchRequest().addRequest( authRequest ); 1289 1290 SimpleAuthentication simpleAuthentication = new SimpleAuthentication(); 1291 simpleAuthentication.setSimple( StringTools.EMPTY_BYTES ); 1292 authRequest.setAuthentication( simpleAuthentication ); 1293 authRequest.setVersion( 3 ); 1294 1295 XmlPullParser xpp = container.getParser(); 1296 1297 String attributeValue; 1299 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1301 if ( attributeValue != null ) 1302 { 1303 authRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1304 } 1305 else 1306 { 1307 if ( ParserUtils.isRequestIdNeeded( container ) ) 1308 { 1309 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1310 } 1311 } 1312 attributeValue = xpp.getAttributeValue( "", "principal" ); 1314 if ( attributeValue != null ) 1315 { 1316 try 1317 { 1318 authRequest.setName( new LdapDN( attributeValue ) ); 1319 } 1320 catch ( InvalidNameException e ) 1321 { 1322 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1323 } 1324 } 1325 else 1326 { 1327 throw new XmlPullParserException( "principal attribute is required", xpp, null ); 1328 } 1329 } 1330 }; 1331 1332 1335 private final GrammarAction compareRequestCreation = new GrammarAction( "Create Compare Request" ) 1336 { 1337 public void action( Dsmlv2Container container ) throws XmlPullParserException 1338 { 1339 CompareRequest compareRequest = new CompareRequest(); 1340 container.getBatchRequest().addRequest( compareRequest ); 1341 1342 XmlPullParser xpp = container.getParser(); 1343 1344 String attributeValue; 1346 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1348 if ( attributeValue != null ) 1349 { 1350 compareRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1351 } 1352 else 1353 { 1354 if ( ParserUtils.isRequestIdNeeded( container ) ) 1355 { 1356 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1357 } 1358 } 1359 attributeValue = xpp.getAttributeValue( "", "dn" ); 1361 if ( attributeValue != null ) 1362 { 1363 try 1364 { 1365 compareRequest.setEntry( new LdapDN( attributeValue ) ); 1366 } 1367 catch ( InvalidNameException e ) 1368 { 1369 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1370 } 1371 } 1372 else 1373 { 1374 throw new XmlPullParserException( "dn attribute is required", xpp, null ); 1375 } 1376 } 1377 }; 1378 1379 1382 private final GrammarAction compareRequestAddAssertion = new GrammarAction( "Add Assertion to Compare Request" ) 1383 { 1384 public void action( Dsmlv2Container container ) throws XmlPullParserException 1385 { 1386 CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest(); 1387 1388 XmlPullParser xpp = container.getParser(); 1389 1390 String attributeValue; 1392 attributeValue = xpp.getAttributeValue( "", "name" ); 1394 if ( attributeValue != null ) 1395 { 1396 compareRequest.setAttributeDesc( attributeValue ); 1397 1398 } 1399 else 1400 { 1401 throw new XmlPullParserException( "name attribute is required", xpp, null ); 1402 } 1403 } 1404 }; 1405 1406 1409 private final GrammarAction compareRequestAddValue = new GrammarAction( "Add Value to Compare Request" ) 1410 { 1411 public void action( Dsmlv2Container container ) throws XmlPullParserException 1412 { 1413 CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest(); 1414 1415 XmlPullParser xpp = container.getParser(); 1416 try 1417 { 1418 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 1420 1421 String nextText = xpp.nextText(); 1423 if ( !nextText.equals( "" ) ) 1424 { 1425 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 1426 { 1427 compareRequest.setAssertionValue( Base64.decode( nextText.trim().toCharArray() ) ); 1428 } 1429 else 1430 { 1431 1432 compareRequest.setAssertionValue( nextText.trim() ); 1433 } 1434 } 1435 } 1436 catch ( IOException e ) 1437 { 1438 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 1439 } 1440 } 1441 }; 1442 1443 1446 private final GrammarAction delRequestCreation = new GrammarAction( "Create Del Request" ) 1447 { 1448 public void action( Dsmlv2Container container ) throws XmlPullParserException 1449 { 1450 DelRequest delRequest = new DelRequest(); 1451 container.getBatchRequest().addRequest( delRequest ); 1452 1453 XmlPullParser xpp = container.getParser(); 1454 1455 String attributeValue; 1457 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1459 if ( attributeValue != null ) 1460 { 1461 delRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1462 } 1463 else 1464 { 1465 if ( ParserUtils.isRequestIdNeeded( container ) ) 1466 { 1467 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1468 } 1469 } 1470 attributeValue = xpp.getAttributeValue( "", "dn" ); 1472 if ( attributeValue != null ) 1473 { 1474 try 1475 { 1476 delRequest.setEntry( new LdapDN( attributeValue ) ); 1477 } 1478 catch ( InvalidNameException e ) 1479 { 1480 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1481 } 1482 } 1483 else 1484 { 1485 throw new XmlPullParserException( "dn attribute is required", xpp, null ); 1486 } 1487 } 1488 }; 1489 1490 1493 private final GrammarAction extendedRequestCreation = new GrammarAction( "Create Extended Request" ) 1494 { 1495 public void action( Dsmlv2Container container ) throws XmlPullParserException 1496 { 1497 ExtendedRequest extendedRequest = new ExtendedRequest(); 1498 container.getBatchRequest().addRequest( extendedRequest ); 1499 1500 XmlPullParser xpp = container.getParser(); 1501 1502 String attributeValue; 1504 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1506 if ( attributeValue != null ) 1507 { 1508 extendedRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1509 } 1510 else 1511 { 1512 if ( ParserUtils.isRequestIdNeeded( container ) ) 1513 { 1514 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1515 } 1516 } 1517 } 1518 }; 1519 1520 1523 private final GrammarAction extendedRequestAddName = new GrammarAction( "Add Name to Extended Request" ) 1524 { 1525 public void action( Dsmlv2Container container ) throws XmlPullParserException 1526 { 1527 ExtendedRequest extendedRequest = ( ExtendedRequest ) container.getBatchRequest().getCurrentRequest(); 1528 1529 XmlPullParser xpp = container.getParser(); 1530 try 1531 { 1532 String nextText = xpp.nextText(); 1533 if ( nextText.equals( "" ) ) 1534 { 1535 throw new XmlPullParserException( "The request name can't be null", xpp, null ); 1536 } 1537 else 1538 { 1539 extendedRequest.setRequestName( new OID( nextText.trim() ) ); 1540 } 1541 } 1542 catch ( IOException e ) 1543 { 1544 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 1545 } 1546 catch ( DecoderException e ) 1547 { 1548 throw new XmlPullParserException( e.getMessage(), xpp, null ); 1549 } 1550 } 1551 }; 1552 1553 1556 private final GrammarAction extendedRequestAddValue = new GrammarAction( "Add Value to Extended Request" ) 1557 { 1558 public void action( Dsmlv2Container container ) throws XmlPullParserException 1559 { 1560 ExtendedRequest extendedRequest = ( ExtendedRequest ) container.getBatchRequest().getCurrentRequest(); 1561 1562 XmlPullParser xpp = container.getParser(); 1563 try 1564 { 1565 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 1567 1568 String nextText = xpp.nextText(); 1570 if ( !nextText.equals( "" ) ) 1571 { 1572 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 1573 { 1574 extendedRequest.setRequestValue( Base64.decode( nextText.trim().toCharArray() ) ); 1575 } 1576 else 1577 { 1578 extendedRequest.setRequestValue( nextText.trim().getBytes() ); 1579 } 1580 } 1581 } 1582 catch ( IOException e ) 1583 { 1584 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 1585 } 1586 } 1587 }; 1588 1589 1592 private final GrammarAction modDNRequestCreation = new GrammarAction( "Create Modify DN Request" ) 1593 { 1594 public void action( Dsmlv2Container container ) throws XmlPullParserException 1595 { 1596 ModifyDNRequest modifyDNRequest = new ModifyDNRequest(); 1597 container.getBatchRequest().addRequest( modifyDNRequest ); 1598 1599 XmlPullParser xpp = container.getParser(); 1600 1601 String attributeValue; 1603 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1605 if ( attributeValue != null ) 1606 { 1607 modifyDNRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1608 } 1609 else 1610 { 1611 if ( ParserUtils.isRequestIdNeeded( container ) ) 1612 { 1613 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1614 } 1615 } 1616 attributeValue = xpp.getAttributeValue( "", "dn" ); 1618 if ( attributeValue != null ) 1619 { 1620 try 1621 { 1622 modifyDNRequest.setEntry( new LdapDN( attributeValue ) ); 1623 } 1624 catch ( InvalidNameException e ) 1625 { 1626 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1627 } 1628 } 1629 else 1630 { 1631 throw new XmlPullParserException( "dn attribute is required", xpp, null ); 1632 } 1633 attributeValue = xpp.getAttributeValue( "", "newrdn" ); 1635 if ( attributeValue != null ) 1636 { 1637 try 1638 { 1639 modifyDNRequest.setNewRDN( new Rdn( attributeValue ) ); 1640 } 1641 catch ( InvalidNameException e ) 1642 { 1643 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1644 } 1645 } 1646 else 1647 { 1648 throw new XmlPullParserException( "newrdn attribute is required", xpp, null ); 1649 } 1650 attributeValue = xpp.getAttributeValue( "", "deleteoldrdn" ); 1652 if ( attributeValue != null ) 1653 { 1654 if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) ) 1655 { 1656 modifyDNRequest.setDeleteOldRDN( true ); 1657 } 1658 else if ( ( attributeValue.equals( "false" ) ) || ( attributeValue.equals( "0" ) ) ) 1659 { 1660 modifyDNRequest.setDeleteOldRDN( false ); 1661 } 1662 else 1663 { 1664 throw new XmlPullParserException( "Incorrect value for 'deleteoldrdn' attribute", xpp, null ); 1665 } 1666 } 1667 else 1668 { 1669 modifyDNRequest.setDeleteOldRDN( true ); 1670 } 1671 attributeValue = xpp.getAttributeValue( "", "newSuperior" ); 1673 if ( attributeValue != null ) 1674 { 1675 try 1676 { 1677 modifyDNRequest.setNewSuperior( new LdapDN( attributeValue ) ); 1678 } 1679 catch ( InvalidNameException e ) 1680 { 1681 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1682 } 1683 } 1684 } 1685 }; 1686 1687 1690 private final GrammarAction modifyRequestCreation = new GrammarAction( "Create Modify Request" ) 1691 { 1692 public void action( Dsmlv2Container container ) throws XmlPullParserException 1693 { 1694 ModifyRequest modifyRequest = new ModifyRequest(); 1695 container.getBatchRequest().addRequest( modifyRequest ); 1696 1697 modifyRequest.initModifications(); 1698 1699 XmlPullParser xpp = container.getParser(); 1700 1701 String attributeValue; 1703 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1705 if ( attributeValue != null ) 1706 { 1707 modifyRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1708 } 1709 else 1710 { 1711 if ( ParserUtils.isRequestIdNeeded( container ) ) 1712 { 1713 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1714 } 1715 } 1716 attributeValue = xpp.getAttributeValue( "", "dn" ); 1718 if ( attributeValue != null ) 1719 { 1720 try 1721 { 1722 modifyRequest.setObject( new LdapDN( attributeValue ) ); 1723 } 1724 catch ( InvalidNameException e ) 1725 { 1726 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1727 } 1728 } 1729 else 1730 { 1731 throw new XmlPullParserException( "dn attribute is required", xpp, null ); 1732 } 1733 } 1734 }; 1735 1736 1739 private final GrammarAction modifyRequestAddModification = new GrammarAction( "Adds Modification to Modify Request" ) 1740 { 1741 public void action( Dsmlv2Container container ) throws XmlPullParserException 1742 { 1743 ModifyRequest modifyRequest = ( ModifyRequest ) container.getBatchRequest().getCurrentRequest(); 1744 1745 XmlPullParser xpp = container.getParser(); 1746 1747 String attributeValue; 1749 attributeValue = xpp.getAttributeValue( "", "operation" ); 1751 if ( attributeValue != null ) 1752 { 1753 if ( "add".equals( attributeValue ) ) 1754 { 1755 modifyRequest.setCurrentOperation( LdapConstants.OPERATION_ADD ); 1756 } 1757 else if ( "delete".equals( attributeValue ) ) 1758 { 1759 modifyRequest.setCurrentOperation( LdapConstants.OPERATION_DELETE ); 1760 } 1761 else if ( "replace".equals( attributeValue ) ) 1762 { 1763 modifyRequest.setCurrentOperation( LdapConstants.OPERATION_REPLACE ); 1764 } 1765 else 1766 { 1767 throw new XmlPullParserException( 1768 "unknown operation. Operation can be 'add', 'delete' or 'replace'.", xpp, null ); 1769 } 1770 } 1771 else 1772 { 1773 throw new XmlPullParserException( "operation attribute is required", xpp, null ); 1774 } 1775 attributeValue = xpp.getAttributeValue( "", "name" ); 1777 if ( attributeValue != null ) 1778 { 1779 modifyRequest.addAttributeTypeAndValues( attributeValue ); 1780 } 1781 else 1782 { 1783 throw new XmlPullParserException( "name attribute is required", xpp, null ); 1784 } 1785 } 1786 }; 1787 1788 1791 private final GrammarAction modifyRequestAddValue = new GrammarAction( 1792 "Add Value to Modification of Modify Request" ) 1793 { 1794 public void action( Dsmlv2Container container ) throws XmlPullParserException 1795 { 1796 ModifyRequest modifyRequest = ( ModifyRequest ) container.getBatchRequest().getCurrentRequest(); 1797 1798 XmlPullParser xpp = container.getParser(); 1799 try 1800 { 1801 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 1803 1804 String nextText = xpp.nextText(); 1806 1808 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 1809 { 1810 modifyRequest.addAttributeValue( Base64.decode( nextText.trim().toCharArray() ) ); 1811 } 1812 else 1813 { 1814 modifyRequest.addAttributeValue( nextText.trim() ); 1815 } 1816 } 1817 catch ( IOException e ) 1818 { 1819 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 1820 } 1821 } 1822 }; 1823 1824 1827 private final GrammarAction searchRequestCreation = new GrammarAction( "Create Search Request" ) 1828 { 1829 public void action( Dsmlv2Container container ) throws XmlPullParserException 1830 { 1831 SearchRequest searchRequest = new SearchRequest(); 1832 container.getBatchRequest().addRequest( searchRequest ); 1833 1834 XmlPullParser xpp = container.getParser(); 1835 1836 String attributeValue; 1838 attributeValue = xpp.getAttributeValue( "", "requestID" ); 1840 if ( attributeValue != null ) 1841 { 1842 searchRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); 1843 } 1844 else 1845 { 1846 if ( ParserUtils.isRequestIdNeeded( container ) ) 1847 { 1848 throw new XmlPullParserException( "requestID attribute is required", xpp, null ); 1849 } 1850 } 1851 attributeValue = xpp.getAttributeValue( "", "dn" ); 1853 if ( attributeValue != null ) 1854 { 1855 try 1856 { 1857 searchRequest.setBaseObject( new LdapDN( attributeValue ) ); 1858 } 1859 catch ( InvalidNameException e ) 1860 { 1861 throw new XmlPullParserException( "" + e.getMessage(), xpp, null ); 1862 } 1863 } 1864 else 1865 { 1866 throw new XmlPullParserException( "dn attribute is required", xpp, null ); 1867 } 1868 attributeValue = xpp.getAttributeValue( "", "scope" ); 1870 if ( attributeValue != null ) 1871 { 1872 if ( "baseObject".equals( attributeValue ) ) 1873 { 1874 searchRequest.setScope( ScopeEnum.BASE_OBJECT ); 1875 } 1876 else if ( "singleLevel".equals( attributeValue ) ) 1877 { 1878 searchRequest.setScope( ScopeEnum.SINGLE_LEVEL ); 1879 } 1880 else if ( "wholeSubtree".equals( attributeValue ) ) 1881 { 1882 searchRequest.setScope( ScopeEnum.WHOLE_SUBTREE ); 1883 } 1884 else 1885 { 1886 throw new XmlPullParserException( 1887 "unknown scope. Scope must be 'baseObject', 'singleLevel' or 'wholeSubtree'.", xpp, null ); 1888 } 1889 } 1890 else 1891 { 1892 throw new XmlPullParserException( "scope attribute is required", xpp, null ); 1893 } 1894 attributeValue = xpp.getAttributeValue( "", "derefAliases" ); 1896 if ( attributeValue != null ) 1897 { 1898 if ( "neverDerefAliases".equals( attributeValue ) ) 1899 { 1900 searchRequest.setDerefAliases( LdapConstants.NEVER_DEREF_ALIASES ); 1901 } 1902 else if ( "derefInSearching".equals( attributeValue ) ) 1903 { 1904 searchRequest.setDerefAliases( LdapConstants.DEREF_IN_SEARCHING ); 1905 } 1906 else if ( "derefFindingBaseObj".equals( attributeValue ) ) 1907 { 1908 searchRequest.setDerefAliases( LdapConstants.DEREF_FINDING_BASE_OBJ ); 1909 } 1910 else if ( "derefAlways".equals( attributeValue ) ) 1911 { 1912 searchRequest.setDerefAliases( LdapConstants.DEREF_ALWAYS ); 1913 } 1914 else 1915 { 1916 throw new XmlPullParserException( 1917 "unknown derefAliases value. derefAliases must be 'neverDerefAliases', 'derefInSearching', 'derefFindingBaseObj' or 'derefAlways'.", 1918 xpp, null ); 1919 } 1920 } 1921 else 1922 { 1923 throw new XmlPullParserException( "derefAliases attribute is required", xpp, null ); 1924 } 1925 attributeValue = xpp.getAttributeValue( "", "sizeLimit" ); 1927 if ( attributeValue != null ) 1928 { 1929 try 1930 { 1931 searchRequest.setSizeLimit( Integer.parseInt( attributeValue ) ); 1932 } 1933 catch ( NumberFormatException e ) 1934 { 1935 throw new XmlPullParserException( "the given sizeLimit is not an integer", xpp, null ); 1936 } 1937 } 1938 else 1939 { 1940 searchRequest.setSizeLimit( 0 ); 1941 } 1942 attributeValue = xpp.getAttributeValue( "", "timeLimit" ); 1944 if ( attributeValue != null ) 1945 { 1946 try 1947 { 1948 searchRequest.setTimeLimit( Integer.parseInt( attributeValue ) ); 1949 } 1950 catch ( NumberFormatException e ) 1951 { 1952 throw new XmlPullParserException( "the given timeLimit is not an integer", xpp, null ); 1953 } 1954 } 1955 else 1956 { 1957 searchRequest.setTimeLimit( 0 ); 1958 } 1959 attributeValue = xpp.getAttributeValue( "", "typesOnly" ); 1961 if ( attributeValue != null ) 1962 { 1963 if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) ) 1964 { 1965 searchRequest.setTypesOnly( true ); 1966 } 1967 else if ( ( attributeValue.equals( "false" ) ) || ( attributeValue.equals( "0" ) ) ) 1968 { 1969 searchRequest.setTypesOnly( false ); 1970 } 1971 else 1972 { 1973 throw new XmlPullParserException( "typesOnly must be a boolean ('true' or 'false').", xpp, null ); 1974 } 1975 } 1976 else 1977 { 1978 searchRequest.setTypesOnly( false ); 1979 } 1980 } 1981 }; 1982 1983 1986 private final GrammarAction searchRequestAddAttribute = new GrammarAction( 1987 "Add Value to Modification of Modify Request" ) 1988 { 1989 public void action( Dsmlv2Container container ) throws XmlPullParserException 1990 { 1991 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 1992 1993 XmlPullParser xpp = container.getParser(); 1994 1995 String attributeValue; 1997 attributeValue = xpp.getAttributeValue( "", "name" ); 1999 if ( attributeValue != null ) 2000 { 2001 searchRequest.addAttribute( attributeValue ); 2002 } 2003 else 2004 { 2005 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2006 } 2007 } 2008 }; 2009 2010 2013 private final GrammarAction substringsFilterCreation = new GrammarAction( "Create Substring Filter" ) 2014 { 2015 public void action( Dsmlv2Container container ) throws XmlPullParserException 2016 { 2017 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2018 2019 XmlPullParser xpp = container.getParser(); 2020 2021 SubstringFilter filter = new SubstringFilter(); 2022 2023 try 2025 { 2026 searchRequest.addCurrentFilter( filter ); 2027 } 2028 catch ( DecoderException e ) 2029 { 2030 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2031 } 2032 searchRequest.setTerminalFilter( filter ); 2033 2034 String attributeValue; 2036 attributeValue = xpp.getAttributeValue( "", "name" ); 2038 if ( attributeValue != null ) 2039 { 2040 filter.setType( attributeValue ); 2041 } 2042 else 2043 { 2044 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2045 } 2046 } 2047 }; 2048 2049 2052 private final GrammarAction substringsFilterSetInitial = new GrammarAction( "Set Initial value to Substring Filter" ) 2053 { 2054 public void action( Dsmlv2Container container ) throws XmlPullParserException 2055 { 2056 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2057 SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter(); 2058 2059 XmlPullParser xpp = container.getParser(); 2060 try 2061 { 2062 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 2064 2065 String nextText = xpp.nextText(); 2067 if ( !nextText.equals( "" ) ) 2068 { 2069 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 2070 { 2071 substringFilter 2072 .setInitialSubstrings( new String ( Base64.decode( nextText.trim().toCharArray() ) ) ); 2073 } 2074 else 2075 { 2076 substringFilter.setInitialSubstrings( nextText.trim() ); 2077 } 2078 } 2079 } 2080 catch ( IOException e ) 2081 { 2082 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 2083 } 2084 } 2085 }; 2086 2087 2090 private final GrammarAction substringsFilterAddAny = new GrammarAction( "Add Any value to Substring Filter" ) 2091 { 2092 public void action( Dsmlv2Container container ) throws XmlPullParserException 2093 { 2094 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2095 SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter(); 2096 2097 XmlPullParser xpp = container.getParser(); 2098 try 2099 { 2100 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 2102 2103 String nextText = xpp.nextText(); 2105 if ( !nextText.equals( "" ) ) 2106 { 2107 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 2108 { 2109 substringFilter.addAnySubstrings( new String ( Base64.decode( nextText.trim().toCharArray() ) ) ); 2110 } 2111 else 2112 { 2113 substringFilter.addAnySubstrings( nextText.trim() ); 2114 } 2115 } 2116 } 2117 catch ( IOException e ) 2118 { 2119 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 2120 } 2121 } 2122 }; 2123 2124 2127 private final GrammarAction substringsFilterSetFinal = new GrammarAction( "Set Final value to Substring Filter" ) 2128 { 2129 public void action( Dsmlv2Container container ) throws XmlPullParserException 2130 { 2131 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2132 SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter(); 2133 2134 XmlPullParser xpp = container.getParser(); 2135 try 2136 { 2137 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 2139 2140 String nextText = xpp.nextText(); 2142 if ( !nextText.equals( "" ) ) 2143 { 2144 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 2145 { 2146 substringFilter 2147 .setFinalSubstrings( new String ( Base64.decode( nextText.trim().toCharArray() ) ) ); 2148 } 2149 else 2150 { 2151 substringFilter.setFinalSubstrings( nextText.trim() ); 2152 } 2153 } 2154 } 2155 catch ( IOException e ) 2156 { 2157 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 2158 } 2159 } 2160 }; 2161 2162 2165 private final GrammarAction substringsFilterClose = new GrammarAction( "Close Substring Filter" ) 2166 { 2167 public void action( Dsmlv2Container container ) throws XmlPullParserException 2168 { 2169 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2170 2171 searchRequest.setTerminalFilter( null ); 2172 } 2173 }; 2174 2175 2178 private final GrammarAction andFilterCreation = new GrammarAction( "Create And Filter" ) 2179 { 2180 public void action( Dsmlv2Container container ) throws XmlPullParserException 2181 { 2182 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2183 2184 XmlPullParser xpp = container.getParser(); 2185 2186 AndFilter filter = new AndFilter(); 2187 2188 try 2190 { 2191 searchRequest.addCurrentFilter( filter ); 2192 } 2193 catch ( DecoderException e ) 2194 { 2195 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2196 } 2197 } 2198 }; 2199 2200 2203 private final GrammarAction connectorFilterClose = new GrammarAction( "Close Connector Filter" ) 2204 { 2205 public void action( Dsmlv2Container container ) throws XmlPullParserException 2206 { 2207 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2208 2209 Asn1Object parent = searchRequest.getCurrentFilter().getParent(); 2210 2211 if ( parent instanceof Filter ) 2212 { 2213 Filter filter = ( Filter ) parent; 2214 2215 searchRequest.setCurrentFilter( filter ); 2216 } 2217 else 2218 { 2219 searchRequest.setCurrentFilter( null ); 2220 } 2221 2222 } 2223 }; 2224 2225 2228 private final GrammarAction orFilterCreation = new GrammarAction( "Create Or Filter" ) 2229 { 2230 public void action( Dsmlv2Container container ) throws XmlPullParserException 2231 { 2232 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2233 2234 XmlPullParser xpp = container.getParser(); 2235 2236 OrFilter filter = new OrFilter(); 2237 2238 try 2240 { 2241 searchRequest.addCurrentFilter( filter ); 2242 } 2243 catch ( DecoderException e ) 2244 { 2245 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2246 } 2247 } 2248 }; 2249 2250 2253 private final GrammarAction notFilterCreation = new GrammarAction( "Create Not Filter" ) 2254 { 2255 public void action( Dsmlv2Container container ) throws XmlPullParserException 2256 { 2257 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2258 2259 XmlPullParser xpp = container.getParser(); 2260 2261 NotFilter filter = new NotFilter(); 2262 2263 try 2265 { 2266 searchRequest.addCurrentFilter( filter ); 2267 } 2268 catch ( DecoderException e ) 2269 { 2270 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2271 } 2272 } 2273 }; 2274 2275 2278 private final GrammarAction equalityMatchFilterCreation = new GrammarAction( "Create Equality Match Filter" ) 2279 { 2280 public void action( Dsmlv2Container container ) throws XmlPullParserException 2281 { 2282 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2283 2284 XmlPullParser xpp = container.getParser(); 2285 2286 AttributeValueAssertion assertion = new AttributeValueAssertion(); 2287 2288 String attributeValue; 2290 attributeValue = xpp.getAttributeValue( "", "name" ); 2292 if ( attributeValue != null ) 2293 { 2294 assertion.setAttributeDesc( new String ( attributeValue.getBytes() ) ); 2295 } 2296 else 2297 { 2298 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2299 } 2300 2301 AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( 2302 LdapConstants.EQUALITY_MATCH_FILTER ); 2303 2304 filter.setAssertion( assertion ); 2305 2306 try 2308 { 2309 searchRequest.addCurrentFilter( filter ); 2310 } 2311 catch ( DecoderException e ) 2312 { 2313 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2314 } 2315 searchRequest.setTerminalFilter( filter ); 2316 } 2317 }; 2318 2319 2322 private final GrammarAction greaterOrEqualFilterCreation = new GrammarAction( "Create Greater Or Equal Filter" ) 2323 { 2324 public void action( Dsmlv2Container container ) throws XmlPullParserException 2325 { 2326 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2327 2328 XmlPullParser xpp = container.getParser(); 2329 2330 AttributeValueAssertion assertion = new AttributeValueAssertion(); 2331 2332 String attributeValue; 2334 attributeValue = xpp.getAttributeValue( "", "name" ); 2336 if ( attributeValue != null ) 2337 { 2338 assertion.setAttributeDesc( new String ( attributeValue.getBytes() ) ); 2339 } 2340 else 2341 { 2342 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2343 } 2344 2345 AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( 2346 LdapConstants.GREATER_OR_EQUAL_FILTER ); 2347 2348 filter.setAssertion( assertion ); 2349 2350 try 2352 { 2353 searchRequest.addCurrentFilter( filter ); 2354 } 2355 catch ( DecoderException e ) 2356 { 2357 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2358 } 2359 searchRequest.setTerminalFilter( filter ); 2360 } 2361 }; 2362 2363 2366 private final GrammarAction lessOrEqualFilterCreation = new GrammarAction( "Create Less Or Equal Filter" ) 2367 { 2368 public void action( Dsmlv2Container container ) throws XmlPullParserException 2369 { 2370 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2371 2372 XmlPullParser xpp = container.getParser(); 2373 2374 AttributeValueAssertion assertion = new AttributeValueAssertion(); 2375 2376 String attributeValue; 2378 attributeValue = xpp.getAttributeValue( "", "name" ); 2380 if ( attributeValue != null ) 2381 { 2382 assertion.setAttributeDesc( new String ( attributeValue.getBytes() ) ); 2383 } 2384 else 2385 { 2386 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2387 } 2388 2389 AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( 2390 LdapConstants.LESS_OR_EQUAL_FILTER ); 2391 2392 filter.setAssertion( assertion ); 2393 2394 try 2396 { 2397 searchRequest.addCurrentFilter( filter ); 2398 } 2399 catch ( DecoderException e ) 2400 { 2401 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2402 } 2403 searchRequest.setTerminalFilter( filter ); 2404 } 2405 }; 2406 2407 2410 private final GrammarAction approxMatchFilterCreation = new GrammarAction( "Create Approx Match Filter" ) 2411 { 2412 public void action( Dsmlv2Container container ) throws XmlPullParserException 2413 { 2414 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2415 2416 XmlPullParser xpp = container.getParser(); 2417 2418 AttributeValueAssertion assertion = new AttributeValueAssertion(); 2419 2420 String attributeValue; 2422 attributeValue = xpp.getAttributeValue( "", "name" ); 2424 if ( attributeValue != null ) 2425 { 2426 assertion.setAttributeDesc( new String ( attributeValue.getBytes() ) ); 2427 } 2428 else 2429 { 2430 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2431 } 2432 2433 AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( LdapConstants.APPROX_MATCH_FILTER ); 2434 2435 filter.setAssertion( assertion ); 2436 2437 try 2439 { 2440 searchRequest.addCurrentFilter( filter ); 2441 } 2442 catch ( DecoderException e ) 2443 { 2444 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2445 } 2446 2447 searchRequest.setTerminalFilter( filter ); 2448 } 2449 }; 2450 2451 2454 private final GrammarAction filterAddValue = new GrammarAction( "Adds Value to Filter" ) 2455 { 2456 public void action( Dsmlv2Container container ) throws XmlPullParserException 2457 { 2458 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2459 AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) searchRequest.getTerminalFilter(); 2460 AttributeValueAssertion assertion = filter.getAssertion(); 2461 2462 XmlPullParser xpp = container.getParser(); 2463 try 2464 { 2465 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 2467 2468 String nextText = xpp.nextText(); 2470 if ( !nextText.equals( "" ) ) 2471 { 2472 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 2473 { 2474 assertion.setAssertionValue( Base64.decode( nextText.trim().toCharArray() ) ); 2475 } 2476 else 2477 { 2478 assertion.setAssertionValue( nextText.trim() ); 2479 } 2480 } 2481 } 2482 catch ( IOException e ) 2483 { 2484 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 2485 } 2486 } 2487 }; 2488 2489 2492 private final GrammarAction presentFilterCreation = new GrammarAction( "Create Present Filter" ) 2493 { 2494 public void action( Dsmlv2Container container ) throws XmlPullParserException 2495 { 2496 PresentFilter presentFilter = new PresentFilter(); 2497 2498 XmlPullParser xpp = container.getParser(); 2499 2500 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2502 try 2503 { 2504 searchRequest.addCurrentFilter( presentFilter ); 2505 } 2506 catch ( DecoderException e ) 2507 { 2508 throw new XmlPullParserException( e.getMessage(), xpp, null ); 2509 } 2510 2511 String attributeValue; 2513 attributeValue = xpp.getAttributeValue( "", "name" ); 2515 if ( attributeValue != null ) 2516 { 2517 presentFilter.setAttributeDescription( new String ( attributeValue.getBytes() ) ); 2518 } 2519 else 2520 { 2521 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2522 } 2523 } 2524 }; 2525 2526 2529 private final GrammarAction extensibleMatchFilterCreation = new GrammarAction( "Create Extensible Match Filter" ) 2530 { 2531 public void action( Dsmlv2Container container ) throws XmlPullParserException 2532 { 2533 ExtensibleMatchFilter extensibleMatchFilter = new ExtensibleMatchFilter(); 2534 2535 XmlPullParser xpp = container.getParser(); 2536 2537 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2539 try 2540 { 2541 searchRequest.addCurrentFilter( extensibleMatchFilter ); 2542 } 2543 catch ( DecoderException e ) 2544 { 2545 throw new XmlPullParserException( "name attribute is required", xpp, null ); 2546 } 2547 searchRequest.setTerminalFilter( extensibleMatchFilter ); 2548 2549 String attributeValue; 2551 attributeValue = xpp.getAttributeValue( "", "dnAttributes" ); 2553 if ( attributeValue != null ) 2554 { 2555 if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) ) 2556 { 2557 extensibleMatchFilter.setDnAttributes( true ); 2558 } 2559 else if ( ( attributeValue.equals( "false" ) ) || ( attributeValue.equals( "0" ) ) ) 2560 { 2561 extensibleMatchFilter.setDnAttributes( false ); 2562 } 2563 else 2564 { 2565 throw new XmlPullParserException( "dnAttributes must be a boolean ('true' or 'false').", xpp, null ); 2566 } 2567 } 2568 else 2569 { 2570 extensibleMatchFilter.setDnAttributes( false ); 2571 } 2572 attributeValue = xpp.getAttributeValue( "", "matchingRule" ); 2574 if ( attributeValue != null ) 2575 { 2576 extensibleMatchFilter.setMatchingRule( attributeValue ); 2577 } 2578 attributeValue = xpp.getAttributeValue( "", "name" ); 2580 if ( attributeValue != null ) 2581 { 2582 extensibleMatchFilter.setType( attributeValue ); 2583 } 2584 } 2585 }; 2586 2587 2590 private final GrammarAction extensibleMatchAddValue = new GrammarAction( "Adds Value to Extensible MatchFilter" ) 2591 { 2592 public void action( Dsmlv2Container container ) throws XmlPullParserException 2593 { 2594 SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); 2595 ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter(); 2596 2597 XmlPullParser xpp = container.getParser(); 2598 try 2599 { 2600 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 2602 2603 String nextText = xpp.nextText(); 2605 if ( !nextText.equals( "" ) ) 2606 { 2607 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 2608 { 2609 filter.setMatchValue( Base64.decode( nextText.trim().toCharArray() ) ); 2610 } 2611 else 2612 { 2613 filter.setMatchValue( nextText.trim() ); 2614 } 2615 } 2616 } 2617 catch ( IOException e ) 2618 { 2619 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 2620 } 2621 } 2622 }; 2623 2624 2627 private final GrammarAction controlCreation = new GrammarAction( "Create Control" ) 2628 { 2629 public void action( Dsmlv2Container container ) throws XmlPullParserException 2630 { 2631 Control control = new Control(); 2632 container.getBatchRequest().getCurrentRequest().addControl( control ); 2633 2634 XmlPullParser xpp = container.getParser(); 2635 2636 String attributeValue; 2638 attributeValue = xpp.getAttributeValue( "", "type" ); 2640 if ( attributeValue != null ) 2641 { 2642 if ( !OID.isOID( attributeValue ) ) 2643 { 2644 throw new XmlPullParserException( "Incorrect value for 'type' attribute. This is not an OID.", xpp, 2645 null ); 2646 } 2647 control.setControlType( attributeValue ); 2648 } 2649 else 2650 { 2651 throw new XmlPullParserException( "type attribute is required", xpp, null ); 2652 } 2653 attributeValue = xpp.getAttributeValue( "", "criticality" ); 2655 if ( attributeValue != null ) 2656 { 2657 if ( attributeValue.equals( "true" ) ) 2658 { 2659 control.setCriticality( true ); 2660 } 2661 else if ( attributeValue.equals( "false" ) ) 2662 { 2663 control.setCriticality( false ); 2664 } 2665 else 2666 { 2667 throw new XmlPullParserException( "Incorrect value for 'criticality' attribute", xpp, null ); 2668 } 2669 } 2670 } 2671 }; 2672 2673 2676 private final GrammarAction controlValueCreation = new GrammarAction( "Add ControlValue to Control" ) 2677 { 2678 public void action( Dsmlv2Container container ) throws XmlPullParserException 2679 { 2680 Control control = container.getBatchRequest().getCurrentRequest().getCurrentControl(); 2681 2682 XmlPullParser xpp = container.getParser(); 2683 try 2684 { 2685 String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); 2687 2688 String nextText = xpp.nextText(); 2690 if ( !nextText.equals( "" ) ) 2691 { 2692 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) 2693 { 2694 control.setControlValue( Base64.decode( nextText.trim().toCharArray() ) ); 2695 } 2696 else 2697 { 2698 control.setControlValue( nextText.trim() ); 2699 } 2700 } 2701 } 2702 catch ( IOException e ) 2703 { 2704 throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null ); 2705 } 2706 } 2707 }; 2708 2709 2710 2716 public static Dsmlv2Grammar getInstance() 2717 { 2718 return instance; 2719 } 2720} 2721 | Popular Tags |