private void resolve( ObjectClass objectClass ) { // This set is used to avoid having more than one error // for an ObjectClass. It's mandatory when processing // the Superiors, as they may be broken and referenced more than once. Set<String> processed = new HashSet<>(); // Store the ObjectClass itself in the processed, to avoid cycle processed.add( objectClass.getOid() ); // Call the recursive method, as we may have superiors to deal with resolveRecursive( objectClass, processed ); // Check that the MAY and MUST AT are consistent (no AT in MAY and in MUST // in one of its superior List<AttributeType> musts = getMustRecursive( new ArrayList<AttributeType>(), new HashSet<ObjectClass>(), objectClass ); if ( musts != null ) { for ( AttributeType may : objectClass.getMayAttributeTypes() ) { if ( musts.contains( may ) ) { // This is not allowed. LdapSchemaException ldapSchemaException = new LdapSchemaException( LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY_AND_MUST ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( may ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); } } } }
private void resolve( ObjectClass objectClass ) { // This set is used to avoid having more than one error // for an ObjectClass. It's mandatory when processing // the Superiors, as they may be broken and referenced more than once. Set<String> processed = new HashSet<>(); // Store the ObjectClass itself in the processed, to avoid cycle processed.add( objectClass.getOid() ); // Call the recursive method, as we may have superiors to deal with resolveRecursive( objectClass, processed ); // Check that the MAY and MUST AT are consistent (no AT in MAY and in MUST // in one of its superior List<AttributeType> musts = getMustRecursive( new ArrayList<AttributeType>(), new HashSet<ObjectClass>(), objectClass ); if ( musts != null ) { for ( AttributeType may : objectClass.getMayAttributeTypes() ) { if ( musts.contains( may ) ) { // This is not allowed. LdapSchemaException ldapSchemaException = new LdapSchemaException( LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY_AND_MUST ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( may ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); } } } }
private void resolve( ObjectClass objectClass ) { // This set is used to avoid having more than one error // for an ObjectClass. It's mandatory when processing // the Superiors, as they may be broken and referenced more than once. Set<String> processed = new HashSet<>(); // Store the ObjectClass itself in the processed, to avoid cycle processed.add( objectClass.getOid() ); // Call the recursive method, as we may have superiors to deal with resolveRecursive( objectClass, processed ); // Check that the MAY and MUST AT are consistent (no AT in MAY and in MUST // in one of its superior List<AttributeType> musts = getMustRecursive( new ArrayList<AttributeType>(), new HashSet<ObjectClass>(), objectClass ); if ( musts != null ) { for ( AttributeType may : objectClass.getMayAttributeTypes() ) { if ( musts.contains( may ) ) { // This is not allowed. LdapSchemaException ldapSchemaException = new LdapSchemaException( LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY_AND_MUST ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( may ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); } } } }
/** * {@inheritDoc} */ public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException { // Here, we have to inject the decoded filter into the SearchRequest SearchRequestDecorator searchRequestDecorator = container.getMessage(); SearchRequest searchRequest = searchRequestDecorator.getDecorated(); try { searchRequest.setFilter( searchRequestDecorator.getFilterNode() ); } catch ( LdapSchemaException lse ) { throw new DecoderException( lse.getMessage(), lse ); } // We can have an END transition container.setGrammarEndAllowed( true ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05158_INITIALIZE_ATT_DESC_LIST ) ); } } }
/** * {@inheritDoc} */ public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException { // Here, we have to inject the decoded filter into the SearchRequest SearchRequestDecorator searchRequestDecorator = container.getMessage(); SearchRequest searchRequest = searchRequestDecorator.getDecorated(); try { searchRequest.setFilter( searchRequestDecorator.getFilterNode() ); } catch ( LdapSchemaException lse ) { throw new DecoderException( lse.getMessage(), lse ); } // We can have an END transition container.setGrammarEndAllowed( true ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05158_INITIALIZE_ATT_DESC_LIST ) ); } } }
/** * {@inheritDoc} */ public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException { // Here, we have to inject the decoded filter into the SearchRequest SearchRequestDecorator searchRequestDecorator = container.getMessage(); SearchRequest searchRequest = searchRequestDecorator.getDecorated(); try { searchRequest.setFilter( searchRequestDecorator.getFilterNode() ); } catch ( LdapSchemaException lse ) { throw new DecoderException( lse.getMessage(), lse ); } // We can have an END transition container.setGrammarEndAllowed( true ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05158_INITIALIZE_ATT_DESC_LIST ) ); } } }
ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setRelatedId( superiorOid ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( superior ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); return;
ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setRelatedId( superiorOid ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( superior ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); return;
ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setRelatedId( superiorOid ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( superior ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); return;
ne ); ldapSchemaException.setSourceObject( matchingRule ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); LdapSchemaExceptionCodes.OID_ALREADY_REGISTERED, I18n.err( I18n.ERR_13748_MATCHING_RULE_NO_SYNTAX, matchingRule.getOid() ) ); ldapSchemaException.setSourceObject( matchingRule ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException );
ne ); ldapSchemaException.setSourceObject( matchingRule ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); LdapSchemaExceptionCodes.OID_ALREADY_REGISTERED, I18n.err( I18n.ERR_13748_MATCHING_RULE_NO_SYNTAX, matchingRule.getOid() ) ); ldapSchemaException.setSourceObject( matchingRule ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException );
ne ); ldapSchemaException.setSourceObject( matchingRule ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); LdapSchemaExceptionCodes.OID_ALREADY_REGISTERED, I18n.err( I18n.ERR_13748_MATCHING_RULE_NO_SYNTAX, matchingRule.getOid() ) ); ldapSchemaException.setSourceObject( matchingRule ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException );
schemaObject.getOid() ) ); ldapSchemaException.setSourceObject( schemaObject ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); ldapSchemaException.setSourceObject( schemaObject ); ldapSchemaException.setRelatedId( copy.getSchemaName() ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException );
schemaObject.getOid() ) ); ldapSchemaException.setSourceObject( schemaObject ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); ldapSchemaException.setSourceObject( schemaObject ); ldapSchemaException.setRelatedId( copy.getSchemaName() ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException );
schemaObject.getOid() ) ); ldapSchemaException.setSourceObject( schemaObject ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); ldapSchemaException.setSourceObject( schemaObject ); ldapSchemaException.setRelatedId( copy.getSchemaName() ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException );