public final class CommandPersistenceService extends Service implements csbase.remote.CommandPersistenceServiceInterface
CommandPersistenceServiceInterface| Modifier and Type | Method and Description |
|---|---|
static void |
createService()
Constrói a instância do serviço de escalonamento.
|
void |
createUniqueCommandDirectory(java.lang.Object projectId,
java.lang.String commandId)
O método createUniqueCommandDirectory deve garantir que o identificador do
comando seja único.
|
csbase.logic.CommandInfo |
getCommandInfo(java.lang.Object projectId,
java.lang.String commandId) |
java.util.Set<csbase.logic.CommandInfo> |
getCommandInfos(java.lang.Object projectId) |
java.lang.String[][] |
getCommandScripts(java.lang.String commandId,
java.lang.Object projectId)
Obtém o conjunto de scripts de um comando específico.
|
java.lang.String |
getCommandsDirectoryName()
Obtém o nome do diretório de persistência dos arquivos associados às
execuções dos comandos (default =
.cmds). |
protected Service[] |
getInitializationDependencies()
Obtém todos os serviços dos quais este serviço depende para a sua
inicialização.
|
static CommandPersistenceService |
getInstance()
Retorno da instância do serviço.
|
java.lang.String[] |
getLogDirectory(java.lang.String commandId)
Obtém o caminho do diretório onde devem ser gerados os arquivos de log.
|
java.util.Set<csbase.logic.CommandInfo> |
getStatusCommandInfos(java.lang.Object projectId,
java.util.List<csbase.logic.CommandStatus> statusFilter,
boolean include) |
protected boolean |
has2Update(java.lang.Object arg,
java.lang.Object event) |
void |
initService()
Inicialização do serviço
|
void |
notifyUsers(java.util.Collection<java.lang.Object> allUsers,
csbase.logic.algorithms.commands.CommandPersistenceNotification notification)
Notifica usuários sobre eventos ocorridos com comandos.
|
csbase.logic.algorithms.AlgorithmConfigurator |
readAlgorithmConfigurator(java.lang.Object projectId,
java.lang.String commandId) |
boolean |
removeCommandInfo(java.lang.Object projectId,
java.lang.String commandId) |
boolean[] |
removeCommandInfos(java.util.List<java.lang.Object> projectIds,
java.util.List<java.lang.String> commandIds) |
long |
requestCommandInfos(java.lang.Object projectId,
long desiredResponseTime) |
void |
saveCommandInfo(csbase.logic.CommandInfo command)
Salva o comando informado.
|
void |
saveCommandScript(java.lang.String fileName,
java.lang.String commandId,
java.lang.Object projectId,
java.lang.String commandLine)
Persiste a linha de comando em um arquivo de script.
|
void |
shutdownService()
Método invocado no término do serviço.
|
void |
updateCommandDescription(java.lang.Object projectId,
java.lang.String commandId,
java.lang.String description) |
void |
updateCommandInfo(csbase.logic.CommandInfo command)
Atualiza as informações do comando.
|
getBooleanProperty, getDefaultLocale, getDoubleProperty, getExternalPropertyFile, getFormattedString, getFormattedString, getInstance, getIntProperty, getKey, getLongProperty, getName, getOptionalString, getOptionalString, getOSPropertyPath, getSenderName, getServices, getString, getString, getStringListProperty, getStringProperty, getSystemId, getThreadLocale, getUser, getUserPermission, hasProperty, incrCounter, isActive, isEnabled, isInternalServerRequest, isLoggingNotifications, isPropertyNull, logNotification, setEnabled, setKey, setSystemId, setUserIdhandleException, handleFatalErroraddObserver, countObservers, deleteObserver, deleteObserver, deleteObservers, has2update, notifyObserverspublic static void createService()
throws ServerException
ServerException - se houver erro na inicialização.public static CommandPersistenceService getInstance()
public java.lang.String[] getLogDirectory(java.lang.String commandId)
commandId - Identificador do comando.public csbase.logic.CommandInfo getCommandInfo(java.lang.Object projectId,
java.lang.String commandId)
getCommandInfo in interface csbase.remote.CommandPersistenceServiceInterfacepublic java.util.Set<csbase.logic.CommandInfo> getCommandInfos(java.lang.Object projectId)
getCommandInfos in interface csbase.remote.CommandPersistenceServiceInterfacepublic java.util.Set<csbase.logic.CommandInfo> getStatusCommandInfos(java.lang.Object projectId,
java.util.List<csbase.logic.CommandStatus> statusFilter,
boolean include)
getStatusCommandInfos in interface csbase.remote.CommandPersistenceServiceInterfacepublic long requestCommandInfos(java.lang.Object projectId,
long desiredResponseTime)
requestCommandInfos in interface csbase.remote.CommandPersistenceServiceInterfaceprotected boolean has2Update(java.lang.Object arg,
java.lang.Object event)
has2Update in class csbase.remote.RemoteObjectObservablepublic void initService()
throws ServerException
initService in class ServiceServerException - Caso ocorra erro na inicialização do serviço.public void notifyUsers(java.util.Collection<java.lang.Object> allUsers,
csbase.logic.algorithms.commands.CommandPersistenceNotification notification)
allUsers - Usuários a serem notificados além do admin.notification - Notificação a ser enviada indicando se um comando foi
salvo, removido ou atualizado na persistência.public csbase.logic.algorithms.AlgorithmConfigurator readAlgorithmConfigurator(java.lang.Object projectId,
java.lang.String commandId)
readAlgorithmConfigurator in interface csbase.remote.CommandPersistenceServiceInterfacepublic boolean removeCommandInfo(java.lang.Object projectId,
java.lang.String commandId)
removeCommandInfo in interface csbase.remote.CommandPersistenceServiceInterfacepublic boolean[] removeCommandInfos(java.util.List<java.lang.Object> projectIds,
java.util.List<java.lang.String> commandIds)
removeCommandInfos in interface csbase.remote.CommandPersistenceServiceInterfacepublic void saveCommandInfo(csbase.logic.CommandInfo command)
throws csbase.exception.OperationFailureException
CommandPersistenceNotification do tipo CommandPersistenceNotification.Type.SAVED.command - O comando a ser salvo.csbase.exception.OperationFailureException - Se houver uma falha ao salvar o comando.public void shutdownService()
shutdownService in class Servicepublic void updateCommandDescription(java.lang.Object projectId,
java.lang.String commandId,
java.lang.String description)
updateCommandDescription in interface csbase.remote.CommandPersistenceServiceInterfacepublic void updateCommandInfo(csbase.logic.CommandInfo command)
command - comando a ser atualizado.public java.lang.String[][] getCommandScripts(java.lang.String commandId,
java.lang.Object projectId)
throws csbase.exception.OperationFailureException
commandId - Identificador do comando.projectId - Identificador do projeto.csbase.exception.OperationFailureException - se não for possível encontrar o diretório
onde se encontram os scripts.public void saveCommandScript(java.lang.String fileName,
java.lang.String commandId,
java.lang.Object projectId,
java.lang.String commandLine)
throws csbase.exception.OperationFailureException
fileName - o nome do arquivo de script.commandId - o identificador do comando.projectId - o identificador do projeto.commandLine - a linha de comando.csbase.exception.OperationFailureException - Se a linha de comando não puder ser
persistida.public void createUniqueCommandDirectory(java.lang.Object projectId,
java.lang.String commandId)
projectId - Indentificador do projetocommandId - Indentificador de um comandopublic java.lang.String getCommandsDirectoryName()
.cmds).protected Service[] getInitializationDependencies()
getInitializationDependencies in class ServiceCopyright © 2018. All Rights Reserved.