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
 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()
           
 int deleteAllLicenses()
           
 void deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers)
          Deploy application to specified servers.
 ApplicationInfo enableNinjaMode(String serverId, String appId)
          Enables inplace edit mode (ninja) for given application on a given server
 ApplicationInfo finishNinjaUpdate(String serverId, String appId, String verId)
          Finishes inplace edit (ninja) update on given server for given application.
 ApplicationInfo getApplication(String applicationId)
          Returns current info about an application.
 Map<String,ApplicationInfo> getApplications()
          Lists all applications.
 Date getLastFailoverSyncTime()
          Returns date of last time when this servers synced with failover server.
 PausedUpdate getPausedUpdate(Long id)
          Returns a paused update by its Id.
 List<Long> getRunningPausedUpdateIds()
           
 Map<String,ServerInfo> getServers()
          Lists all servers.
 boolean getVerbose()
           
 boolean isAlive()
           
 boolean registerAsFailover(String primaryHost, int primaryPort, String token)
          Returns true is registration was OK.
 void remove(String applicationId)
          Removes app from command center.
 void removeServer(String serverId)
          Removes a server.
 void removeVersion(String appId, String versionId)
          Removes application version from command center.
 boolean resumeUpdate(Long updateId)
          Resumes manual update by id.
 void syncWithFailover()
          If this server has failover slave - this will schedule synchronizing in 3s.
 void undeploy(String applicationId, Collection<String> servers)
          Undeploy application from specified servers.
 ConfigurableUpdate update(String applicationId, String versionId)
          Start updating an application to a given version.
 UploadInfo upload(File file)
          Uploads new version of an application.
 UploadInfo upload(String applicationId, String fromVersion, File diff)
          Uploads new version of an application.
 boolean uploadLicense(File license)
           
 

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.

removeServer

void removeServer(String serverId)
Removes a server.

Parameters:
serverId - server Id.

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

UploadInfo upload(String applicationId,
                  String fromVersion,
                  File diff)
                  throws DuplicationException
Uploads new version of an application.

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

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

void deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers)
Deploy application to specified servers. Using initial deploy.

Parameters:
applicationId - - application id
ctxPath - - context path for servers
servers - - server jvmid-s

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

void undeploy(String applicationId,
              Collection<String> servers)
Undeploy application from specified servers.

Parameters:
applicationId - - application id
servers - - server jvmid-s

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

enableNinjaMode

ApplicationInfo enableNinjaMode(String serverId,
                                String appId)
Enables inplace edit mode (ninja) for given application on a given server


finishNinjaUpdate

ApplicationInfo finishNinjaUpdate(String serverId,
                                  String appId,
                                  String verId)
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


Copyright © 2012. All Rights Reserved.