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 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()
           
 boolean createGroup(String name, String description, Collection<String> serverIds)
           
 int deleteAllLicenses()
           
 boolean deleteGroup(String name)
           
 void deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers)
           
 void deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups)
           
 void deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHostName)
          Deploy application to specified servers.
 void deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHost, boolean disableScripts, File scriptDescriptionFile)
           
 ApplicationInfo enableNinjaMode(String serverId, String appId)
          Enables inplace edit mode (ninja) for given application on a given server
 List<ServerInfo> expandGroup(String groupName)
           
 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.
 CommandCenterUpdate getCommandCenterUpdate()
           
 List<ServerGroup> getGroups(String name)
           
 Date getLastFailoverSyncTime()
          Returns date of last time when this servers synced with failover server.
 String getMetadata(String appId, String versionId)
           
 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.
 boolean getVerbose()
           
 String getVersion()
           
 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.
 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 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.
 void undeploy(String applicationId, Collection<String> servers, Collection<String> groups)
          Undeploy application from specified servers.
 void undeploy(String applicationId, Collection<String> servers, Collection<String> groups, boolean disableScripts, File scriptDescriptionFile)
           
 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)
          Uploads new version of an application.
 boolean uploadLicense(File license)
           
 boolean uploadMetadata(File file, String appId, String versionId)
           
 

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.

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)
See Also:
deploy(String, String, String, Collection, Collection, String)

deploy

void deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            Collection<String> groups)
See Also:
deploy(String, String, String, Collection, Collection, String)

deploy

void deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            Collection<String> groups,
            String virtualHostName)
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

deploy

void deploy(String applicationId,
            String versionId,
            String ctxPath,
            Collection<String> servers,
            Collection<String> groups,
            String virtualHost,
            boolean disableScripts,
            File scriptDescriptionFile)
See Also:
deploy(String, String, String, Collection, Collection, 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

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

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

undeploy

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

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

undeploy

void undeploy(String applicationId,
              Collection<String> servers,
              Collection<String> groups,
              boolean disableScripts,
              File scriptDescriptionFile)

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

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)

getGroups

List<ServerGroup> getGroups(String name)

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.

uploadMetadata

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

getMetadata

String getMetadata(String appId,
                   String versionId)

getVersion

String getVersion()


Copyright © 2012. All Rights Reserved.