com.zeroturnaround.liverebel.api
Interface CommandCenter

All Known Implementing Classes:
CommandCenterImpl

public interface CommandCenter

LiveRebel Command Center API.

Author:
Rein Raudjärv
See Also:
CommandCenterFactory

Method Summary
 void addDatabaseConf(String serverId, Long databaseDriverId, String jdbcUrl, String schemaName)
          Adds database configuration to given database server
 boolean addGroupChild(String groupName, String childGroupName)
           
 boolean addServersToGroup(String groupName, Collection<String> serverIds)
           
 boolean cancelUpdate(Long updateId)
          Cancels manual update by id.
 boolean checkPrimaryAlive()
           
 DiffResult compare(String applicationId, String fromVersionId, String toVersionId, boolean full)
          Compares two versions of the given application.
 int countSeats()
           
 String createDatabaseProxy(com.zeroturnaround.liverebel.util.DatabaseServerExecutionMode execMode, String targetServerId)
          Sets up database server proxy.
 boolean createGroup(String name, String description, Collection<String> serverIds)
           
 int deleteAllLicenses()
           
 boolean deleteGroup(String name)
           
 ConfigurableDeploy deploy(String applicationId, String versionId)
          Prepare to deploy a given application version.
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers)
          Deprecated. instead use deploy(String, String).
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups)
          Deprecated. instead use deploy(String, String).
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHostName)
          Deprecated. instead use deploy(String, String).
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHost, boolean disableScripts, File scriptDescriptionFile)
          Deprecated. instead use deploy(String, String).
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHost, boolean disableScripts, File scriptDescriptionFile, File scriptEntriesArchive)
          Deprecated. instead use deploy(String, String).
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, String proxyTargetServerId, List<Long> schemaIds)
          Deprecated. instead use deploy(String, String).
 Long deploy(String applicationId, String versionId, String ctxPath, String fileServerDeploymentPath, Collection<String> servers, Collection<String> groups, String virtualHostName, boolean disableScripts, File scriptDescriptionFile, File scriptEntriesArchive)
          Deprecated. instead use deploy(String, String).
 Long deploy(String applicationId, String versionId, String ctxPath, String fileServerDeploymentPath, Collection<String> servers, Collection<String> groups, String virtualHost, boolean disableScripts, File scriptDescriptionFile, File scriptEntriesArchive, String proxyTargetServerId, List<Long> schemaIds)
          Deprecated. instead use deploy(String, String).
 Long deployToFileServers(String applicationId, String versionId, String fileServerDeploymentPath)
          Deprecated. instead use deploy(String, String).
 ApplicationInfo enableNinjaMode(String serverId, String appId)
          Deprecated. use startEditMode(String, String)
 List<ServerInfo> expandGroup(String groupName)
           
 ApplicationInfo finishEditMode(String serverId, String appId, String verId)
          Finishes in-place edit mode on given server for given application.
 ApplicationInfo finishNinjaUpdate(String serverId, String appId, String verId)
          Deprecated. use finishEditMode(String, String, String)
 List<ServerGroup> getAllGroups()
           
 ApplicationInfo getApplication(String applicationId)
          Returns current info about an application.
 Map<String,ApplicationInfo> getApplications()
          Lists all applications.
 CommandCenterUpdate getCommandCenterUpdate()
           
 Long getDatabaseServerSchemaId(String serverId)
           
 List<ServerGroup> getGroups(String groupName)
           
 Collection<InstallerExecution> getInstallerExecutions()
           
 Date getLastFailoverSyncTime()
          Returns date of last time when this servers synced with failover server.
 Collection<String> getLogLines(Long taskId)
          Retrieved the log for given task.
 String getMetadata(String appId, String versionId)
          Deprecated. 
 PausedUpdate getPausedUpdate(Long id)
          Returns a paused update by its Id.
 List<Long> getRunningPausedUpdateIds()
           
 ServerInfo getServer(String serverId)
          Returns current info about a server.
 Map<String,ServerInfo> getServers()
          Lists all servers.
 String getTrace(String appId, String versionId)
           
 boolean getVerbose()
           
 String getVersion()
           
 boolean isAlive()
           
 ManagedConfOperations manageConfiguration()
           
 boolean registerAsFailover(String primaryHost, int primaryPort, String token)
          Returns true is registration was OK.
 void remove(String applicationId)
          Removes app from command center.
 boolean removeGroupChild(String groupName, String childGroupName)
           
 void removeServer(String serverId)
          Removes a server.
 boolean removeServersFromGroup(String groupName, Collection<String> serverIds)
           
 void removeVersion(String appId, String versionId)
          Removes application version from command center.
 boolean restartServer(String serverId)
          Restart server (asynchronously)
 boolean resumeUpdate(Long updateId)
          Resumes manual update by id.
 boolean setHotpatchingEnabled(String serverId, boolean enabled)
          Enable/disable hotpatching update for specified server
 ApplicationInfo startEditMode(String serverId, String appId)
          Enables in-place edit mode for given application on a given server
 void syncWithFailover()
          If this server has failover slave - this will schedule synchronizing in 3s.
 ConfigurableUndeploy undeploy(String applicationId)
          Prepare to undeploy a given application.
 Long undeploy(String applicationId, Collection<String> servers)
          Deprecated. instead use undeploy(String).
 Long undeploy(String applicationId, Collection<String> servers, Collection<String> groups)
          Deprecated. instead use undeploy(String).
 Long undeploy(String applicationId, Collection<String> servers, Collection<String> groups, boolean disableScripts, File scriptDescriptionFile)
          Deprecated. instead use undeploy(String).
 Long undeploy(String applicationId, Collection<String> servers, Collection<String> groups, boolean disableScripts, File scriptDescriptionFile, File scriptEntriesArchive)
          Deprecated. instead use undeploy(String).
 Long undeploy(String applicationId, Collection<String> servers, Collection<String> groups, boolean disableScripts, File scriptDescriptionFile, File scriptEntriesArchive, String proxyTargetServerId, List<Long> schemaIds)
          Deprecated. instead use undeploy(String).
 Long undeploy(String applicationId, Collection<String> servers, String proxyTargetServerId, List<Long> schemaIds)
          Deprecated. instead use undeploy(String).
 ConfigurableUpdate update(String applicationId, String versionId)
          Start updating an application to a given version.
 AgentUpdate updateAgent()
           
 UploadInfo upload(File file)
          Uploads new version of an application.
 UploadInfo upload(String applicationId, String fromVersion, File diff)
          Deprecated. replaced by uploadVersion(File) and Upload.execute()
 Long uploadDatabaseDriver(File jar)
           
 boolean uploadLicense(File license)
           
 boolean uploadMetadata(File file, String appId, String versionId)
          Deprecated. 
 boolean uploadTrace(File file, String appId, String versionId)
           
 Upload uploadVersion(File file)
          Prepares the upload of new version of an application.
 

Method Detail

isAlive

boolean isAlive()
Returns:
true if the Command Center is alive.

getServers

Map<String,ServerInfo> getServers()
Lists all servers.

Returns:
all servers by their Id.

getServer

ServerInfo getServer(String serverId)
Returns current info about a server.

Parameters:
serverId - server Id.
Returns:
server info.

removeServer

void removeServer(String serverId)
Removes a server.

Parameters:
serverId - server Id.

restartServer

boolean restartServer(String serverId)
Restart server (asynchronously)

Parameters:
serverId - server id
Returns:
true if request successes

setHotpatchingEnabled

boolean setHotpatchingEnabled(String serverId,
                              boolean enabled)
Enable/disable hotpatching update for specified server

Parameters:
serverId - server id
enabled - true to enable hotpatching, false to disable it
Returns:
true if request success

getApplications

Map<String,ApplicationInfo> getApplications()
Lists all applications.

Returns:
all applications by their Id.

getApplication

ApplicationInfo getApplication(String applicationId)
Returns current info about an application.

Parameters:
applicationId - application Id.
Returns:
application info.

upload

UploadInfo upload(File file)
                  throws DuplicationException
Uploads new version of an application.

Parameters:
file - archive file.
Returns:
uploaded application version.
Throws:
DuplicationException - if the given version already exists on the server.

upload

@Deprecated
UploadInfo upload(String applicationId,
                             String fromVersion,
                             File diff)
                  throws DuplicationException
Deprecated. replaced by uploadVersion(File) and Upload.execute()

Uploads new version of an application.

Parameters:
applicationId - - application identificator
fromVersion - - version on which this diff is based
diff - archive file.
Returns:
uploaded application version.
Throws:
DuplicationException - if the given version already exists on the server.

uploadVersion

Upload uploadVersion(File file)
Prepares the upload of new version of an application.

Parameters:
file - archive file
Returns:
an object for configuring the upload

compare

DiffResult compare(String applicationId,
                   String fromVersionId,
                   String toVersionId,
                   boolean full)
Compares two versions of the given application.

Parameters:
applicationId - application Id.
fromVersionId - current version Id.
toVersionId - new version Id.
full - include all differences (otherwise only warnings and errors are included).

update

ConfigurableUpdate update(String applicationId,
                          String versionId)
Start updating an application to a given version.

Parameters:
applicationId - application Id.
versionId - version Id.

getPausedUpdate

PausedUpdate getPausedUpdate(Long id)
Returns a paused update by its Id.

Parameters:
id - update Id.
Returns:
the paused update or null if no such update found.
See Also:
PreparedPausableUpdate.executeWithPause()

registerAsFailover

boolean registerAsFailover(String primaryHost,
                           int primaryPort,
                           String token)
Returns true is registration was OK.

Parameters:
primaryHost - - primary server host
primaryPort - - primary server port
token - - primary server user auth-token that will be used for initial authentication
Returns:

syncWithFailover

void syncWithFailover()
If this server has failover slave - this will schedule synchronizing in 3s. Otherwise, has no effect.


checkPrimaryAlive

boolean checkPrimaryAlive()
Returns:
true if primary is alive or this server is not configured as failover

getVerbose

boolean getVerbose()

deploy

ConfigurableDeploy deploy(String applicationId,
                          String versionId)
Prepare to deploy a given application version. Configure additional parameters using the returned ConfigurableDeploy object. The deploy will be executed once PreparedDeploy.execute() is invoked. The archive of the given version must be available in the Command Center before this operation.


deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers)
Deprecated. instead use deploy(String, String).


deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            String proxyTargetServerId,
            List<Long> schemaIds)
Deprecated. instead use deploy(String, String).


deployToFileServers

Long deployToFileServers(String applicationId,
                         String versionId,
                         String fileServerDeploymentPath)
Deprecated. instead use deploy(String, String).


deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            Collection<String> groups)
Deprecated. instead use deploy(String, String).


deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            Collection<String> groups,
            String virtualHostName)
Deprecated. instead use deploy(String, String).

Deploy application to specified servers. Using initial deploy.

Parameters:
applicationId - - application id
ctxPath - - context path for servers
servers - - server jvmid-s
virtualHostName - - name of the virtual host to be used for deploying
Returns:
task ID

deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            Collection<String> groups,
            String virtualHost,
            boolean disableScripts,
            File scriptDescriptionFile)
Deprecated. instead use deploy(String, String).


deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            Collection<String> groups,
            String virtualHost,
            boolean disableScripts,
            File scriptDescriptionFile,
            File scriptEntriesArchive)
Deprecated. instead use deploy(String, String).


deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            String fileServerDeploymentPath,
            Collection<String> servers,
            Collection<String> groups,
            String virtualHostName,
            boolean disableScripts,
            File scriptDescriptionFile,
            File scriptEntriesArchive)
Deprecated. instead use deploy(String, String).


deploy

Long deploy(String applicationId,
            String versionId,
            String ctxPath,
            String fileServerDeploymentPath,
            Collection<String> servers,
            Collection<String> groups,
            String virtualHost,
            boolean disableScripts,
            File scriptDescriptionFile,
            File scriptEntriesArchive,
            String proxyTargetServerId,
            List<Long> schemaIds)
Deprecated. instead use deploy(String, String).


remove

void remove(String applicationId)
Removes app from command center.

Parameters:
app - - application id

removeVersion

void removeVersion(String appId,
                   String versionId)
Removes application version from command center.

Parameters:
appId -
versionId -

undeploy

ConfigurableUndeploy undeploy(String applicationId)
Prepare to undeploy a given application. Configure additional parameters using the returned ConfigurableUndeploy object. The undeploy will be executed once PreparedUndeploy.execute() is invoked.


undeploy

Long undeploy(String applicationId,
              Collection<String> servers)
Deprecated. instead use undeploy(String).

Undeploy application from specified servers.

Parameters:
applicationId - - application id
servers - - server jvmid-s
Returns:
task ID

undeploy

Long undeploy(String applicationId,
              Collection<String> servers,
              Collection<String> groups)
Deprecated. instead use undeploy(String).

Undeploy application from specified servers.

Parameters:
applicationId - - application id
servers - - server jvmid-s
groups - - server groups
Returns:
task ID

undeploy

Long undeploy(String applicationId,
              Collection<String> servers,
              String proxyTargetServerId,
              List<Long> schemaIds)
Deprecated. instead use undeploy(String).

Undeploy application from specified servers and schemas

Parameters:
applicationId - - application id
servers - - server jvmid-s
proxyTargetServerId - - proxy target server id
schemaIds - - schema ids
Returns:
task ID

undeploy

Long undeploy(String applicationId,
              Collection<String> servers,
              Collection<String> groups,
              boolean disableScripts,
              File scriptDescriptionFile)
Deprecated. instead use undeploy(String).

file and archive type scripts are expected to be in the local filesystem


undeploy

Long undeploy(String applicationId,
              Collection<String> servers,
              Collection<String> groups,
              boolean disableScripts,
              File scriptDescriptionFile,
              File scriptEntriesArchive)
Deprecated. instead use undeploy(String).


undeploy

Long undeploy(String applicationId,
              Collection<String> servers,
              Collection<String> groups,
              boolean disableScripts,
              File scriptDescriptionFile,
              File scriptEntriesArchive,
              String proxyTargetServerId,
              List<Long> schemaIds)
Deprecated. instead use undeploy(String).


getLastFailoverSyncTime

Date getLastFailoverSyncTime()
Returns date of last time when this servers synced with failover server.

Returns:

resumeUpdate

boolean resumeUpdate(Long updateId)
Resumes manual update by id. Throws NotFound if no update with such id is found.

Parameters:
updateId -
Returns:
boolean if update was successful.

cancelUpdate

boolean cancelUpdate(Long updateId)
Cancels manual update by id. Throws NotFound if no update with such id is found.

Parameters:
updateId -
Returns:
if update cancellation was successful.

getRunningPausedUpdateIds

List<Long> getRunningPausedUpdateIds()
Returns:
List of ids of all paused updates that are currently in Command Center

startEditMode

ApplicationInfo startEditMode(String serverId,
                              String appId)
Enables in-place edit mode for given application on a given server


finishEditMode

ApplicationInfo finishEditMode(String serverId,
                               String appId,
                               String verId)
Finishes in-place edit mode on given server for given application. The resulted version is given verId.


enableNinjaMode

ApplicationInfo enableNinjaMode(String serverId,
                                String appId)
Deprecated. use startEditMode(String, String)

Enables inplace edit mode (ninja) for given application on a given server


finishNinjaUpdate

ApplicationInfo finishNinjaUpdate(String serverId,
                                  String appId,
                                  String verId)
Deprecated. use finishEditMode(String, String, String)

Finishes inplace edit (ninja) update on given server for given application. The resulted version is given verId.


countSeats

int countSeats()
Returns:
licenses soft-limit, how many servers can connect.

uploadLicense

boolean uploadLicense(File license)
Parameters:
File - - license file
Returns:
true if the license is uploaded and verified and working

deleteAllLicenses

int deleteAllLicenses()
Returns:
number of license files deleted

createGroup

boolean createGroup(String name,
                    String description,
                    Collection<String> serverIds)

addServersToGroup

boolean addServersToGroup(String groupName,
                          Collection<String> serverIds)

removeServersFromGroup

boolean removeServersFromGroup(String groupName,
                               Collection<String> serverIds)

addGroupChild

boolean addGroupChild(String groupName,
                      String childGroupName)

removeGroupChild

boolean removeGroupChild(String groupName,
                         String childGroupName)

getAllGroups

List<ServerGroup> getAllGroups()
Returns:
all server groups + ungrouped servers "virtual server group"

getGroups

List<ServerGroup> getGroups(String groupName)
Parameters:
groupName -
Returns:
descendant groups under given group (includes group itself)

expandGroup

List<ServerInfo> expandGroup(String groupName)

deleteGroup

boolean deleteGroup(String name)

getCommandCenterUpdate

CommandCenterUpdate getCommandCenterUpdate()
Returns:
API for updating Command Center.

updateAgent

AgentUpdate updateAgent()
Returns:
API for updating Agents.

uploadTrace

boolean uploadTrace(File file,
                    String appId,
                    String versionId)
Returns:
whether trace existed before and was replaced or not.

getTrace

String getTrace(String appId,
                String versionId)

getLogLines

Collection<String> getLogLines(Long taskId)
Retrieved the log for given task.

Parameters:
taskId - the task ID
Returns:
the task log splitted into lines

uploadMetadata

@Deprecated
boolean uploadMetadata(File file,
                                  String appId,
                                  String versionId)
Deprecated. 

Replaced with uploadTrace(File, String, String)


getMetadata

@Deprecated
String getMetadata(String appId,
                              String versionId)
Deprecated. 

Replaced with getTrace(String, String)


getVersion

String getVersion()

getInstallerExecutions

Collection<InstallerExecution> getInstallerExecutions()

manageConfiguration

ManagedConfOperations manageConfiguration()
Returns:
interface that provides operations related to managed configuration

addDatabaseConf

void addDatabaseConf(String serverId,
                     Long databaseDriverId,
                     String jdbcUrl,
                     String schemaName)
Adds database configuration to given database server

Parameters:
serverId - - database server id
databaseDriverId - - database driver id
jdbcUrl - - JDBC url
schemaName - - name of the schema

createDatabaseProxy

String createDatabaseProxy(com.zeroturnaround.liverebel.util.DatabaseServerExecutionMode execMode,
                           String targetServerId)

Sets up database server proxy.

Note! Must be called before addDatabaseConf(String, Long, String, String).

Parameters:
execMode - execution mode, DatabaseServerExecutionMode.PROXY or DatabaseServerExecutionMode.PROXY_PROMPT
targetServerId - target server id
Returns:
id of the created proxy server

uploadDatabaseDriver

Long uploadDatabaseDriver(File jar)
Parameters:
jar - JDBC driver jar
Returns:
id of the uploaded driver

getDatabaseServerSchemaId

Long getDatabaseServerSchemaId(String serverId)
Parameters:
serverId - id of the database server
Returns:
first schema id associated with given database server


Copyright © 2013. All Rights Reserved.