public class SsmOperationManager extends BaseManager
Modifier and Type | Method and Description |
---|---|
static void |
addNoteToOperationOnServer(long operationId,
long serverId,
java.lang.String note)
Updates an association between an operation and a server adding a note.
|
static DataResult<OperationDetailsDto> |
allOperations(User user)
Returns a list of all operations for the given user, regardless of their status.
|
static void |
associateServersWithOperation(long operationId,
long userId,
java.util.List<java.lang.Long> sidsIn)
Associates an operation with a group of servers against which it was run, where
a list of server ids are passed in
|
static void |
associateServersWithOperation(long operationId,
long userId,
java.lang.String setLabel)
Associates an operation with a group of servers against which it was run, where
the servers are found in an RhnSet.
|
static DataResult<OperationDetailsDto> |
completedOperations(User user)
Returns a list of all operations for the given user that have completed.
|
static void |
completeOperation(User user,
long operationId)
Indicates the operation has completed, updating its status to indicate this.
|
static long |
createOperation(User user,
java.lang.String messageId,
java.lang.String rhnSetLabel)
Creates a new operation, defaulting the status to "in progress".
|
static OperationDetailsDto |
findOperationById(User user,
long operationId)
Returns the details of the given operation.
|
static DataResult |
findServerDataForOperation(long operationId)
Returns a list of servers that took part in the given SSM operation.
|
static DataResult<OperationDetailsDto> |
inProgressOperations(User user)
Returns a list of all operations for the given user that are currently executing.
|
makeDataResult, makeDataResult, makeDataResult, makeDataResult, makeDataResultNoPagination, makeDataResultNoPagination, processListControl, processPageControl
public static DataResult<OperationDetailsDto> allOperations(User user)
user
- operations returned only for this user; cannot be null
public static DataResult<OperationDetailsDto> inProgressOperations(User user)
user
- operations returned only for this user; cannot be null
public static DataResult<OperationDetailsDto> completedOperations(User user)
user
- operations returned only for this user; cannot be null
public static OperationDetailsDto findOperationById(User user, long operationId)
user
- verifies that the user isn't trying to load someone else's
operation; cannot be null
operationId
- database ID of the operation to loadpublic static long createOperation(User user, java.lang.String messageId, java.lang.String rhnSetLabel)
For efficiency, this call assumes the following:
This should be a safe assumption since, at very least, if all servers are taking place in the operation they are already in the SSM RhnSet. If only a subset is needed, a nested select can be used to drop them into a new set, preventing the need to have another insert per server for this call.
user
- user under which to associate the operation; cannot be
null
messageId
- message id of operation description; cannot be null
rhnSetLabel
- references a RhnSet with the server IDs to associate with the
new operation; if this is null
no mappings will
be created at this timepublic static void completeOperation(User user, long operationId)
user
- verifies that the user isn't trying to load someone else's
operation; cannot be null
operationId
- database ID of the operation to updatepublic static DataResult findServerDataForOperation(long operationId)
operationId
- operation for which to return the server IDspublic static void associateServersWithOperation(long operationId, long userId, java.lang.String setLabel)
operationId
- identifies an existing operation to associate with serversuserId
- identifies the user performing the operationsetLabel
- identifies the set in which to find server IDspublic static void associateServersWithOperation(long operationId, long userId, java.util.List<java.lang.Long> sidsIn)
operationId
- identifies an existing operation to associate with serversuserId
- identifies the user performing the operationsidsIn
- the list server idspublic static void addNoteToOperationOnServer(long operationId, long serverId, java.lang.String note)
operationId
- identifies an existing operationserverId
- identifies the server on which the operation failednote
- note to be added