Java Doc for ProductVersionHolder.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » services » info » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.iapi.services.info 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.services.info.ProductVersionHolder

ProductVersionHolder
final public class ProductVersionHolder implements java.security.PrivilegedAction(Code)
Class to hold a cloudscape Product version. This class includes the following product version features.
  1. Save the product version information this holds as a String. We call the string a 'product version string'.
  2. Construct a ProductVersionHolder from a valid 'product version string'.
  3. Determine if two product versions are feature compatible. This means products of these versions may interoperate with ***NO*** compatibility problems.
  4. Determine if two product versions are the same. This is a stronger test than the test for feature compatibility.
Cloudscape 5.1 and older versions used the majorVersion, minorVersion, maintVersion versions directly. That is a three part version number, majorVersion.minorVersion.maintVersion, e.g. 5.1.21. For Cloudscape 5.2 onwards a four part name is required. majorVersion.minorVersion.fixPack.bugVersion e.g. 5.2.1.2 This follows the IBM standard and allows us to state that a fix pack will be 5.2.3 without worrying about how many maintence fixes there are between fix packs. We implement this using the existing format of ProductVersionHolder to reduce disruption to the code, however we make the maintVersion encode the {fixPack.bugVersion}. Since the maintVersion is represented by a int (2G values) we have plenty of room for encoding. If we assign a given majorVersion.minorVersion.fixPack a 10 year life, then we about the maximum number of individual releases it can have is 10 years * 365 days/year = 3650. Thus with the pre 5.2 scheme we would not expect a 5.1.x to have an x > 3650 (approximately). Usually the rate of point releases has been much less than one per day, 5.1.31 is released about 225 days after GA which makes around a point release every 7 days. But in the encoding we need to be conservative. With fix packs the maximum is about 2 per year and fix packs are only made to the current release, thus with a yearly minor release cycle we would imagine only 2 fixpacks per major.minor. However like other IBM products or release cycle may be extended thus we can expect up to a handful of fix packs. Thus we might imagine releases like 5.2.0.12 5.2.0.234 5.2.1.34 5.2.4.2445 but highly unlikey to have 5.2.2.59321 5.2.23.1 The encoding number must continue to increase so that the encodedMaintB > encodedMaintA if (fixPackB > fixPackA) || ((fixPackB == fixPackA) && (bugB > bugA)) Selected encoding encodedMaint = (fixPack * 1,000,000) + (bugVersion); Handles many many fixpacks and upto one million bug fixes per fix pack and remains somewhat human readable. Special fix packs fixpack == 0 = alpha (version off main codeline) fixpack == 1 = first release of major.minor (may be marked with beta) fixpack == 2 = first fix pack (displayed as 1) The drdaMaintVersion is sent in the Network Server PRDID. It never displays but may be used by the client for version specific behaviour. It should be reset to 0 with each minor release. The product version string has the form:
 productVendorName - ProductName - majorVersion.minorVersion.maintVersion [beta] - (buildNumber)
 




Method Summary
public static  StringfullVersionString(int major, int minor, int maint, boolean isBeta, String build)
    
public  StringgetBuildNumber()
     Return the build number for this product.
public  intgetBuildNumberAsInt()
     Return the build number as an integer if possible, mapping from the SVN number.
public  intgetDrdaMaintVersion()
     Return the drda protocol maintenance version for this minor release.
public  intgetFixPackVersion()
     Return the fix pack version from the maintence encoding.
public  intgetMaintVersion()
     Return the encoded maintainence version number.
public  intgetMajorVersion()
     Return the major version number.
public  intgetMinorVersion()
     Return the minor version number.
public  StringgetProductName()
     Return the external product name.
public  StringgetProductTechnologyName()
    
public  StringgetProductVendorName()
     Return the product vendor name.
public static  ProductVersionHoldergetProductVersionHolder(String productVendorName, String productName, String productTechnologyName, int majorVersion, int minorVersion, int maintVersion, int drdaMaintVersion, String buildNumber, Boolean isBeta)
     Create a valid ProductVersionHolder.
public static  ProductVersionHoldergetProductVersionHolder(Properties p)
     Get a ProductVersionHolder based on the information in the Properties object provided.
Parameters:
  p - The properties object that holds the productVersioninformation.
public static  ProductVersionHoldergetProductVersionHolderFromMyEnv(String productGenus)
     Get a ProductVersionHolder for a product of a given genus, that is available in the caller's environment.
public static  ProductVersionHoldergetProductVersionHolderFromMyEnv(InputStream propertiesStream)
     Load the version info from the already opened properties files. We need to do this because if the jar files (e.g.
public  StringgetSimpleVersionString()
     Return the feature version string, ie.
public  StringgetVersionBuildString(boolean withBuild)
     Returns a short-hand value for the product version string.
public  booleanisAlpha()
     Return true if this is a alpha product.
public  booleanisBeta()
     Return true if this is a beta product.
final public  Objectrun()
    
public static  StringsimpleVersionString(int major, int minor, boolean isBeta)
     Convert a major and minor number with beta status into a string.
public  StringtoString()
     Return a string representation of this ProductVersion.



Method Detail
fullVersionString
public static String fullVersionString(int major, int minor, int maint, boolean isBeta, String build)(Code)



getBuildNumber
public String getBuildNumber()(Code)
Return the build number for this product.



getBuildNumberAsInt
public int getBuildNumberAsInt()(Code)
Return the build number as an integer if possible, mapping from the SVN number. nnnnn -> returns nnnnn nnnnnM -> returns -nnnnn indicates a modified code base nnnnn:mmmmm -> returns -nnnnn anything else -> returns -1



getDrdaMaintVersion
public int getDrdaMaintVersion()(Code)
Return the drda protocol maintenance version for this minor release. Starts at 0 for each minor release and only incremented when client behaviour changes based on the server version.



getFixPackVersion
public int getFixPackVersion()(Code)
Return the fix pack version from the maintence encoding.



getMaintVersion
public int getMaintVersion()(Code)
Return the encoded maintainence version number.



getMajorVersion
public int getMajorVersion()(Code)
Return the major version number.



getMinorVersion
public int getMinorVersion()(Code)
Return the minor version number.



getProductName
public String getProductName()(Code)
Return the external product name.



getProductTechnologyName
public String getProductTechnologyName()(Code)



getProductVendorName
public String getProductVendorName()(Code)
Return the product vendor name.



getProductVersionHolder
public static ProductVersionHolder getProductVersionHolder(String productVendorName, String productName, String productTechnologyName, int majorVersion, int minorVersion, int maintVersion, int drdaMaintVersion, String buildNumber, Boolean isBeta)(Code)
Create a valid ProductVersionHolder. If any of the parameters provided is invalid, this returns null.
Parameters:
  productName - The name of the product. productName.length()must be greater than 0. The syntax for a product name is'productGenus[:productSpecies]'.
Parameters:
  majorVersion - The most significant portion of a 3 part product version. Must be non-negative.
Parameters:
  minorVersion - The second portion of a 3 part product version. Must be non-negative.
Parameters:
  maintVersion - The least significant portion of a 3 partproduct version. Must be non-negative.
Parameters:
  drdaMaintVersion - The protocol modification number for minor release.
Parameters:
  buildNumber - The buildNumber for a product.
Parameters:
  isBeta - true iff the product is beta. A valid ProductVersionHolder of null if any of the parametersprovided are not valid.



getProductVersionHolder
public static ProductVersionHolder getProductVersionHolder(Properties p)(Code)
Get a ProductVersionHolder based on the information in the Properties object provided.
Parameters:
  p - The properties object that holds the productVersioninformation. The ProductVersionHolder or null ifa product with the given genus is not available in thecaller's environment.



getProductVersionHolderFromMyEnv
public static ProductVersionHolder getProductVersionHolderFromMyEnv(String productGenus)(Code)
Get a ProductVersionHolder for a product of a given genus, that is available in the caller's environment. Even though this uses a priv bock, it may stil fail when the jar the version is being fetched from, is different to the one that loaded this class, AND the jars are in different security contexts.
Parameters:
  productGenus - The genus for the product. The ProductVersionHolder or null ifa product with the given genus is not available in thecaller's environment.



getProductVersionHolderFromMyEnv
public static ProductVersionHolder getProductVersionHolderFromMyEnv(InputStream propertiesStream)(Code)
Load the version info from the already opened properties files. We need to do this because if the jar files (e.g. db2jtools and db2j) are in different security contexts (entries in the policy files) then we cannot load the version information for one of them correctly. This is because the this class will either have been loaded from only one of the jars and hence can only access the resource in its own jar. By making code specific to the jar open the resource we are guaranteed it will work.



getSimpleVersionString
public String getSimpleVersionString()(Code)
Return the feature version string, ie. major.minor. (e.g. 5.2)



getVersionBuildString
public String getVersionBuildString(boolean withBuild)(Code)
Returns a short-hand value for the product version string. Used by Sysinfo. Includes the optional designation



isAlpha
public boolean isAlpha()(Code)
Return true if this is a alpha product.



isBeta
public boolean isBeta()(Code)
Return true if this is a beta product.



run
final public Object run()(Code)



simpleVersionString
public static String simpleVersionString(int major, int minor, boolean isBeta)(Code)
Convert a major and minor number with beta status into a string.



toString
public String toString()(Code)
Return a string representation of this ProductVersion. The difference between this and createProductVersionString, is that this method retruns a String when this ProductVersionHolder holds invalid version information.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.