org.exoplatform.commons.info
Class ProductInformations

java.lang.Object
  extended by org.exoplatform.commons.info.ProductInformations
All Implemented Interfaces:
org.picocontainer.Startable

public class ProductInformations
extends Object
implements org.picocontainer.Startable

Version:
$Revision$
Author:
Anouar Chattouna

Field Summary
static String EXO_APPLICATIONS_DATA_NODE_ALIAS
          Constant that will be used in nodeHierarchyCreator.getJcrPath: it represents the Application data root node Alias
static String MIX_VERSIONABLE
          MixinType that will activate the versioning on a selected node
static String PROCEED_UPGRADE_FIRST_TIME_KEY
           
static String PRODUCT_BUILD_NUMBER
           
static String PRODUCT_GROUP_ID
           
static String PRODUCT_REVISION
           
static String PRODUCT_VERSION_DECLARATION_NODE_NAME
          node name where the Product version declaration is
static String PRODUCT_VERSIONS_DECLARATION_FILE
           
static String UPGRADE_PRODUCT_SERVICE_NODE_NAME
          Service application data node name
static String WORKING_WORSPACE_NAME
           
 
Constructor Summary
ProductInformations(org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.container.configuration.ConfigurationManager cmanager, org.exoplatform.container.xml.InitParams initParams)
           
 
Method Summary
 String getBuildNumber()
           
 String getCurrentProductGroupId()
           
 String getPreviousBuildNumber()
           
 String getPreviousRevision()
           
 String getPreviousVersion()
           
 String getPreviousVersion(String productGroupId)
           
 String getProductVersionDeclarationNodePath()
           
 String getRevision()
           
 String getVersion()
           
 String getVersion(String productGroupId)
           
 boolean isFirstRun()
           
 void setPreviousVersionsIfFirstRun(String defaultVersion)
           
 void start()
          This method loads from the JCR the stored products versions.
 void stop()
          This method is called by eXo Kernel when stopping the parent ExoContainer
 void storeProductsInformationsInJCR()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRODUCT_GROUP_ID

public static final String PRODUCT_GROUP_ID
See Also:
Constant Field Values

PRODUCT_REVISION

public static final String PRODUCT_REVISION
See Also:
Constant Field Values

PRODUCT_BUILD_NUMBER

public static final String PRODUCT_BUILD_NUMBER
See Also:
Constant Field Values

PRODUCT_VERSIONS_DECLARATION_FILE

public static final String PRODUCT_VERSIONS_DECLARATION_FILE
See Also:
Constant Field Values

PROCEED_UPGRADE_FIRST_TIME_KEY

public static final String PROCEED_UPGRADE_FIRST_TIME_KEY
See Also:
Constant Field Values

WORKING_WORSPACE_NAME

public static final String WORKING_WORSPACE_NAME
See Also:
Constant Field Values

EXO_APPLICATIONS_DATA_NODE_ALIAS

public static final String EXO_APPLICATIONS_DATA_NODE_ALIAS
Constant that will be used in nodeHierarchyCreator.getJcrPath: it represents the Application data root node Alias

See Also:
Constant Field Values

MIX_VERSIONABLE

public static final String MIX_VERSIONABLE
MixinType that will activate the versioning on a selected node

See Also:
Constant Field Values

UPGRADE_PRODUCT_SERVICE_NODE_NAME

public static final String UPGRADE_PRODUCT_SERVICE_NODE_NAME
Service application data node name

See Also:
Constant Field Values

PRODUCT_VERSION_DECLARATION_NODE_NAME

public static final String PRODUCT_VERSION_DECLARATION_NODE_NAME
node name where the Product version declaration is

See Also:
Constant Field Values
Constructor Detail

ProductInformations

public ProductInformations(org.exoplatform.services.jcr.RepositoryService repositoryService,
                           org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService,
                           org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
                           org.exoplatform.container.configuration.ConfigurationManager cmanager,
                           org.exoplatform.container.xml.InitParams initParams)
Method Detail

getVersion

public String getVersion()
                  throws MissingProductInformationException
Returns:
This method returns the current product's version.
Throws:
MissingProductInformationException

getVersion

public String getVersion(String productGroupId)
                  throws MissingProductInformationException
Returns:
This method return the product version, selected by its maven groupId.
Throws:
MissingProductInformationException

getBuildNumber

public String getBuildNumber()
                      throws MissingProductInformationException
Returns:
the product.buildNumber property value.
Throws:
MissingProductInformationException

getRevision

public String getRevision()
                   throws MissingProductInformationException
Returns:
the product.revision property value.
Throws:
MissingProductInformationException

getCurrentProductGroupId

public String getCurrentProductGroupId()
                                throws MissingProductInformationException
Returns:
the current product's maven group id.
Throws:
MissingProductInformationException

getPreviousVersion

public String getPreviousVersion()
                          throws MissingProductInformationException
Returns:
the platform.version property. This method return the platform version.
Throws:
MissingProductInformationException

getPreviousVersion

public String getPreviousVersion(String productGroupId)
                          throws MissingProductInformationException
Returns:
the platform.version property. This method return the platform version.
Throws:
MissingProductInformationException

getPreviousBuildNumber

public String getPreviousBuildNumber()
                              throws MissingProductInformationException
Returns:
an empty string if the properties file is not found, otherwise the platform.buildNumber property. This method return the build number of the platform.
Throws:
MissingProductInformationException

getPreviousRevision

public String getPreviousRevision()
                           throws MissingProductInformationException
Returns:
the value of product.revision property. This method return the current revison of the platform.
Throws:
MissingProductInformationException

isFirstRun

public boolean isFirstRun()

start

public void start()
This method loads from the JCR the stored products versions. If it's the first server start up, then store the declared one.

Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
This method is called by eXo Kernel when stopping the parent ExoContainer

Specified by:
stop in interface org.picocontainer.Startable

storeProductsInformationsInJCR

public void storeProductsInformationsInJCR()

getProductVersionDeclarationNodePath

public String getProductVersionDeclarationNodePath()

setPreviousVersionsIfFirstRun

public void setPreviousVersionsIfFirstRun(String defaultVersion)


Copyright © 2013 eXo Platform SAS. All Rights Reserved.