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 ); } } } }
LdapSchemaExceptionCodes.OC_CYCLE_CLASS_HIERARCHY ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( superior ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); return;
LdapSchemaExceptionCodes.OC_CYCLE_CLASS_HIERARCHY ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( superior ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); return;
LdapSchemaExceptionCodes.OC_CYCLE_CLASS_HIERARCHY ); ldapSchemaException.setSourceObject( objectClass ); ldapSchemaException.setOtherObject( superior ); errorHandler.handle( LOG, ldapSchemaException.getMessage(), ldapSchemaException ); return;