/** * Updates the collective flag * * @param collective The new value to set */ public void updateCollective( boolean collective ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.isCollective = collective; }
/** * Sets the Syntax OID for this AttributeType * * @param superiorOid The syntax OID for this AttributeType */ public void setSyntaxOid( String syntaxOid ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.syntaxOid = syntaxOid; } }
/** * Sets the Ordering OID for this AttributeType * * @param orderingOid The Ordering OID for this AttributeType */ public void setOrderingOid( String orderingOid ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.orderingOid = orderingOid; } }
/** * Tells if this AttributeType is Single Valued or not * * @param singleValue True if the AttributeType is single-valued */ public void setSingleValued( boolean singleValued ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.isSingleValued = singleValued; } }
/** * Tells if this AttributeType can be modified by a user or not * * @param canUserModify The flag to set */ public void setUserModifiable( boolean canUserModify ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.canUserModify = canUserModify; } }
/** * Sets the superior AttributeType OID of this AttributeType * * @param superiorOid The superior AttributeType OID of this AttributeType */ public void setSuperiorOid( String superiorOid ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.superiorOid = superiorOid; } }
/** * Sets the Equality OID for this AttributeType * * @param equalityOid The Equality OID for this AttributeType */ public void setEqualityOid( String equalityOid ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.equalityOid = equalityOid; } }
/** * Sets the Substr OID for this AttributeType * * @param substrOid The Substr OID for this AttributeType */ public void setSubstringOid( String substrOid ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.substringOid = substrOid; } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append( "<" ).append( attributeType.getName() ); if ( hasOption() ) { for ( String option:options ) { sb.append( ";" ).append( option ); } } return sb.append( ">" ).toString(); } }
/** * Sets the length limit of this AttributeType based on its associated * syntax. * * @param length the new length to set */ public void setSyntaxLength( int length ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.syntaxLength = length; } }
/** * Update the associated Substring MatchingRule, even if the SchemaObject is readOnly * * @param substring The Substr MR for this AttributeType */ public void updateSubstring( MatchingRule substring ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.substring = substring; this.substringOid = substring.getOid(); }
/** * Update the associated Syntax, even if the SchemaObject is readOnly * * @param syntax The Syntax for this AttributeType */ public void updateSyntax( LdapSyntax syntax ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.syntax = syntax; this.syntaxOid = syntax.getOid(); }
/** * Update the associated Equality MatchingRule, even if the SchemaObject is readOnly * * @param equality The Equality MR for this AttributeType */ public void updateEquality( MatchingRule equality ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.equality = equality; this.equalityOid = equality.getOid(); }
/** * Sets the Ordering MR for this AttributeType * * @param ordering The Ordering MR for this AttributeType */ public void setOrdering( MatchingRule ordering ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.ordering = ordering; this.orderingOid = ordering.getOid(); } }
/** * Update the associated Superior AttributeType, even if the SchemaObject is readOnly * * @param superior The superior for this AttributeType */ public void updateSuperior( AttributeType superior ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.superior = superior; this.superiorOid = superior.getOid(); }
/** * Update the associated Ordering MatchingRule, even if the SchemaObject is readOnly * * @param ordering The Ordering MR for this AttributeType */ public void updateOrdering( MatchingRule ordering ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.ordering = ordering; this.orderingOid = ordering.getOid(); }
/** * Sets the superior for this AttributeType * * @param superior The superior for this AttributeType */ public void setSuperior( AttributeType superior ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.superior = superior; this.superiorOid = superior.getOid(); } }
/** * Sets the Substr MR for this AttributeType * * @param substring The Substr MR for this AttributeType */ public void setSubstring( MatchingRule substring ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.substring = substring; this.substringOid = substring.getOid(); } }
/** * @see Index#sync() */ public synchronized void sync() throws NamingException { try { recMan.commit(); } catch ( IOException e ) { NamingException ne = new NamingException( "Exception while syncing backend index file for attribute " + attribute.getName() ); ne.setRootCause( e ); throw ne; } }
/** * Convert a ServerAttribute into a BasicAttribute. The DN is lost * during this conversion, as the Attributes object does not store * this element. * * @return An instance of a AttributesImpl() object */ public static Attribute toBasicAttribute( EntryAttribute entryAttribute ) { AttributeType attributeType = entryAttribute.getAttributeType(); Attribute attribute = new BasicAttribute( attributeType.getName() ); for ( Value<?> value: entryAttribute ) { attribute.add( value.get() ); } return attribute; }