org.glassfish.deployment.versioning
Class VersioningService

java.lang.Object
  extended by org.glassfish.deployment.versioning.VersioningService

@Service
@Scoped(value=org.jvnet.hk2.component.PerLookup.class)
public class VersioningService
extends Object

This service provides methods to handle application names in the versioning context

Author:
Romain GRECOURT - SERLI (romain.grecourt@serli.com)

Constructor Summary
VersioningService()
           
 
Method Summary
 String getEnabledVersion(String name, String target)
          Search for the enabled version of the given application.
 Map<String,Set<String>> getEnabledVersionInReferencedTargetsForExpression(String versionExpression)
          Search the enabled versions on the referenced targets of each version matched by the expression.
 Map<String,Set<String>> getEnabledVersionsInReferencedTargets(String versionIdentifier)
          Search the enabled versions on the referenced targets of the given version.
 List<String> getMatchedVersions(String name, String target)
          Process the expression matching operation of the given application name.
 String getVersionFromSameDir(File dir)
          Get the version directory-deployed from the given directory
 void handleDisable(String appName, String target, ActionReport report)
          Disable the enabled version of the application if it exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersioningService

public VersioningService()
Method Detail

getEnabledVersionInReferencedTargetsForExpression

public Map<String,Set<String>> getEnabledVersionInReferencedTargetsForExpression(String versionExpression)
                                                                          throws VersioningSyntaxException
Search the enabled versions on the referenced targets of each version matched by the expression. This method is designed to be used with domain target. As different versions maybe enabled on different targets, the return type used is a map.

Parameters:
versionExpression - a version expression (that contains wildcard character)
Returns:
a map matching the enabled versions with their target(s)
Throws:
VersioningSyntaxException - if getEnabledVersion throws an exception

getEnabledVersionsInReferencedTargets

public Map<String,Set<String>> getEnabledVersionsInReferencedTargets(String versionIdentifier)
                                                              throws VersioningSyntaxException
Search the enabled versions on the referenced targets of the given version. This method is designed to be used with domain target. As different versions maybe enabled on different targets, the return type used is a map.

Parameters:
versionIdentifier - a version expression (that contains wildcard character)
Returns:
a map matching the enabled versions with their target(s)
Throws:
VersioningSyntaxException - if getEnabledVersion throws an exception

getEnabledVersion

public final String getEnabledVersion(String name,
                                      String target)
                               throws VersioningSyntaxException
Search for the enabled version of the given application.

Parameters:
name - the application name
target - an option supply from admin command, it's retained for compatibility with other releases
Returns:
the enabled version of the application, if exists
Throws:
VersioningSyntaxException - if getUntaggedName throws an exception

getMatchedVersions

public final List<String> getMatchedVersions(String name,
                                             String target)
                                      throws VersioningSyntaxException,
                                             VersioningException
Process the expression matching operation of the given application name.

Parameters:
name - the application name containing the version expression
target - the target we are looking for the verisons
Returns:
a List of all expression matched versions, return empty list if no version is registered on this target or if getUntaggedName throws an exception
Throws:
VersioningSyntaxException
VersioningException

handleDisable

public void handleDisable(String appName,
                          String target,
                          ActionReport report)
                   throws VersioningSyntaxException
Disable the enabled version of the application if it exists. This method is used in versioning context.

Parameters:
appName - application's name
target - an option supply from admin command, it's retained for compatibility with other releases
report - ActionReport, report object to send back to client.
Throws:
VersioningSyntaxException

getVersionFromSameDir

public String getVersionFromSameDir(File dir)
                             throws VersioningSyntaxException
Get the version directory-deployed from the given directory

Parameters:
directory -
Returns:
the name of the version currently using the directory, else null
Throws:
VersioningSyntaxException - *


Copyright © 2012. All Rights Reserved.