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)
           
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers)
           
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups)
           
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHostName)
          Deploy application to specified servers.
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHost, boolean disableScripts, File scriptDescriptionFile)
           
 Long deploy(String applicationId, String versionId, String ctxPath, Collection<String> servers, Collection<String> groups, String virtualHost, boolean disableScripts, File scriptDescriptionFile, File scriptEntriesArchive)
           
 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)
 ApplicationInfo getApplication(String applicationId)
          Returns current info about an application.
 Map<String,ApplicationInfo> getApplications()
          Lists all applications.
 CommandCenterUpdate getCommandCenterUpdate()
           
 List<ServerGroup> getGroups(String name)
           
 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()
           
 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.
 Long undeploy(String applicationId, Collection<String> servers)
          Undeploy application from specified servers.
 Long undeploy(String applicationId, Collection<String> servers, Collection<String> groups)
          Undeploy application from specified servers.
 Long undeploy(String applicationId, Collection<String> servers, Collection<String> groups, boolean disableScripts, File scriptDescriptionFile)
          file and archive type scripts are expected to be in the local filesystem
 Long undeploy(String applicationId, Collection<String> servers, Collection<String> groups, boolean disableScripts, File scriptDescriptionFile, File scriptEntriesArchive)
           
 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()
 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

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

deploy

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

deploy

Long 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
Returns:
task ID

deploy

Long 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)

deploy

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

Long undeploy(String applicationId,
              Collection<String> servers)
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)
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,
              boolean disableScripts,
              File scriptDescriptionFile)
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)

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)

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.

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()


Copyright © 2013. All Rights Reserved.