Class AuthorityAndFormatIds


  • public final class AuthorityAndFormatIds
    extends Object
    Class AuthorityAndFormatIds represents the known Authority and Format Identifiers (AFIs) that can be used in Network Service Access Point (NSAP) addresses. It initially knows about the AFIs listed in ITU-T X.213 / ISO/IEC 8348:2002(E) Annex A. It can be taught the properties of further AFIs using put(String,int,int,int,DSPCodec).
    • Method Detail

      • put

        public static void put​(String afi,
                               int idiMinLength,
                               int idiMaxLength,
                               int idiPaddingDigit,
                               DSPCodec dspCodec)
                        throws AFIAlreadyPutException
        Adds properties of an Authority and Format Identifier to a map of known AFIs.
        Parameters:
        afi - new Authority and Format Identifier
        idiMinLength - minimum length of Initial Domain Identifier
        idiMaxLength - maximum length of Initial Domain Identifier
        idiPaddingDigit - semi-octet value with which to pad IDI (0 or 1)
        dspCodec - indicates codec for domain specific part
        Throws:
        AFIAlreadyPutException - if AFI already has related properties
      • getIDIMinLength

        public static int getIDIMinLength​(String afi)
                                   throws AFIUnknownException
        Gets the minimum length of IDI for the given AFI.
        Parameters:
        afi - Authority and Format Identifier
        Returns:
        int
        Throws:
        AFIUnknownException - if properties of AFI are unknown
      • getIDIMaxLength

        public static int getIDIMaxLength​(String afi)
                                   throws AFIUnknownException
        Gets the maximum length of IDI for the given AFI.
        Parameters:
        afi - Authority and Format Identifier
        Returns:
        int
        Throws:
        AFIUnknownException - if properties of AFI are unknown
      • getIDIPaddingDigit

        public static int getIDIPaddingDigit​(String afi)
                                      throws AFIUnknownException
        Gets the semi-octet value to use for leading padding of an IDI for the given AFI (0 or 1).
        Parameters:
        afi - Authority and Format Identifier
        Returns:
        int
        Throws:
        AFIUnknownException - if properties of AFI are unknown
      • getDSPCodec

        public static DSPCodec getDSPCodec​(String afi)
                                    throws AFIUnknownException
        Gets the DSPCodec to use for encoding and decoding the DSP for the given AFI.
        Parameters:
        afi - Authority and Format Identifier
        Returns:
        DSPCodec
        Throws:
        AFIUnknownException - if properties of AFI are unknown