Class VersioningService
java.lang.Object
org.glassfish.deployment.versioning.VersioningService
This service provides methods to handle application names
in the versioning context
- Author:
- Romain GRECOURT - SERLI (romain.grecourt@serli.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetEnabledVersion(String name, String target) Search for the enabled version of the given application.getEnabledVersionInReferencedTargetsForExpression(String versionExpression) Search the enabled versions on the referenced targets of each version matched by the expression.getEnabledVersionsInReferencedTargets(String versionIdentifier) Search the enabled versions on the referenced targets of the given version.getMatchedVersions(String name, String target) Process the expression matching operation of the given application name.Get the version directory-deployed from the given directoryvoidhandleDisable(String appName, String target, org.glassfish.api.ActionReport report, Subject subject) Disable the enabled version of the application if it exists.
-
Constructor Details
-
VersioningService
public VersioningService()
-
-
Method Details
-
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
Search for the enabled version of the given application.- Parameters:
name- the application nametarget- 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 expressiontarget- 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:
VersioningSyntaxExceptionVersioningException
-
handleDisable
public void handleDisable(String appName, String target, org.glassfish.api.ActionReport report, Subject subject) throws VersioningSyntaxException Disable the enabled version of the application if it exists. This method is used in versioning context.- Parameters:
appName- application's nametarget- an option supply from admin command, it's retained for compatibility with other releasesreport- ActionReport, report object to send back to client.subject- the Subject on whose behalf to run- Throws:
VersioningSyntaxException
-
getVersionFromSameDir
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- *
-