Interface MultipleServicesCreditControl

  • All Superinterfaces:
    Cloneable, DiameterAvp, GroupedAvp

    public interface MultipleServicesCreditControl
    extends GroupedAvp
    Defines an interface representing the Multiple-Services-Credit-Control grouped AVP type. From the Diameter Credit-Control Application (rfc4006.txt) specification:
     8.16.  Multiple-Services-Credit-Control AVP
     
        Multiple-Services-Credit-Control AVP (AVP Code 456) is of type
        Grouped and contains the AVPs related to the independent credit-
        control of multiple services feature.  Note that each instance of
        this AVP carries units related to one or more services or related to
        a single rating group.
     
        The Service-Identifier and the Rating-Group AVPs are used to
        associate the granted units to a given service or rating group.  If
        both the Service-Identifier and the Rating-Group AVPs are included,
        the target of the service units is always the service(s) indicated by
        the value of the Service-Identifier AVP(s).  If only the Rating-
        Group-Id AVP is present, the Multiple-Services-Credit-Control AVP
        relates to all the services that belong to the specified rating
        group.
     
        The G-S-U-Pool-Reference AVP allows the server to specify a G-S-U-
        Pool-Identifier identifying a credit pool within which the units of
        the specified type are considered pooled.  If a G-S-U-Pool-Reference
        AVP is present, then actual service units of the specified type MUST
        also be present.  For example, if the G-S-U-Pool-Reference AVP
        specifies Unit-Type TIME, then the CC-Time AVP MUST be present.
     
        The Requested-Service-Unit AVP MAY contain the amount of requested
        service units or the requested monetary value.  It MUST be present in
        the initial interrogation and within the intermediate interrogations
        in which new quota is requested.  If the credit-control client does
        not include the Requested-Service-Unit AVP in a request command,
        because for instance, it has determined that the end-user terminated
        the service, the server MUST debit the used amount from the user's
        account but MUST NOT return a new quota in the corresponding answer.
        The Validity-Time, Result-Code, and Final-Unit-Indication AVPs MAY be
        present in an answer command as defined in sections 5.1.2 and 5.6 for
        the graceful service termination.
     
        When both the Tariff-Time-Change and Tariff-Change-Usage AVPs are
        present, the server MUST include two separate instances of the
        Multiple-Services-Credit-Control AVP with the Granted-Service-Unit
        AVP associated to the same service-identifier and/or rating-group.
        Where the two quotas are associated to the same pool or to different
        pools, the credit pooling mechanism defined in section 5.1.2 applies.
        The Tariff-Change-Usage AVP MUST NOT be included in request commands
        to report used units before, and after tariff time change the Used-
        Service-Unit AVP MUST be used.
     
        A server not implementing the independent credit-control of multiple
        services functionality MUST treat the Multiple-Services-Credit-
        Control AVP as an invalid AVP.
     
        The Multiple-Services-Control AVP is defined as follows (per the
        grouped-avp-def of RFC 3588 [DIAMBASE]):
     
           Multiple-Services-Credit-Control ::= < AVP Header: 456 >
                                                [ Granted-Service-Unit ]
                                                [ Requested-Service-Unit ]
                                               *[ Used-Service-Unit ]
                                                [ Tariff-Change-Usage ]
                                               *[ Service-Identifier ]
                                                [ Rating-Group ]
                                               *[ G-S-U-Pool-Reference ]
                                                [ Validity-Time ]
                                                [ Result-Code ]
                                                [ Final-Unit-Indication ]
                                               *[ AVP ]
     
    • Method Detail

      • hasGrantedServiceUnit

        boolean hasGrantedServiceUnit()
        Returns true if the Granted-Service-Unit AVP is present in the Multiple-Services-Credit-Control AVP.
      • getGrantedServiceUnit

        GrantedServiceUnit getGrantedServiceUnit()
        Returns the value of the Granted-Service-Unit AVP, of type Grouped.
        Returns:
        the value of the Granted-Service-Unit AVP, or null if it has not been set.
      • setGrantedServiceUnit

        void setGrantedServiceUnit​(GrantedServiceUnit grantedServiceUnit)
        Sets the value of the Granted-Service-Unit AVP, of type Grouped.
        Throws:
        NullPointerException - if grantedServiceUnit is null.
      • removeGrantedServiceUnit

        void removeGrantedServiceUnit()
        Removes the Granted-Service-Unit AVP from the Multiple-Services-Credit-Control AVP. If the Granted-Service-Unit AVP is not present, this method returns silently.
      • hasRequestedServiceUnit

        boolean hasRequestedServiceUnit()
        Returns true if the Requested-Service-Unit AVP is present in the Multiple-Services-Credit-Control AVP.
      • getRequestedServiceUnit

        RequestedServiceUnit getRequestedServiceUnit()
        Returns the value of the Requested-Service-Unit AVP, of type Grouped.
        Returns:
        the value of the Requested-Service-Unit AVP, or null if it has not been set.
      • setRequestedServiceUnit

        void setRequestedServiceUnit​(RequestedServiceUnit requestedServiceUnit)
        Sets the value of the Requested-Service-Unit AVP, of type Grouped.
        Throws:
        NullPointerException - if requestedServiceUnit is null.
      • removeRequestedServiceUnit

        void removeRequestedServiceUnit()
        Removes the Requested-Service-Unit AVP from the Multiple-Services-Credit-Control AVP. If the Requested-Service-Unit AVP is not present, this method returns silently.
      • getUsedServiceUnits

        UsedServiceUnit[] getUsedServiceUnits()
        Returns the set of Used-Service-Unit AVPs. The returned array contains the AVPs in the order they appear in the Multiple-Services-Credit-Control AVP. A return value of null implies that no Used-Service-Unit AVPs have been set. The elements in the given array are UsedServiceUnit objects.
      • setUsedServiceUnit

        void setUsedServiceUnit​(UsedServiceUnit usedServiceUnit)
        Sets a single Used-Service-Unit AVP in the Multiple-Services-Credit-Control AVP, of type Grouped.
        Throws:
        NullPointerException - if usedServiceUnit is null.
      • setUsedServiceUnits

        void setUsedServiceUnits​(UsedServiceUnit[] usedServiceUnits)
        Sets the set of Used-Service-Unit AVPs, with all the values in the given array. The AVPs will be added to the Multiple-Services-Credit-Control 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 getUsedServiceUnits() is not guaranteed to return the same array instance, e.g. an "==" check would fail.
        Throws:
        NullPointerException - if usedServiceUnits is null.
      • removeUsedServiceUnits

        void removeUsedServiceUnits()
        Removes all Used-Service-Unit AVPs from the Multiple-Services-Credit-Control AVP. If no Used-Service-Unit AVPs are present, this method returns silently.
      • hasTariffChangeUsage

        boolean hasTariffChangeUsage()
        Returns true if the Tariff-Change-Usage AVP is present in the Multiple-Services-Credit-Control AVP.
      • getTariffChangeUsage

        TariffChangeUsage getTariffChangeUsage()
        Returns the value of the Tariff-Change-Usage AVP, of type Enumerated.
        Returns:
        the value of the Tariff-Change-Usage AVP, or null if it has not been set.
      • setTariffChangeUsage

        void setTariffChangeUsage​(TariffChangeUsage tariffChangeUsage)
        Sets the value of the Tariff-Change-Usage AVP, of type Enumerated.
        Throws:
        NullPointerException - if tariffChangeUsage is null.
      • removeTariffChangeUsage

        void removeTariffChangeUsage()
        Removes the Tariff-Change-Usage AVP from the Multiple-Services-Credit-Control AVP. If the Tariff-Change-Usage AVP is not present, this method returns silently.
      • getServiceIdentifiers

        long[] getServiceIdentifiers()
        Returns the set of Service-Identifier AVPs. The returned array contains the AVPs in the order they appear in the Multiple-Services-Credit-Control AVP. A return value of null implies that no Service-Identifier AVPs have been set. The elements in the given array are long objects.
      • setServiceIdentifier

        void setServiceIdentifier​(long serviceIdentifier)
        Sets a single Service-Identifier AVP in the Multiple-Services-Credit-Control AVP, of type Unsigned32.
      • setServiceIdentifiers

        void setServiceIdentifiers​(long[] serviceIdentifiers)
        Sets the set of Service-Identifier AVPs, with all the values in the given array. The AVPs will be added to the Multiple-Services-Credit-Control 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 getServiceIdentifiers() is not guaranteed to return the same array instance, e.g. an "==" check would fail.
        Throws:
        NullPointerException - if serviceIdentifiers is null.
      • removeServiceIdentifiers

        void removeServiceIdentifiers()
        Removes all Service-Identifier AVPs from the Multiple-Services-Credit-Control AVP. If no Service-Identifier AVPs are present, this method returns silently.
      • hasRatingGroup

        boolean hasRatingGroup()
        Returns true if the Rating-Group AVP is present in the Multiple-Services-Credit-Control AVP.
      • getRatingGroup

        long getRatingGroup()
        Returns the value of the Rating-Group AVP, of type Unsigned32. Use hasRatingGroup() to check the existence of this AVP.
        Returns:
        the value of the Rating-Group AVP
        Throws:
        IllegalStateException - if the Rating-Group AVP has not been set.
      • setRatingGroup

        void setRatingGroup​(long ratingGroup)
        Sets the value of the Rating-Group AVP, of type Unsigned32.
      • removeRatingGroup

        void removeRatingGroup()
        Removes the Rating-Group AVP from the Multiple-Services-Credit-Control AVP. If the Rating-Group AVP is not present, this method returns silently.
      • getGsuPoolReferences

        GsuPoolReference[] getGsuPoolReferences()
        Returns the set of G-S-U-Pool-Reference AVPs. The returned array contains the AVPs in the order they appear in the Multiple-Services-Credit-Control AVP. A return value of null implies that no G-S-U-Pool-Reference AVPs have been set. The elements in the given array are GsuPoolReference objects.
      • setGsuPoolReference

        void setGsuPoolReference​(GsuPoolReference gsuPoolReference)
        Sets a single G-S-U-Pool-Reference AVP in the Multiple-Services-Credit-Control AVP, of type Grouped.
        Throws:
        NullPointerException - if gsuPoolReference is null.
      • setGsuPoolReferences

        void setGsuPoolReferences​(GsuPoolReference[] gsuPoolReferences)
        Sets the set of G-S-U-Pool-Reference AVPs, with all the values in the given array. The AVPs will be added to the Multiple-Services-Credit-Control 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 getGsuPoolReferences() is not guaranteed to return the same array instance, e.g. an "==" check would fail.
        Throws:
        NullPointerException - if gsuPoolReferences is null.
      • removeGsuPoolReferences

        void removeGsuPoolReferences()
        Removes all G-S-U-Pool-Reference AVPs from the Multiple-Services-Credit-Control AVP. If no G-S-U-Pool-Reference AVPs are present, this method returns silently.
      • hasValidityTime

        boolean hasValidityTime()
        Returns true if the Validity-Time AVP is present in the Multiple-Services-Credit-Control AVP.
      • getValidityTime

        long getValidityTime()
        Returns the value of the Validity-Time AVP, of type Unsigned32. Use hasValidityTime() to check the existence of this AVP.
        Returns:
        the value of the Validity-Time AVP
        Throws:
        IllegalStateException - if the Validity-Time AVP has not been set.
      • setValidityTime

        void setValidityTime​(long validityTime)
        Sets the value of the Validity-Time AVP, of type Unsigned32.
      • removeValidityTime

        void removeValidityTime()
        Removes the Validity-Time AVP from the Multiple-Services-Credit-Control AVP. If the Validity-Time AVP is not present, this method returns silently.
      • hasResultCode

        boolean hasResultCode()
        Returns true if the Result-Code AVP is present in the Multiple-Services-Credit-Control AVP.
      • getResultCode

        long getResultCode()
        Returns the value of the Result-Code AVP, of type Unsigned32. Use hasResultCode() to check the existence of this AVP.
        Returns:
        the value of the Result-Code AVP
        Throws:
        IllegalStateException - if the Result-Code AVP has not been set.
      • setResultCode

        void setResultCode​(long resultCode)
        Sets the value of the Result-Code AVP, of type Unsigned32.
      • removeResultCode

        void removeResultCode()
        Removes the Result-Code AVP from the Multiple-Services-Credit-Control AVP. If the Result-Code AVP is not present, this method returns silently.
      • hasFinalUnitIndication

        boolean hasFinalUnitIndication()
        Returns true if the Final-Unit-Indication AVP is present in the Multiple-Services-Credit-Control AVP.
      • getFinalUnitIndication

        FinalUnitIndication getFinalUnitIndication()
        Returns the value of the Final-Unit-Indication AVP, of type Grouped.
        Returns:
        the value of the Final-Unit-Indication AVP, or null if it has not been set.
      • setFinalUnitIndication

        void setFinalUnitIndication​(FinalUnitIndication finalUnitIndication)
        Sets the value of the Final-Unit-Indication AVP, of type Grouped.
        Throws:
        NullPointerException - if finalUnitIndication is null.
      • removeFinalUnitIndication

        void removeFinalUnitIndication()
        Removes the Final-Unit-Indication AVP from the Multiple-Services-Credit-Control AVP. If the Final-Unit-Indication 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 Multiple-Services-Credit-Control 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 Multiple-Services-Credit-Control 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 Multiple-Services-Credit-Control AVP. If no extension AVPs are present, this method returns silently.