com.sun.messaging

## Class Version

- java.lang.Object
- - com.sun.messaging.Version

-     public final class Version
      extends java.lang.Object

  This class provides the Version information about the product. The information provided is only returning the version inofrmation for the client. It is quite possible that the broker may be running at a different version level. The version information such as Major release version , Minor release version service pack ,Product build date , JMS API version , Product name , Protocol version etc can be obtained through the various helper methods exposed by this class.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `LONG_COPYRIGHT` Deprecated.
    `static int` | `MINI_COPYRIGHT` Deprecated.
    `static int` | `SHORT_COPYRIGHT` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Version()` Constructor for this class

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `compareVersions(int[] s1, int[] s2)` Deprecated.
    `static int` | `compareVersions(java.lang.String stra, java.lang.String strb)` Deprecated.
    `static int` | `compareVersions(java.lang.String verA, java.lang.String verB, boolean ignoreServicePack)` Deprecated.
    `java.lang.String` | `getAbbreviatedProductName()` Deprecated.
    `java.lang.String` | `getBanner(boolean alldata)` Deprecated.
    `java.lang.String` | `getBanner(boolean alldata, int copyrightType)` Deprecated.
    `java.lang.String` | `getBuildDate()` Deprecated.
    `java.lang.String` | `getBuildMilestone()` Deprecated.
    `java.lang.String` | `getBuildVersion()` Deprecated.
    `java.lang.String` | `getCopyright(int copyrightType)` Deprecated.
    `java.lang.String` | `getHeader()` Deprecated.
    `java.lang.String` | `getHeader(int copyrightType)` Deprecated.
    `java.lang.String` | `getImplementationVersion()` Returns the implementation version of the product example 3.6
    `static int[]` | `getIntVersion(java.lang.String str)` Returns the Version info in the form of an array of integer.
    `java.lang.String` | `getJMSAdminSpiVersion()` Deprecated.
    `java.lang.String` | `getLowerCaseAbbreviatedProductName()` Deprecated.
    `int` | `getMajorVersion()` Returns the Major release of the Product version for example if the release value is 3.6.1 then the major version value will be 3.
    `int` | `getMinorVersion()` Returns the Minor release of the Product version for example if the release value is 3.6.1 then the returned value of minor version will be 6
    `java.lang.String[]` | `getPatchIds()` Deprecated.
    `java.lang.String` | `getPatchString()` Deprecated.
    `java.lang.String` | `getProductCompanyName()` Deprecated.
    `java.lang.String` | `getProductCopyrightDate()` Deprecated.
    `java.lang.String` | `getProductName()` Returns the product name example Oracle GlassFish(tm) Server Message Queue
    `java.lang.String` | `getProductVersion()` Deprecated.
    `java.util.Properties` | `getProps()` Deprecated.
    `java.lang.String` | `getProtocolVersion()` Deprecated.
    `java.lang.String` | `getReleaseQID()` Deprecated.
    `java.lang.String` | `getShortProductName()` Deprecated.
    `java.lang.String` | `getTargetJMSVersion()` Returns the JMS API version the product implements example 1.1
    `java.lang.String` | `getUserAgent()` Deprecated.
    `java.lang.String` | `getVersion()` Returns the Version info of the product, this string is the concatanated value of pacakage name, API version, Protocol version, JMS API version, and the patch information.
    `java.lang.String` | `getVersionPackageName()` Deprecated.
    `java.lang.String` | `getVersionProperty(java.lang.String name)` Deprecated.
    `static void` | `main(java.lang.String[] args)` Deprecated.
    `java.lang.String` | `toString()` Deprecated.
    `static java.lang.String` | `toVersionString(int[] ver)` Deprecated.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### MINI_COPYRIGHT

          @Deprecated
          public static final int MINI_COPYRIGHT

      Deprecated.
      Represents the mini copyright value for the product
      See Also:
        Constant Field Values

    - #### SHORT_COPYRIGHT

          @Deprecated
          public static final int SHORT_COPYRIGHT

      Deprecated.
      Represents the short copyright value for the product
      See Also:
        Constant Field Values

    - #### LONG_COPYRIGHT

          @Deprecated
          public static final int LONG_COPYRIGHT

      Deprecated.
      Represents the long copyright value for the product
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Version

          public Version()

      Constructor for this class

  - ### Method Detail

    - #### getProps

          @Deprecated
          public java.util.Properties getProps()

      Deprecated.
      Returns the properties object that holds the various version properties and their values. This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        Properties object holding the name value pair of the version property name and it's corresponding values

    - #### getProductVersion

          @Deprecated
          public java.lang.String getProductVersion()

      Deprecated.
      Returns the product version as a string The returned string has the information about the major release, minor release and service packs if any example 3.6 SP1 This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the product version

    - #### getMajorVersion

          public int getMajorVersion()

      Returns the Major release of the Product version for example if the release value is 3.6.1 then the major version value will be 3.
      Returns:
        an integer representing the major release version value if there is an exception returns -1

    - #### getMinorVersion

          public int getMinorVersion()

      Returns the Minor release of the Product version for example if the release value is 3.6.1 then the returned value of minor version will be 6
      Returns:
        an integer representing the minor release version value if there is an exception returns -1

    - #### getVersionProperty

          @Deprecated
          public java.lang.String getVersionProperty(java.lang.String name)

      Deprecated.
      Returns the value of the particular version property for example if the requested property is 'imq.product.version' the returned value will be 3.6 This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `name` - String representing the name of the property whose value is desired
      Returns:
        String representing the value of the desired property

    - #### getBuildMilestone

          @Deprecated
          public java.lang.String getBuildMilestone()

      Deprecated.
      Returns the Build Mile Stone value of the product being used for example 'Beta' This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the Milestone Build value of the product

    - #### getBuildDate

          @Deprecated
          public java.lang.String getBuildDate()

      Deprecated.
      Returns the Build date value of the product in the following format 'Day Month Date Time Year' example Mon June 1 09:03:29 IST 2004 This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the date of the build of the product being used

    - #### getBuildVersion

          @Deprecated
          public java.lang.String getBuildVersion()

      Deprecated.
      Returns the Build version value of the product The returned string is the concatnated value of the product version,build number and promoted build. This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the Build Version of the product being used

    - #### getProductName

          public java.lang.String getProductName()

      Returns the product name example Oracle GlassFish(tm) Server Message Queue
      Returns:
        String representing the name of the product

    - #### getReleaseQID

          @Deprecated
          public java.lang.String getReleaseQID()

      Deprecated.
      Returns the product release
      Returns:
        String representing version (no longer returns release quarter)

    - #### getAbbreviatedProductName

          @Deprecated
          public java.lang.String getAbbreviatedProductName()

      Deprecated.
      Returns the abbreviated name of the product, for example "MQ". This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the abbreviated name of the product

    - #### getLowerCaseAbbreviatedProductName

          @Deprecated
          public java.lang.String getLowerCaseAbbreviatedProductName()

      Deprecated.
      Returns the lower case of the abbreviated name of the product, for example "mq". This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the abbreviated name of the product

    - #### getShortProductName

          @Deprecated
          public java.lang.String getShortProductName()

      Deprecated.
      Returns the short name of the product, for example "Message Queue". This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the short name of the product

    - #### getProductCopyrightDate

          @Deprecated
          public java.lang.String getProductCopyrightDate()

      Deprecated.
      Returns the copyright date of the product example copyright 2004 This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the copyright date of the product

    - #### getProductCompanyName

          @Deprecated
          public java.lang.String getProductCompanyName()

      Deprecated.
      Returns the product company's name example Sun Microsystems Inc This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the Product Company's name

    - #### getVersionPackageName

          @Deprecated
          public java.lang.String getVersionPackageName()

      Deprecated.
      Returns the implementation package name of the product example (com.sun.messaging) This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the pacakge name

    - #### getImplementationVersion

          public java.lang.String getImplementationVersion()

      Returns the implementation version of the product example 3.6
      Returns:
        String representing the implementation version of the product

    - #### getProtocolVersion

          @Deprecated
          public java.lang.String getProtocolVersion()

      Deprecated.
      Returns the protocol version of the product. There is a properitory protocol used to communicate with the broker and amongst the brokers.This value will tell which version is currently being used. If there are no change's then the previous value will be carried forward and retuned. example 3.6 This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String representing the protocol version of the product

    - #### getTargetJMSVersion

          public java.lang.String getTargetJMSVersion()

      Returns the JMS API version the product implements example 1.1
      Returns:
        String representing the JMS API version which the product is compliant to

    - #### getUserAgent

          @Deprecated
          public java.lang.String getUserAgent()

      Deprecated.
      Returns the User Agent value of the product. This is the concatnated string having values of Productversion, Operating System on which the product runs, the version of the operating system and the operating system architecture example : SJSMQ/3.6 (JMS; SunOS 5.9 sun4u) This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        the String representing the value of the UserAgent

    - #### toString

          @Deprecated
          public java.lang.String toString()

      Deprecated.
      Returns the banner for the product. The banner comprises of the Product name,Company name Product version, Build value, Build Date, Copyright value in a formatted manner This is a private method , not for general use.This method may be removed in the future release without further warning
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        String representing the banner

    - #### getHeader

          @Deprecated
          public java.lang.String getHeader()

      Deprecated.
      Returns the header value for the banner being used for the product This header value will be for the SHORT_COPYRIGHT value by default. This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        a string reperesenting the header details

    - #### getHeader

          @Deprecated
          public java.lang.String getHeader(int copyrightType)

      Deprecated.
      Returns the header for the given copyright This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `copyrightType` - an integer value of the valid copyright type MINI_COPYRIGHT, SHORT_COPYRIGHT, LONG_COPYRIGHT
      Returns:
        String value of the header

    - #### getCopyright

          @Deprecated
          public java.lang.String getCopyright(int copyrightType)

      Deprecated.
      Returns the copyright value for the desired copyright type passed as an argument This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `copyrightType` - an integer value of the copyright type valid values are MINI_COPYRIGHT, SHORT_COPYRIGHT, LONG_COPYRIGHT
      Returns:
        String value of the copyright

    - #### getPatchIds

          @Deprecated
          public java.lang.String[] getPatchIds()

      Deprecated.
      Returns patch ID's for the product which will be an array of String comprising of all the patches for this product. Each entry will be in the following format 'Major version.Minor Version_patchid number' Can be used to format the patchids in your own app. This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        array of String comprising the patchid's

    - #### getPatchString

          @Deprecated
          public java.lang.String getPatchString()

      Deprecated.
      Returns the patch string in the format: Installed Patch ID(s): 111111-01 222222-01 NNNNNN-NN This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        a string representing all the patches for the product.

    - #### getJMSAdminSpiVersion

          @Deprecated
          public java.lang.String getJMSAdminSpiVersion()

      Deprecated.
      Returns the JMSAdmin SPI version value of the product. This is the Admin SPI implementation value. The value is not the same as the Product API implementation or the JMS API version. example 2.0 This is a private method , not for general use.This method may be removed in the future release without further warning
      Returns:
        String value of the JMSAdmin SPI version

    - #### getVersion

          public java.lang.String getVersion()

      Returns the Version info of the product, this string is the concatanated value of pacakage name, API version, Protocol version, JMS API version, and the patch information.
      Returns:
        the String value of the product version info

    - #### getBanner

          @Deprecated
          public java.lang.String getBanner(boolean alldata)

      Deprecated.
      Returns the banner details for the default copyright type: SHORT_COPYRIGHT This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `alldata` - a boolean value indicating that is it desired to get a detailed info
      Returns:
        a String representing the banner

    - #### getBanner

          @Deprecated
          public java.lang.String getBanner(boolean alldata,
                                                        int copyrightType)

      Deprecated.
      Returns the banner details for a given copyright type. This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `alldata` - a boolean value indicating whether you want a detailed info(true) or not(false)
        `copyrightType` - an integer representing the copyright for which the banner detail is required valid values are SHORT_COPYRIGHT, MINI_COPYRIGHT, LONG_COPYRIGHT
      Returns:
        the string representing the banner

    - #### getIntVersion

          public static int[] getIntVersion(java.lang.String str)
                                     throws java.lang.NumberFormatException

      Returns the Version info in the form of an array of integer. Parse a version string into four integers. The four integers represent the major product version , minor product version , micro product version and the service pack. This method handles both MQ service pack convetions (sp1) and JDK patch convention (_01). It also handles the JDK convetion of using a '-' to delimit a milestone string. In this case everything after the - is ignored. Examples: 3.0.1sp2 = 3 0 1 2 , 3.0.1 sp 2 = 3 0 1 2 , 3.5 sp 2 = 3 5 0 2 , 3.5.0.2 = 3 5 0 2 , 1.4.1_02 = 1 4 1 2 , 1.4_02 = 1.4 0 2 , 2 = 2 0 0 0 , 1.4.1-beta2 = 1 4 1 0
      Parameters:
        `str` - String representing the product version
      Returns:
        array of integers where int[0] = major Version int[1]=minor version int[3]=micro version int[4]= service pack
      Throws:
        `java.lang.NumberFormatException`

    - #### compareVersions

          @Deprecated
          public static int compareVersions(java.lang.String stra,
                                                        java.lang.String strb)

      Deprecated.
      Returns the comparison result of the two versions of the product passed as argument assuming service packs have no incompatibilities This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `stra` - representing the version which need to be compared
        `strb` - representing the second version string that needs to be compared.
      Returns:
        -1 If stra is less than strB 0 If stra is equal to strb 1 If stra is greater than strbB

    - #### compareVersions

          @Deprecated
          public static int compareVersions(java.lang.String verA,
                                                        java.lang.String verB,
                                                        boolean ignoreServicePack)
                                                 throws java.lang.NumberFormatException

      Deprecated.
      Returns the Comparison results of the two product versions. This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `verA` - First version string
        `verB` - Second version string
        `ignoreServicePack` - true to ignore the service pack or patch level
      Returns:
        -1 If verA is less than verB 0 If verA is equal to verB 1 If verA is greater than verB
      Throws:
        `java.lang.NumberFormatException`

    - #### compareVersions

          @Deprecated
          public static int compareVersions(int[] s1,
                                                        int[] s2)

      Deprecated.
      Compares the two versions which are in the form of array,s. The array encapsulate's the major,minor,micro and service pack details of each version string. This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `s1` - the first array of integer representing the versin info
        `s2` - the second array of interger representing the version info that has to be compared
      Returns:
        -1 If s1 is less than s2 0 If s1 is equal to s2 1 If s1 is greater than s2

    - #### toVersionString

          @Deprecated
          public static java.lang.String toVersionString(int[] ver)

      Deprecated.
      Returns the Version String value of the version info passed as an array of integer This is a private method , not for general use.This method may be removed in the future release without further warning
      Parameters:
        `ver` - an array of integer reperesenting the version info int[0]=major int[1]=minor int[2]=micro int[3]=service pack
      Returns:
        a String value of the data passed in the integer array

    - #### main

          @Deprecated
          public static void main(java.lang.String[] args)

      Deprecated.
      This method makes the class executable. When the class is executed the product banner will be printed providing information comprising of product version , product name , organization name build details and the short copyright info. This is a private method , not for general use.This method may be removed in the future release without further warning

Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved.