/** * Compute the Simple authentication length * * Simple authentication : 0x80 L1 simple * * L1 = Length(simple) * Length(Simple authentication) = Length(0x80) + Length(L1) + Length(simple) */ public int computeLength() { int length = 1; length += TLV.getNbBytes( simple.length ) + simple.length; if ( IS_DEBUG ) { log.debug( "Simple Authentication length : {}", Integer.valueOf( length ) ); } return length; }
/** * Compute the NotFilter length * NotFilter : * 0xA2 L1 super.computeLength() * * Length(NotFilter) = Length(0xA2) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { filtersLength = super.computeLength(); return 1 + TLV.getNbBytes( filtersLength ) + filtersLength; }
/** * Compute the NotFilter length * NotFilter : * 0xA2 L1 super.computeLength() * * Length(NotFilter) = Length(0xA2) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { filtersLength = super.computeLength(); return 1 + TLV.getNbBytes( filtersLength ) + filtersLength; }
/** * Compute the OrFilter length * * OrFilter : * 0xA1 L1 super.computeLength() * * Length(OrFilter) = Length(0xA1) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { filtersLength = super.computeLength(); return 1 + TLV.getNbBytes( filtersLength ) + filtersLength; }
/** * Compute the PresentFilter length * PresentFilter : * 0x87 L1 present * * Length(PresentFilter) = Length(0x87) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { attributeDescriptionBytes = StringTools.getBytesUtf8( attributeDescription ); return 1 + TLV.getNbBytes( attributeDescriptionBytes.length ) + attributeDescriptionBytes.length; }
/** * Compute the PresentFilter length * PresentFilter : * 0x87 L1 present * * Length(PresentFilter) = Length(0x87) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { attributeDescriptionBytes = Strings.getBytesUtf8(attributeDescription); return 1 + TLV.getNbBytes( attributeDescriptionBytes.length ) + attributeDescriptionBytes.length; }
/** * Compute the OrFilter length * * OrFilter : * 0xA1 L1 super.computeLength() * * Length(OrFilter) = Length(0xA1) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { filtersLength = super.computeLength(); return 1 + TLV.getNbBytes( filtersLength ) + filtersLength; }
/** * Compute the AndFilter length * * AndFilter : * 0xA0 L1 super.computeLength() * * Length(AndFilter) = Length(0xA0) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { filtersLength = super.computeLength(); return 1 + TLV.getNbBytes( filtersLength ) + filtersLength; }
/** * Compute the AndFilter length * * AndFilter : * 0xA0 L1 super.computeLength() * * Length(AndFilter) = Length(0xA0) + Length(super.computeLength()) + * super.computeLength() */ public int computeLength() { filtersLength = super.computeLength(); return 1 + TLV.getNbBytes( filtersLength ) + filtersLength; }
/** * Compute the CompareResponse length * * CompareResponse : * * 0x6F L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(CompareResponse) = Length(0x6F) + Length(L1) + L1 */ protected int computeLengthProtocolOp() { int ldapResultLength = super.computeLdapResultLength(); return 1 + TLV.getNbBytes( ldapResultLength ) + ldapResultLength; }
/** * Compute the ModifyDNResponse length * * ModifyDNResponse : * <pre> * 0x6D L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * Length(ModifyDNResponse) = Length(0x6D) + Length(L1) + L1 * </pre> */ protected int computeLengthProtocolOp() { int ldapResultLength = super.computeLdapResultLength(); return 1 + TLV.getNbBytes( ldapResultLength ) + ldapResultLength; }
/** * Compute the DelResponse length * * DelResponse : * * 0x6B L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(DelResponse) = Length(0x6B) + Length(L1) + L1 */ protected int computeLengthProtocolOp() { int ldapResultLength = super.computeLdapResultLength(); return 1 + TLV.getNbBytes( ldapResultLength ) + ldapResultLength; }
/** * Compute the AddResponse length * * AddResponse : * * 0x69 L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(AddResponse) = Length(0x69) + Length(L1) + L1 */ protected int computeLengthProtocolOp() { int ldapResultLength = super.computeLdapResultLength(); return 1 + TLV.getNbBytes( ldapResultLength ) + ldapResultLength; }
/** * Compute the ModifyResponse length * * ModifyResponse : * <pre> * 0x67 L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * Length(ModifyResponse) = Length(0x67) + Length(L1) + L1 * </pre> */ protected int computeLengthProtocolOp() { int ldapResponseLength = super.computeLdapResultLength(); return 1 + TLV.getNbBytes( ldapResponseLength ) + ldapResponseLength; }
/** * Compute the DelRequest length * * DelRequest : * 0x4A L1 entry * * L1 = Length(entry) * Length(DelRequest) = Length(0x4A) + Length(L1) + L1 */ protected int computeLengthProtocolOp() { // The entry return 1 + TLV.getNbBytes( DN.getNbBytes( entry ) ) + DN.getNbBytes( entry ); }
private int computeControlLength( Control control ) { // First, compute the control's value length int controlValueLength = ( ( CodecControl<?> ) control).computeLength(); // Now, compute the envelop length // The OID int oidLengh = Strings.getBytesUtf8( control.getOid() ).length; int controlLength = 1 + TLV.getNbBytes( oidLengh ) + oidLengh; // The criticality, only if true if ( control.isCritical() ) { controlLength += 1 + 1 + 1; // Always 3 for a boolean } if ( controlValueLength != 0 ) { controlLength += 1 + TLV.getNbBytes( controlValueLength ) + controlValueLength; } return controlLength; }
/** * Compute the SearchResultDone length * * SearchResultDone : * <pre> * 0x65 L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * Length(SearchResultDone) = Length(0x65) + Length(L1) + L1 * </pre> */ public int computeLength() { int searchResultDoneLength = ((LdapResultDecorator)getLdapResult()).computeLength(); setSearchResultDoneLength( searchResultDoneLength ); return 1 + TLV.getNbBytes( searchResultDoneLength ) + searchResultDoneLength; }
/** * Compute the CompareResponse length * * CompareResponse : * * 0x6F L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(CompareResponse) = Length(0x6F) + Length(L1) + L1 */ public int computeLength() { int compareResponseLength = ((LdapResultDecorator)getLdapResult()).computeLength(); setCompareResponseLength( compareResponseLength ); return 1 + TLV.getNbBytes( compareResponseLength ) + compareResponseLength; }
/** * Compute the DelResponse length * * DelResponse : * * 0x6B L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(DelResponse) = Length(0x6B) + Length(L1) + L1 */ public int computeLength() { int deleteResponseLength = ((LdapResultDecorator)getLdapResult()).computeLength(); setDeleteResponseLength( deleteResponseLength ); return 1 + TLV.getNbBytes( deleteResponseLength ) + deleteResponseLength; }
/** * Compute the DelRequest length * * DelRequest : * 0x4A L1 entry * * L1 = Length(entry) * Length(DelRequest) = Length(0x4A) + Length(L1) + L1 */ public int computeLength() { // The entry return 1 + TLV.getNbBytes( Dn.getNbBytes( getName() ) ) + Dn.getNbBytes( getName() ); }