Class VersioningService
- java.lang.Object
-
- org.glassfish.deployment.versioning.VersioningService
-
@Service @PerLookup public class VersioningService extends Object
This service provides methods to handle application names in the versioning context- Author:
- Romain GRECOURT - SERLI ([email protected])
-
-
Constructor Summary
Constructors Constructor Description VersioningService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 directoryvoid
handleDisable(String appName, String target, ActionReport report, Subject subject)
Disable the enabled version of the application if it exists.
-
-
-
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 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:
VersioningSyntaxException
VersioningException
-
handleDisable
public void handleDisable(String appName, String target, 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
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
- *
-
-