Interface DiameterMessageFactory

    • Method Detail

      • encodeAvp

        byte[] encodeAvp​(DiameterAvp avp)
        Encodes an AVP to a byte array using standard Diameter AVP data formats.
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              byte[] value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the byte[] value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              byte[] value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the byte[] value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              int value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the int value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              int value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the int value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              long value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the long value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              long value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the long value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              float value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the float value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              float value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the float value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              double value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the double value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              double value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the double value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              InetAddress value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the java.net.InetAddress value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              InetAddress value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the java.net.InetAddress value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              Date value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the java.util.Date value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              Date value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the java.util.Date value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              String value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the java.lang.String value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              String value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the java.lang.String value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int avpCode,
                              Enumerated value)
                       throws NoSuchAvpException
        Create an AVP containing a DiameterAvpValue from the org.jainslee.resources.diameter.base.types.Enumerated value provided. The AVP type will be determined from the AVP code.
        Parameters:
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        DiameterAvp createAvp​(int vendorID,
                              int avpCode,
                              Enumerated value)
                       throws NoSuchAvpException
        Create a vendor-specific AVP containing a DiameterAvpValue from the org.jainslee.resources.diameter.base.types.Enumerated value provided. The AVP type will be determined from the AVP code.
        Parameters:
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        value - the value itself
        Returns:
        an implementation of the DiameterAvp interface
        Throws:
        NoSuchAvpException
      • createAvp

        UndefinedAvp createAvp​(String name,
                               int vendorID,
                               int avpCode,
                               boolean isMandatory,
                               boolean isProtected,
                               byte[] avpData)
        Creates an undefined AVP, an AVP that is not configured in the Diameter stack.
        Parameters:
        name - a symbolic name for this AVP, used for debugging. If null, the AVP's name will be set to the default value of UndefinedAvp.NAME.
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        isMandatory - specifies whether the M bit will be set in the AVP.
        isProtected - specifies whether the P bit will be set in the AVP.
        avpData - the undecoded AVP data.
        Returns:
        an UndefinedAvp instance.
      • createAvp

        DiameterAvp createAvp​(String name,
                              int vendorID,
                              int avpCode,
                              boolean isMandatory,
                              boolean isProtected,
                              DiameterAvp[] avps)
        Creates an undefined grouped AVP, a grouped AVP that is not configured in the Diameter stack. The DiameterAvp instance returned will always be of type DiameterAvpType.GROUPED, and does not need decoding, but its member AVPs may need decoding if they are UndefinedAvps.
        Parameters:
        name - a symbolic name for this AVP, used for debugging. If null, the AVP's name will be set to the default value of UndefinedAvp.NAME.
        vendorID - the IANA-assigned enterprise number of the vendor that specified the AVP (eg. 10415 for 3GPP).
        avpCode - the code for the AVP
        isMandatory - specifies whether the M bit will be set in the AVP.
        isProtected - specifies whether the P bit will be set in the AVP.
        avps - an array of DiameterAvp objects
        Returns:
        a DiameterAvp instance of type DiameterAvpType.GROUPED. The member AVPs may be accessed using DiameterAvp.groupedAvpValue().
      • createCommand

        DiameterCommand createCommand​(int commandCode,
                                      int applicationId,
                                      String shortName,
                                      String longName,
                                      boolean isRequest,
                                      boolean isProxiable)
        Create an instance of a DiameterCommand concrete implementation using the given arguments.
        Parameters:
        commandCode - the command code of the command
        applicationId - the application ID of the command
        shortName - the short name of the command, e.g., "CER"
        longName - the long name of the command, e.g., "Capabilities-Exchange-Request"
        isRequest - true if this command represents a request (not answer)
        isProxiable - true if this command may be proxied
        Returns:
        a complete and correct DiameterCommand object to be passed to createMessage(DiameterCommand, DiameterAvp[] avps).
      • createFailedAvp

        FailedAvp createFailedAvp()
        Create an empty FailedAvp (Grouped AVP) instance.
      • createFailedAvp

        FailedAvp createFailedAvp​(DiameterAvp avp)
        Create a FailedAvp (Grouped AVP) instance, populating one AVP.
      • createFailedAvp

        FailedAvp createFailedAvp​(DiameterAvp[] avps)
        Create a FailedAvp (Grouped AVP) instance using the given array to populate the AVPs.
      • createProxyInfo

        ProxyInfo createProxyInfo​(DiameterIdentity proxyHost,
                                  byte[] proxyState)
        Create a ProxyInfo (Grouped AVP) instance using required AVP values.
      • createProxyInfo

        ProxyInfo createProxyInfo()
        Create an empty ProxyInfo (Grouped AVP) instance.
      • createProxyInfo

        ProxyInfo createProxyInfo​(DiameterAvp avp)
        Create a ProxyInfo (Grouped AVP) instance, populating one AVP.
      • createProxyInfo

        ProxyInfo createProxyInfo​(DiameterAvp[] avps)
        Create a ProxyInfo (Grouped AVP) instance using the given array to populate the AVPs.
      • createVendorSpecificApplicationId

        VendorSpecificApplicationId createVendorSpecificApplicationId​(long vendorId)
        Create a VendorSpecificApplicationId (Grouped AVP) instance using required AVP values.
      • createVendorSpecificApplicationId

        VendorSpecificApplicationId createVendorSpecificApplicationId()
        Create an empty VendorSpecificApplicationId (Grouped AVP) instance.
      • createVendorSpecificApplicationId

        VendorSpecificApplicationId createVendorSpecificApplicationId​(DiameterAvp avp)
        Create a VendorSpecificApplicationId (Grouped AVP) instance, populating one AVP.
      • createVendorSpecificApplicationId

        VendorSpecificApplicationId createVendorSpecificApplicationId​(DiameterAvp[] avps)
        Create a VendorSpecificApplicationId (Grouped AVP) instance using the given array to populate the AVPs.
      • createExperimentalResult

        ExperimentalResult createExperimentalResult​(long vendorId,
                                                    long experimentalResultCode)
        Create a ExperimentalResult (Grouped AVP) instance using required AVP values.
      • createExperimentalResult

        ExperimentalResult createExperimentalResult()
        Create an empty ExperimentalResult (Grouped AVP) instance.
      • createExperimentalResult

        ExperimentalResult createExperimentalResult​(DiameterAvp avp)
        Create a ExperimentalResult (Grouped AVP) instance, populating one AVP.
      • createExperimentalResult

        ExperimentalResult createExperimentalResult​(DiameterAvp[] avps)
        Create a ExperimentalResult (Grouped AVP) instance using the given array to populate the AVPs.
      • isRecognizedAvp

        boolean isRecognizedAvp​(DiameterAvp avp)
        Returns true if the specified AVP is recognized by this DiameterMessageFactory. Returns false for unrecognized (e.g. Extension) AVPs.
        Returns:
        true if the specified AVP is recognized by this DiameterMessageFactory.