JAINTM MGCP API (DRAFT FOR PUBLIC REVIEW) - Version 0.9 - 16 NOVEMBER 2000

jain.protocol.ip.mgcp.pkg
Class PackageName

java.lang.Object
  |
  +--jain.protocol.ip.mgcp.pkg.PackageName
All Implemented Interfaces:
java.io.Serializable

public class PackageName
extends java.lang.Object
implements java.io.Serializable

The PackageName class is used to define the names of the MGCP event packages. Two static factory methods are provided: one which accepts the "name" of a package (a string) and an integer value to be associated uniquely with the named package; the other which accepts only the "name" of the package, leaving it to the factory method to assign a unique integer value. Both factory methods return a reference to a PackageName object whose attributes are the name of the package and the associated integer value. If the first factory method is invoked with a name that is already associated with another integer value, or with an integer value that is already associated with another name, the method throws an exception.

See Also:
Serialized Form

Field Summary
static int ALL_PACKAGES
          Signifies the "All Packages" wildcard.
static PackageName AllPackages
          Encapsulates the "All Packages" wildcard constant.
static PackageName Announcement
          Encapsulates the Announcement Server package constant.
static int ANNOUNCEMENT
          Signifies the Announcement Server package.
static PackageName Dtmf
          Encapsulates the DTMF package constant.
static int DTMF
          Signifies the DTMF package.
static int GENERIC_MEDIA
          Signifies the Generic Media package.
static PackageName GenericMedia
          Encapsulates the Generic Media package constant.
static PackageName Handset
          Encapsulates the Handset package constant.
static int HANDSET
          Signifies the Handset package.
static PackageName Line
          Encapsulates the Line package constant.
static int LINE
          Signifies the Line package.
static PackageName Mf
          Encapsulates the MF package constant.
static int MF
          Signifies the MF package.
static PackageName Nas
          Encapsulates the Network Access Server package constant.
static int NAS
          Signifies the Network Access Server package.
static PackageName Rtp
          Encapsulates the RTP package constant.
static int RTP
          Signifies the RTP package.
static PackageName Script
          Encapsulates the Script package constant.
static int SCRIPT
          Signifies the Script package.
static PackageName Trunk
          Encapsulates the Trunk package constant.
static int TRUNK
          Signifies the Trunk package.
static int USER_DEFINED_PACKAGE_START_VALUE
          Represents the initial integer value that can be used for user-defined package names.
 
Method Summary
static PackageName factory(java.lang.String packageName)
          The factory method for generating a new MGCP package where the integer value to be associated with the package is left to the method to supply.
static PackageName factory(java.lang.String packageName, int packageValue)
          The factory method for generating a new MGCP package name where an integer value to be associated with the package name is supplied.
static int getCurrentLargestPackageValue()
          Gets the largest package value that has been used thus far.
 int intValue()
          Gets the integer value that identifies the package uniquely.
 java.lang.String toString()
          Overrides java.lang.Object.toString().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL_PACKAGES

public static final int ALL_PACKAGES
Signifies the "All Packages" wildcard.

AllPackages

public static final PackageName AllPackages
Encapsulates the "All Packages" wildcard constant.

Announcement

public static final PackageName Announcement
Encapsulates the Announcement Server package constant.

ANNOUNCEMENT

public static final int ANNOUNCEMENT
Signifies the Announcement Server package.

Dtmf

public static final PackageName Dtmf
Encapsulates the DTMF package constant.

DTMF

public static final int DTMF
Signifies the DTMF package.

GENERIC_MEDIA

public static final int GENERIC_MEDIA
Signifies the Generic Media package.

GenericMedia

public static final PackageName GenericMedia
Encapsulates the Generic Media package constant.

Handset

public static final PackageName Handset
Encapsulates the Handset package constant.

HANDSET

public static final int HANDSET
Signifies the Handset package.

Line

public static final PackageName Line
Encapsulates the Line package constant.

LINE

public static final int LINE
Signifies the Line package.

Mf

public static final PackageName Mf
Encapsulates the MF package constant.

MF

public static final int MF
Signifies the MF package.

Nas

public static final PackageName Nas
Encapsulates the Network Access Server package constant.

NAS

public static final int NAS
Signifies the Network Access Server package.

Rtp

public static final PackageName Rtp
Encapsulates the RTP package constant.

RTP

public static final int RTP
Signifies the RTP package.

Script

public static final PackageName Script
Encapsulates the Script package constant.

SCRIPT

public static final int SCRIPT
Signifies the Script package.

Trunk

public static final PackageName Trunk
Encapsulates the Trunk package constant.

TRUNK

public static final int TRUNK
Signifies the Trunk package.

USER_DEFINED_PACKAGE_START_VALUE

public static final int USER_DEFINED_PACKAGE_START_VALUE
Represents the initial integer value that can be used for user-defined package names.
Method Detail

factory

public static PackageName factory(java.lang.String packageName)
The factory method for generating a new MGCP package where the integer value to be associated with the package is left to the method to supply.
Parameters:
packageName - The string that represents the name of the package.

factory

public static PackageName factory(java.lang.String packageName,
                                  int packageValue)
                           throws java.lang.IllegalArgumentException
The factory method for generating a new MGCP package name where an integer value to be associated with the package name is supplied.
Parameters:
packageName - The string that represents the name of the package.
packageValue - The integer value to be uniquely associated with the name of the package.
Throws:
java.lang.IllegalArgumentException - Thrown if another package name is already associated with the specified package value, or if the specified package name is already associated with another package value.

getCurrentLargestPackageValue

public static int getCurrentLargestPackageValue()
Gets the largest package value that has been used thus far. When calling PackageName.factory(packageName, packageValue), can use PackageName.getCurrentLargestPackageValue() + 1 for packageValue to ensure that a non-conflicting package value will be used.

intValue

public int intValue()
Gets the integer value that identifies the package uniquely.

toString

public java.lang.String toString()
Overrides java.lang.Object.toString().
Overrides:
toString in class java.lang.Object
Returns:
The name of the package.

JAINTM MGCP API (DRAFT FOR PUBLIC REVIEW) - Version 0.9 - 16 NOVEMBER 2000

Copyright © 2000 Sun Microsystems, Inc.