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(Object projectId,
String commandId)
O método createUniqueCommandDirectory deve garantir que o identificador do
comando seja único.
|
csbase.logic.CommandInfo |
getCommandInfo(Object projectId,
String commandId) |
Set<csbase.logic.CommandInfo> |
getCommandInfos(Object projectId) |
String[][] |
getCommandScripts(String commandId,
Object projectId)
Obtém o conjunto de scripts de um comando específico.
|
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.
|
String[] |
getLogDirectory(String commandId)
Obtém o caminho do diretório onde devem ser gerados os arquivos de log.
|
Set<csbase.logic.CommandInfo> |
getStatusCommandInfos(Object projectId,
List<csbase.logic.CommandStatus> statusFilter,
boolean include) |
protected boolean |
has2Update(Object arg,
Object event) |
void |
initService()
Inicialização do serviço
|
void |
notifyUsers(Collection<Object> allUsers,
csbase.logic.algorithms.commands.CommandPersistenceNotification notification)
Notifica usuários sobre eventos ocorridos com comandos.
|
csbase.logic.algorithms.AlgorithmConfigurator |
readAlgorithmConfigurator(Object projectId,
String commandId) |
boolean |
removeCommandInfo(Object projectId,
String commandId) |
boolean[] |
removeCommandInfos(List<Object> projectIds,
List<String> commandIds) |
long |
requestCommandInfos(Object projectId,
long desiredResponseTime) |
void |
saveCommandInfo(csbase.logic.CommandInfo command)
Salva o comando informado.
|
void |
saveCommandScript(String fileName,
String commandId,
Object projectId,
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(Object projectId,
String commandId,
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 String[] getLogDirectory(String commandId)
commandId - Identificador do comando.public csbase.logic.CommandInfo getCommandInfo(Object projectId, String commandId)
getCommandInfo in interface csbase.remote.CommandPersistenceServiceInterfacepublic Set<csbase.logic.CommandInfo> getCommandInfos(Object projectId)
getCommandInfos in interface csbase.remote.CommandPersistenceServiceInterfacepublic Set<csbase.logic.CommandInfo> getStatusCommandInfos(Object projectId, List<csbase.logic.CommandStatus> statusFilter, boolean include)
getStatusCommandInfos in interface csbase.remote.CommandPersistenceServiceInterfacepublic long requestCommandInfos(Object projectId, long desiredResponseTime)
requestCommandInfos in interface csbase.remote.CommandPersistenceServiceInterfaceprotected boolean has2Update(Object arg, 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(Collection<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(Object projectId, String commandId)
readAlgorithmConfigurator in interface csbase.remote.CommandPersistenceServiceInterfacepublic boolean removeCommandInfo(Object projectId, String commandId)
removeCommandInfo in interface csbase.remote.CommandPersistenceServiceInterfacepublic boolean[] removeCommandInfos(List<Object> projectIds, List<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(Object projectId, String commandId, String description)
updateCommandDescription in interface csbase.remote.CommandPersistenceServiceInterfacepublic void updateCommandInfo(csbase.logic.CommandInfo command)
command - comando a ser atualizado.public String[][] getCommandScripts(String commandId, 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(String fileName, String commandId, Object projectId, 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(Object projectId, String commandId)
projectId - Indentificador do projetocommandId - Indentificador de um comandopublic String getCommandsDirectoryName()
.cmds).protected Service[] getInitializationDependencies()
getInitializationDependencies in class ServiceCopyright © 2016. All rights reserved.