Interface FinalUnitIndication

  • All Superinterfaces:
    Cloneable, DiameterAvp, GroupedAvp

    public interface FinalUnitIndication
    extends GroupedAvp
    Defines an interface representing the Final-Unit-Indication grouped AVP type. From the Diameter Credit-Control Application (rfc4006.txt) specification:
     8.34.  Final-Unit-Indication AVP
     
        The Final-Unit-Indication AVP (AVP Code 430) is of type Grouped and
        indicates that the Granted-Service-Unit AVP in the Credit-Control-
        Answer, or in the AA answer, contains the final units for the
        service.  After these units have expired, the Diameter credit-control
        client is responsible for executing the action indicated in the
        Final-Unit-Action AVP (see section 5.6).
     
        If more than one unit type is received in the Credit-Control-Answer,
        the unit type that first expired SHOULD cause the credit-control
        client to execute the specified action.
     
        In the first interrogation, the Final-Unit-Indication AVP with
        Final-Unit-Action REDIRECT or RESTRICT_ACCESS can also be present
        with no Granted-Service-Unit AVP in the Credit-Control-Answer or in
        the AA answer.  This indicates to the Diameter credit-control client
        to execute the specified action immediately.  If the home service
        provider policy is to terminate the service, naturally, the server
        SHOULD return the appropriate transient failure (see section 9.1) in
        order to implement the policy-defined action.
     
        The Final-Unit-Action AVP defines the behavior of the service element
        when the user's account cannot cover the cost of the service and MUST
        always be present if the Final-Unit-Indication AVP is included in a
        command.
     
        If the Final-Unit-Action AVP is set to TERMINATE, no other AVPs MUST
        be present.
     
        If the Final-Unit-Action AVP is set to REDIRECT at least the
        Redirect-Server AVP MUST be present.  The Restriction-Filter-Rule AVP
        or the Filter-Id AVP MAY be present in the Credit-Control-Answer
        message if the user is also allowed to access other services that are
        not accessible through the address given in the Redirect-Server AVP.
     
        If the Final-Unit-Action AVP is set to RESTRICT_ACCESS, either the
        Restriction-Filter-Rule AVP or the Filter-Id AVP SHOULD be present.
     
        The Filter-Id AVP is defined in [NASREQ].  The Filter-Id AVP can be
        used to reference an IP filter list installed in the access device by
        means other than the Diameter credit-control application, e.g.,
        locally configured or configured by another entity.
     
        The Final-Unit-Indication AVP is defined as follows (per the
        grouped-avp-def of RFC 3588 [DIAMBASE]):
     
           Final-Unit-Indication ::= < AVP Header: 430 >
                                     { Final-Unit-Action }
                                    *[ Restriction-Filter-Rule ]
                                    *[ Filter-Id ]
                                     [ Redirect-Server ]
     
     
    Note:
    The support for extension AVPs is present even thou the ABNF grammar for this AVP does not contain the "* [ AVP ]" line. Be aware that adding any extension AVPs may result in interoperability problems with products that strongly validate the incoming diameter message for it's adherence to the specification.
    • Method Detail

      • hasFinalUnitAction

        boolean hasFinalUnitAction()
        Returns true if the Final-Unit-Action AVP is present in the Final-Unit-Indication AVP.
      • getFinalUnitAction

        FinalUnitAction getFinalUnitAction()
        Returns the value of the Final-Unit-Action AVP, of type Enumerated.
        Returns:
        the value of the Final-Unit-Action AVP, or null if it has not been set.
      • setFinalUnitAction

        void setFinalUnitAction​(FinalUnitAction finalUnitAction)
        Sets the value of the Final-Unit-Action AVP, of type Enumerated.
        Throws:
        NullPointerException - if finalUnitAction is null.
      • removeFinalUnitAction

        void removeFinalUnitAction()
        Removes the Final-Unit-Action AVP from the Final-Unit-Indication AVP. If the Final-Unit-Action AVP is not present, this method returns silently.
      • getRestrictionFilterRules

        IPFilterRule[] getRestrictionFilterRules()
        Returns the set of Restriction-Filter-Rule AVPs. The returned array contains the AVPs in the order they appear in the Final-Unit-Indication AVP. A return value of null implies that no Restriction-Filter-Rule AVPs have been set. The elements in the given array are IPFilterRule objects.
      • setRestrictionFilterRule

        void setRestrictionFilterRule​(IPFilterRule restrictionFilterRule)
        Sets a single Restriction-Filter-Rule AVP in the Final-Unit-Indication AVP, of type IPFilterRule.
        Throws:
        NullPointerException - if restrictionFilterRule is null.
      • setRestrictionFilterRules

        void setRestrictionFilterRules​(IPFilterRule[] restrictionFilterRules)
        Sets the set of Restriction-Filter-Rule AVPs, with all the values in the given array. The AVPs will be added to the Final-Unit-Indication AVP in the order in which they appear in the array. Note: the array must not be altered by the caller following this call, and getRestrictionFilterRules() is not guaranteed to return the same array instance, e.g. an "==" check would fail.
        Throws:
        NullPointerException - if restrictionFilterRules is null.
      • removeRestrictionFilterRules

        void removeRestrictionFilterRules()
        Removes all Restriction-Filter-Rule AVPs from the Final-Unit-Indication AVP. If no Restriction-Filter-Rule AVPs are present, this method returns silently.
      • getFilterIds

        String[] getFilterIds()
        Returns the set of Filter-Id AVPs. The returned array contains the AVPs in the order they appear in the Final-Unit-Indication AVP. A return value of null implies that no Filter-Id AVPs have been set. The elements in the given array are String objects.
      • setFilterId

        void setFilterId​(String filterId)
        Sets a single Filter-Id AVP in the Final-Unit-Indication AVP, of type UTF8String.
        Throws:
        NullPointerException - if filterId is null.
      • setFilterIds

        void setFilterIds​(String[] filterIds)
        Sets the set of Filter-Id AVPs, with all the values in the given array. The AVPs will be added to the Final-Unit-Indication AVP in the order in which they appear in the array. Note: the array must not be altered by the caller following this call, and getFilterIds() is not guaranteed to return the same array instance, e.g. an "==" check would fail.
        Throws:
        NullPointerException - if filterIds is null.
      • removeFilterIds

        void removeFilterIds()
        Removes all Filter-Id AVPs from the Final-Unit-Indication AVP. If no Filter-Id AVPs are present, this method returns silently.
      • hasRedirectServer

        boolean hasRedirectServer()
        Returns true if the Redirect-Server AVP is present in the Final-Unit-Indication AVP.
      • getRedirectServer

        RedirectServer getRedirectServer()
        Returns the value of the Redirect-Server AVP, of type Grouped.
        Returns:
        the value of the Redirect-Server AVP, or null if it has not been set.
      • setRedirectServer

        void setRedirectServer​(RedirectServer redirectServer)
        Sets the value of the Redirect-Server AVP, of type Grouped.
        Throws:
        NullPointerException - if redirectServer is null.
      • removeRedirectServer

        void removeRedirectServer()
        Removes the Redirect-Server AVP from the Final-Unit-Indication AVP. If the Redirect-Server AVP is not present, this method returns silently.
      • getExtensionAvps

        DiameterAvp[] getExtensionAvps()
        Returns the set of extension AVPs. The returned array contains the extension AVPs in the order they appear in the Final-Unit-Indication AVP. A return value of null implies that no extensions AVPs have been set.
      • setExtensionAvps

        void setExtensionAvps​(DiameterAvp[] avps)
                       throws AvpNotAllowedException
        Sets the set of extension AVPs with all the values in the given array. The AVPs will be added to Final-Unit-Indication AVP in the order in which they appear in the array. Note: the array must not be altered by the caller following this call, and getExtensionAvps() is not guaranteed to return the same array instance, e.g. an "==" check would fail.
        Throws:
        AvpNotAllowedException - if an AVP is encountered of a type already known to this class (i.e. an AVP for which get/set methods already appear in this class)
        NullPointerException - if avps is null.
      • removeExtensionAvps

        void removeExtensionAvps()
        Removes all extension AVPs from the Final-Unit-Indication AVP. If no extension AVPs are present, this method returns silently.