Oracle Server E10293-02 Benutzerhandbuch

Seite von 108
Dictionary
Programming Oracle Diameter Applications
B-9
Example B–10
Defining the <enum> Element
<dictionary>
      <vendor id=
"
10415
"
 name=
"
3GPP
"
>
         <avp name=
"
Accounting-Record-Type
"
            code=
"
480
"
            mandatory=
"
must
"
            protected=
"
may
"
            may-encrypt=
"
yes
"
>
               <type type-name=
"
Unsigned32
"
/>
               <enum name=
"
EVENT_RECORD
"
 code=
"
1
"
/>
               <enum name=
"
START_RECORD
"
 code=
"
2
"
/>
               <enum name=
"
INTERIM_RECORD
"
 code=
"
3
"
/>
               <enum name=
"
STOP_RECORD
"
 code=
"
4
"
/>
         </avp>
      </vendor>
</dictionary>
grouped Element
The <grouped> element defines an AVP which encapsulates a sequence of AVPs 
together as a single payload. It consists in grouping one or more <gavp> elements. 
This way, a single "grouped" element can contain references to multiple AVPs. Each 
<gavp>
 element holds an AVP name and a vendor-id attribute.
The <gavp> attributes are:
1.
The gavp name attribute must correspond to some existing AVP’s name attribute.
2.
The gavp vendor-id attribute refers to an existing vendor’s id attribute.
, the 3GPP vendor defines an AVP named "CC-Money" which is a 
set of previously defined AVPs named "Unit-Value" and "Currency-Code".
Example B–11
Defining the <grouped> and <gavp> Elements
<dictionary>
      <vendor id=
"
10415
"
 name=
"
3GPP
"
>
         <avp name=
"
CC-Money
"
            code=
"
413
"
            mandatory=
"
must
"
            protected=
"
may
"
            may-encrypt=
"
yes
"
>
               <grouped>
                  <gavp name=
"
Unit-Value
"
 />
                  <gavp name=
"
Currency-Code
"
 />
                  ....
               </grouped>
         </avp>
      </vendor>
</dictionary
Dictionary Extension
Once the Diameter dictionary extension has been defined, use the extendGrammar() 
method to apply the extension to the default dictionary as follows:.
//--> Define dictionary extension string
String myDictionary =
   
"
<?xml version=\
"
1.0\
"
 encoding=\
"
UTF-8\
"
?>\n
"
             +
   
"
<!DOCTYPE dictionary SYSTEM \
"
dictionary.dtd\
"
>\n
"
        +
   
"
<dictionary>\n
"
                                           +