Package org.sonar.api.platform
Class Server
- java.lang.Object
-
- org.sonar.api.platform.Server
-
@ScannerSide @ServerSide @ComputeEngineSide public abstract class Server extends java.lang.Object
Runtime information about server- Since:
- 2.2
-
-
Constructor Summary
Constructors Constructor Description Server()
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description abstract java.lang.String
getContextPath()
Context path of web server.abstract java.lang.String
getId()
UUID identifying the installation.abstract java.lang.String
getPermanentServerId()
Deprecated.replaced bygetId()
in 6.7.abstract java.lang.String
getPublicRootUrl()
Return the public root url, without trailing slash, for instance : https://nemo.sonarqube.org.abstract java.util.Date
getStartedAt()
Date when server started.abstract java.lang.String
getVersion()
Non-null version of SonarQube at runtimeabstract boolean
isSecured()
Deprecated.since 5.6, use insteadHttpServletRequest.getHeader(String)
and check that X-Forwarded-Proto header is set to "https".
-
-
-
Method Detail
-
getId
public abstract java.lang.String getId()
UUID identifying the installation. It is persisted so that it does not change over time, even after a restart. In the context of cluster, the value is shared by all the nodes.- Returns:
- a non-null UUID. Format can change over versions.
-
getPermanentServerId
@Deprecated public abstract java.lang.String getPermanentServerId()
Deprecated.replaced bygetId()
in 6.7.Since 6.7, it returns exactlygetId()
. In previous versions it returned ab UUID generated on demand by system administrators and may be null.- Since:
- 2.10
-
getVersion
public abstract java.lang.String getVersion()
Non-null version of SonarQube at runtime
-
getStartedAt
public abstract java.util.Date getStartedAt()
Date when server started. In the context of cluster, this is the date of the startup of the first node. Value is the same on all cluster nodes.
-
getContextPath
public abstract java.lang.String getContextPath()
Context path of web server. Value is blank""
by default. When defined by the propertysonar.web.context
of conf/sonar.properties, then value starts but does not end with slash'/'
, for instance"/sonarqube"
.- Returns:
- non-null but possibly blank path
-
getPublicRootUrl
public abstract java.lang.String getPublicRootUrl()
Return the public root url, without trailing slash, for instance : https://nemo.sonarqube.org.- Since:
- 5.4
-
isSecured
@Deprecated public abstract boolean isSecured()
Deprecated.since 5.6, use insteadHttpServletRequest.getHeader(String)
and check that X-Forwarded-Proto header is set to "https".Return whether or not the {#getPublicRootUrl} is started with https.- Since:
- 5.4
-
-