Class ApplicationVersion
- java.lang.Object
-
- com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationVersion
-
- All Implemented Interfaces:
Comparable<ApplicationVersion>
public class ApplicationVersion extends Object implements Comparable<ApplicationVersion>
An application package version, identified by a source revision and a build number.- Author:
- bratseth, mpolden, jonmv
-
-
Field Summary
Fields Modifier and Type Field Description static ApplicationVersionunknownUsed in cases where application version cannot be determined, such as manual deployments (e.g.
-
Constructor Summary
Constructors Constructor Description ApplicationVersion(Optional<SourceRevision> source, OptionalLong buildNumber, Optional<String> authorEmail, Optional<com.yahoo.component.Version> compileVersion, Optional<Instant> buildTime, Optional<String> sourceUrl, Optional<String> commit, boolean deployedDirectly)Public for serialisation only.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>authorEmail()Returns the email of the author of commit of this version, if knownOptionalLongbuildNumber()Returns the build number that built this versionOptional<Instant>buildTime()Returns the time this package was built, if known.Optional<String>commit()Returns the commit name of this application version.intcompareTo(ApplicationVersion o)Optional<com.yahoo.component.Version>compileVersion()Returns the Vespa version this package was compiled against, if known.booleanequals(Object o)static ApplicationVersionfrom(SourceRevision source, long buildNumber)Create an application package version from a completed build, without an author emailstatic ApplicationVersionfrom(SourceRevision source, long buildNumber, String authorEmail, com.yahoo.component.Version compileVersion, Instant buildTime)Creates a version from a completed build, an author email, and build meta data.static ApplicationVersionfrom(Optional<SourceRevision> source, long buildNumber, Optional<String> authorEmail, Optional<com.yahoo.component.Version> compileVersion, Optional<Instant> buildTime, Optional<String> sourceUrl, Optional<String> commit, boolean deployedDirectly)Creates a version from a completed build, an author email, and build meta data.inthashCode()Stringid()Returns a unique identifier for this version or "unknown" if version is not knownbooleanisDeployedDirectly()Returns whether the application package for this version was deployed directly to zonebooleanisUnknown()Returns whether this is unknownOptional<SourceRevision>source()Returns information about the source of this revision, or empty if the source is not know/defined (which is the case for command-line deployment from developers, but never for deployment jobs)Optional<String>sourceUrl()Returns the source URL for this application version.StringtoString()
-
-
-
Field Detail
-
unknown
public static final ApplicationVersion unknown
Used in cases where application version cannot be determined, such as manual deployments (e.g. in dev environment)
-
-
Constructor Detail
-
ApplicationVersion
public ApplicationVersion(Optional<SourceRevision> source, OptionalLong buildNumber, Optional<String> authorEmail, Optional<com.yahoo.component.Version> compileVersion, Optional<Instant> buildTime, Optional<String> sourceUrl, Optional<String> commit, boolean deployedDirectly)
Public for serialisation only.
-
-
Method Detail
-
from
public static ApplicationVersion from(SourceRevision source, long buildNumber)
Create an application package version from a completed build, without an author email
-
from
public static ApplicationVersion from(SourceRevision source, long buildNumber, String authorEmail, com.yahoo.component.Version compileVersion, Instant buildTime)
Creates a version from a completed build, an author email, and build meta data.
-
from
public static ApplicationVersion from(Optional<SourceRevision> source, long buildNumber, Optional<String> authorEmail, Optional<com.yahoo.component.Version> compileVersion, Optional<Instant> buildTime, Optional<String> sourceUrl, Optional<String> commit, boolean deployedDirectly)
Creates a version from a completed build, an author email, and build meta data.
-
id
public String id()
Returns a unique identifier for this version or "unknown" if version is not known
-
source
public Optional<SourceRevision> source()
Returns information about the source of this revision, or empty if the source is not know/defined (which is the case for command-line deployment from developers, but never for deployment jobs)
-
buildNumber
public OptionalLong buildNumber()
Returns the build number that built this version
-
authorEmail
public Optional<String> authorEmail()
Returns the email of the author of commit of this version, if known
-
compileVersion
public Optional<com.yahoo.component.Version> compileVersion()
Returns the Vespa version this package was compiled against, if known.
-
isUnknown
public boolean isUnknown()
Returns whether this is unknown
-
isDeployedDirectly
public boolean isDeployedDirectly()
Returns whether the application package for this version was deployed directly to zone
-
compareTo
public int compareTo(ApplicationVersion o)
- Specified by:
compareToin interfaceComparable<ApplicationVersion>
-
-