jetbrains.buildServer.serverSide
Interface SBuildServer

All Superinterfaces:
BuildServer, BuildServerState, BuildsManager, ExtensionHolder, ExtensionsProvider, RootUrlHolder, RunningBuildsManager, ServerExtensionHolder, ServiceLocator

public interface SBuildServer
extends BuildServer, RootUrlHolder, ServerExtensionHolder, BuildsManager, BuildServerState

This is one of the core components of the TeamCity server-side support. It manages many aspects of TeamCity, for instance:

Author:
Kir
See Also:
ProjectManager, RunningBuildsManager, BuildHistory, UserModel, VcsManager, ServerExtensionHolder

Nested Class Summary
 
Nested classes/interfaces inherited from interface jetbrains.buildServer.ExtensionsProvider
ExtensionsProvider.ExtensionAction<T extends TeamCityExtension>
 
Method Summary
 void addListener(BuildServerListener listener)
          Add global TeamCity listener.
 boolean flushQueue()
          Check for free build agents and try to send builds from queue to build agents.
 java.io.File getArtifactsDirectory()
          Deprecated. use ServerPaths.getArtifactsDirectory() instead
 BuildAgentManager getBuildAgentManager()
           
 java.util.Date getBuildDate()
           
 java.lang.String getBuildNumber()
          Returns server build number, i.e.
 java.lang.String getConfigDir()
          Deprecated. use ServerPaths.getConfigDir() instead
 java.util.List<SBuild> getEntriesSince(SBuild build, SBuildType buildType)
          Returns collection of finished and running builds which are later than the given one in term of changes.
 java.util.concurrent.ScheduledExecutorService getExecutor()
          Executor service for short-time processes
 java.lang.String getFullServerVersion()
          Returns full server version string, including build number: TeamCity 3.0 EAP (build 4545)
 BuildHistory getHistory()
           
 LicensingPolicy getLicensingPolicy()
           
 LoginConfiguration getLoginConfiguration()
          Return login configurations manager
 PersonalBuildManager getPersonalBuildManager()
          Returns specific manager for personal builds.
 ProjectManager getProjectManager()
           
 BuildQueue getQueue()
           
 RunTypeRegistry getRunTypeRegistry()
          Returns registry for vairous build runners, like Ant, Maven, or Duplicates.
 byte getServerMajorVersion()
          Get server major version, 3 for TeamCity 3.0
 byte getServerMinorVersion()
          Get server minor version, 2 for TeamCity 1.2
 java.lang.String getServerRootPath()
          Path to server web application, i.e.
 SourceVersionProvider getSourceVersionProvider()
          Returns manager of build sources versions on different build agents (information for patch building)
 SQLRunner getSQLRunner()
          Return the interface for interaction with the SQL database of TeamCity
 StatusProvider getStatusProvider()
           
 java.lang.String getSystemDir()
          Deprecated. use ServerPaths.getSystemDir() instead
 UserModel getUserModel()
           
 VcsModificationHistory getVcsHistory()
           
 VcsManager getVcsManager()
           
 boolean isDatabaseCreatedOnStartup()
           
 void removeListener(BuildServerListener listener)
          Remove global TeamCity listener.
 
Methods inherited from interface jetbrains.buildServer.BuildServer
fetchData, getResponsibilityIds
 
Methods inherited from interface jetbrains.buildServer.RootUrlHolder
getRootUrl, setRootUrl
 
Methods inherited from interface jetbrains.buildServer.ExtensionHolder
registerExtension, unregisterExtension
 
Methods inherited from interface jetbrains.buildServer.ServiceLocator
findSingletonService, getServices, getSingletonService
 
Methods inherited from interface jetbrains.buildServer.ExtensionsProvider
foreachExtension, getExtension, getExtensions, getExtensionSources
 
Methods inherited from interface jetbrains.buildServer.serverSide.BuildsManager
findBuildInstanceByBuildNumber, findBuildInstanceById, findBuildInstances, findBuildInstancesByBuildNumber, findNextBuild, findPreviousBuild, findPreviousBuild, processBuilds
 
Methods inherited from interface jetbrains.buildServer.serverSide.RunningBuildsManager
findRunningBuildById, getNumberOfRunningBuilds, getRunningBuildOnAgent, getRunningBuilds, getRunningBuilds, getRunningStatus
 
Methods inherited from interface jetbrains.buildServer.serverSide.BuildServerState
isShuttingDown
 

Method Detail

addListener

void addListener(BuildServerListener listener)
Add global TeamCity listener. Listeners should work fast, if long operation is required, use executor getExecutor()

Parameters:
listener - listener to add
See Also:
BuildServerAdapter

removeListener

void removeListener(BuildServerListener listener)
Remove global TeamCity listener.

Parameters:
listener - listener to remove
See Also:
BuildServerAdapter

getSystemDir

@Deprecated
java.lang.String getSystemDir()
Deprecated. use ServerPaths.getSystemDir() instead

Returns path to the TeamCity system directory. This directory contains build logs, artifacts, HSQLDB database files, and other non-configuration stuff. Usually, this is TEAMCITY_DATA_PATH/system, where TEAMCITY_DATA_PATH is specified as system property teamcity.data.path or environment variable TEAMCITY_DATA_PATH or $HOME/.BuildServer

Returns:
TeamCity system directory

getConfigDir

@Deprecated
java.lang.String getConfigDir()
Deprecated. use ServerPaths.getConfigDir() instead

Returns path to the TeamCity configuration directory. This directory contains various settings of TeamCity, including description of projects, build configurations, and other settings. Usually, this is TEAMCITY_DATA_PATH/config, where TEAMCITY_DATA_PATH is specified as system property teamcity.data.path or environment variable TEAMCITY_DATA_PATH or $HOME/.BuildServer

Returns:
TeamCity configuration directory

getArtifactsDirectory

@NotNull
java.io.File getArtifactsDirectory()
Deprecated. use ServerPaths.getArtifactsDirectory() instead

Returns directory containing artifacts of all projects (global artifacts directory). If directory does not exist - attempts to create it. If creation is not successful a runtime exception is thrown.

Returns:
global artifacts directory

getProjectManager

@NotNull
ProjectManager getProjectManager()
Returns:
project and build configuration manager.

getQueue

@NotNull
BuildQueue getQueue()
Returns:
build queue manager

getHistory

@NotNull
BuildHistory getHistory()
Returns:
build history manager

getUserModel

@NotNull
UserModel getUserModel()
Returns:
user model in TeamCity

getVcsManager

@NotNull
VcsManager getVcsManager()
Returns:
Manager of various registered version controls and API to register VCS support

getVcsHistory

@NotNull
VcsModificationHistory getVcsHistory()
Returns:
Manager of version control history

flushQueue

boolean flushQueue()
Check for free build agents and try to send builds from queue to build agents.

Returns:
true if at least one build was started

getRunTypeRegistry

@NotNull
RunTypeRegistry getRunTypeRegistry()
Returns registry for vairous build runners, like Ant, Maven, or Duplicates.

Returns:
see above
See Also:
RunType

getSQLRunner

SQLRunner getSQLRunner()
Return the interface for interaction with the SQL database of TeamCity

Returns:
see above

getPersonalBuildManager

PersonalBuildManager getPersonalBuildManager()
Returns specific manager for personal builds.

Returns:
see above

getSourceVersionProvider

SourceVersionProvider getSourceVersionProvider()
Returns manager of build sources versions on different build agents (information for patch building)

Returns:
see above

getLoginConfiguration

LoginConfiguration getLoginConfiguration()
Return login configurations manager

Returns:
see above

getServerMajorVersion

byte getServerMajorVersion()
Get server major version, 3 for TeamCity 3.0

Returns:
see above

getServerMinorVersion

byte getServerMinorVersion()
Get server minor version, 2 for TeamCity 1.2

Returns:
see above

getFullServerVersion

java.lang.String getFullServerVersion()
Returns full server version string, including build number: TeamCity 3.0 EAP (build 4545)

Returns:
see above

getBuildNumber

java.lang.String getBuildNumber()
Returns server build number, i.e. build number of server-side code running on the build server

Returns:
see above

getBuildDate

java.util.Date getBuildDate()
Returns:
date when the build was produced
Since:
7.1.3

getServerRootPath

java.lang.String getServerRootPath()
Path to server web application, i.e. servletContext.getRealPath("/")

Returns:
see above

getExecutor

java.util.concurrent.ScheduledExecutorService getExecutor()
Executor service for short-time processes

Returns:
Executor service for short-time processes

getBuildAgentManager

@NotNull
BuildAgentManager getBuildAgentManager()
Returns:
manager of build agents.

getStatusProvider

StatusProvider getStatusProvider()
Returns:
Notification status helper. Most likely this method will be deprecated.

getLicensingPolicy

LicensingPolicy getLicensingPolicy()
Returns:
current licensing policy.

getEntriesSince

java.util.List<SBuild> getEntriesSince(@Nullable
                                       SBuild build,
                                       SBuildType buildType)
Returns collection of finished and running builds which are later than the given one in term of changes. I.e. history builds which were started after the given one but relate to changes made before it, won't be returned. Collection is sorted by change order descending (recent first).

Parameters:
build - the boundary build, the result collection won't include it. if null, all builds will be returned
buildType - build configuration where to search in.
Returns:
collection of finished and running builds belonging to the specified configuration which start after the specified one (ordered by changes, recent first).

isDatabaseCreatedOnStartup

boolean isDatabaseCreatedOnStartup()
Returns:
true if new database was created during server startup.