/** * Creates an instance of AdministrativeRole * * @param role The role's name */ AdministrativeRole( String role ) { this.role = Strings.toLowerCaseAscii( Strings.trim( role ) ); }
/** * Creates an instance of AdministrativeRole * * @param role The role's name */ AdministrativeRole( String role ) { this.role = Strings.toLowerCaseAscii( Strings.trim( role ) ); }
/** * Creates an instance of AdministrativeRole * * @param role The role's name */ AdministrativeRole( String role ) { this.role = Strings.toLowerCaseAscii( Strings.trim( role ) ); }
/** * Add a new option to the option set for this attributeType. * * @param option the option to add */ public void addOption( String option ) { if ( options == null ) { options = new HashSet<>(); } options.add( Strings.toLowerCaseAscii( Strings.trim( option ) ) ); }
/** * Tells if a given role is a valid administrative role. We check the lower cased * and trimmed value, and also the OID value. */ private boolean isValidRole( String role ) { return ROLES.contains( Strings.toLowerCaseAscii( Strings.trim( role ) ) ); }
/** * Add a new option to the option set for this attributeType. * * @param option the option to add */ public void addOption( String option ) { if ( options == null ) { options = new HashSet<>(); } options.add( Strings.toLowerCaseAscii( Strings.trim( option ) ) ); }
/** * Add a new option to the option set for this attributeType. * * @param option the option to add */ public void addOption( String option ) { if ( options == null ) { options = new HashSet<>(); } options.add( Strings.toLowerCaseAscii( Strings.trim( option ) ) ); }
/** * @param option the option to check * @return <code>true</code> if the attributeType has the given option */ public boolean hasOption( String option ) { if ( hasOption() ) { return options.contains( Strings.toLowerCaseAscii( Strings.trim( option ) ) ); } else { return false; } }
/** * @param option the option to check * @return <code>true</code> if the attributeType has the given option */ public boolean hasOption( String option ) { if ( hasOption() ) { return options.contains( Strings.toLowerCaseAscii( Strings.trim( option ) ) ); } else { return false; } }
/** * @param option the option to check * @return <code>true</code> if the attributeType has the given option */ public boolean hasOption( String option ) { if ( hasOption() ) { return options.contains( Strings.toLowerCaseAscii( Strings.trim( option ) ) ); } else { return false; } }
/** * Returns the attributeType from an Attribute ID. * * @param upId The ID we are looking for * @return The found attributeType * @throws LdapException If the lookup failed */ protected AttributeType getAttributeType( String upId ) throws LdapException { if ( Strings.isEmpty( Strings.trim( upId ) ) ) { String message = I18n.err( I18n.ERR_13204_NULL_ATTRIBUTE_ID ); LOG.error( message ); throw new IllegalArgumentException( message ); } return schemaManager.lookupAttributeTypeRegistry( upId ); }
/** * Returns the attributeType from an Attribute ID. * * @param upId The ID we are looking for * @return The found attributeType * @throws LdapException If the lookup failed */ protected AttributeType getAttributeType( String upId ) throws LdapException { if ( Strings.isEmpty( Strings.trim( upId ) ) ) { String message = I18n.err( I18n.ERR_13204_NULL_ATTRIBUTE_ID ); LOG.error( message ); throw new IllegalArgumentException( message ); } return schemaManager.lookupAttributeTypeRegistry( upId ); }
/** * Returns the attributeType from an Attribute ID. * * @param upId The ID we are looking for * @return The found attributeType * @throws LdapException If the lookup failed */ protected AttributeType getAttributeType( String upId ) throws LdapException { if ( Strings.isEmpty( Strings.trim( upId ) ) ) { String message = I18n.err( I18n.ERR_13204_NULL_ATTRIBUTE_ID ); LOG.error( message ); throw new IllegalArgumentException( message ); } return schemaManager.lookupAttributeTypeRegistry( upId ); }
/** * Get the trimmed and lower cased entry ID * * @param upId The ID * @return The retrieved ID */ private String getId( String upId ) { String id = Strings.trim( Strings.toLowerCaseAscii( upId ) ); // If empty, throw an error if ( Strings.isEmpty( id ) ) { String message = I18n.err( I18n.ERR_13216_AT_ID_NULL ); LOG.error( message ); throw new IllegalArgumentException( message ); } return id; }
/** * {@inheritDoc} */ @Override public void setUpId( String upId, AttributeType attributeType ) { String trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCaseAscii( trimmed ); setUpIdInternal( upId, newId, attributeType ); }
/** * {@inheritDoc} */ @Override public void setUpId( String upId, AttributeType attributeType ) { String trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCaseAscii( trimmed ); setUpIdInternal( upId, newId, attributeType ); }
/** * {@inheritDoc} */ @Override public void setUpId( String upId, AttributeType attributeType ) { String trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCaseAscii( trimmed ); setUpIdInternal( upId, newId, attributeType ); }
/** * Sets the User Provided ID as a byte[] * * @param upId The User Provided ID * @param attributeType The asscoiated AttributeType */ public void setUpId( byte[] upId, AttributeType attributeType ) { byte[] trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCase( trimmed ); setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType ); }
/** * Sets the User Provided ID as a byte[] * * @param upId The User Provided ID * @param attributeType The asscoiated AttributeType */ public void setUpId( byte[] upId, AttributeType attributeType ) { byte[] trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCase( trimmed ); setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType ); }
/** * Sets the User Provided ID as a byte[] * * @param upId The User Provided ID * @param attributeType The asscoiated AttributeType */ public void setUpId( byte[] upId, AttributeType attributeType ) { byte[] trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCase( trimmed ); setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType ); }