001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020 package org.apache.directory.shared.asn1.ber.tlv; 021 022 023 import org.apache.directory.shared.asn1.codec.DecoderException; 024 025 026 /** 027 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 028 * @version $Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sat, 07 Jun 2008) $ 029 */ 030 public interface ITLVBerDecoderMBean 031 { 032 // ~ Methods 033 // ------------------------------------------------------------------------------------ 034 035 /** 036 * Set the number of bytes that can be used to encode the Value length, 037 * including the first byte. Max is 127 if the Length use a definite form, 038 * default is 1 039 * 040 * @param length the number of byte to use 041 * @throws DecoderException 042 */ 043 void setMaxLengthLength( int length ) throws DecoderException; 044 045 046 /** 047 * Set the maximum number of bytes that should be used to encode a Tag 048 * label, including the first byte. Default is 1, no maximum 049 * 050 * @param length 051 * The length to use 052 */ 053 void setMaxTagLength( int length ); 054 055 056 /** Allow indefinite length. */ 057 void allowIndefiniteLength(); 058 059 060 /** Disallow indefinite length. */ 061 void disallowIndefiniteLength(); 062 063 064 /** 065 * Get the actual maximum number of bytes that can be used to encode the 066 * Length 067 * 068 * @return The maximum bytes of the Length 069 */ 070 int getMaxLengthLength(); 071 072 073 /** 074 * Get the actual maximum number of bytes that can be used to encode the Tag 075 * 076 * @return The maximum length of the Tag 077 */ 078 int getMaxTagLength(); 079 080 081 /** 082 * Tell if indefinite length form could be used for Length 083 * 084 * @return <code>true</code> if the Indefinite form is allowed 085 */ 086 boolean isIndefiniteLengthAllowed(); 087 }