|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.redhat.rhn.common.hibernate.HibernateFactory
com.redhat.rhn.domain.action.ActionFactory
public class ActionFactory
ActionFactory - the singleton class used to fetch and store com.redhat.rhn.domain.action.Action objects from the database.
| Field Summary | |
|---|---|
static ActionStatus |
STATUS_COMPLETED
The constant representing the Action Status COMPLETED |
static ActionStatus |
STATUS_FAILED
The constant representing the Action Status FAILED |
static ActionStatus |
STATUS_QUEUED
The constant representing the Action Status QUEUED |
static java.lang.String |
TXN_OPERATION_DELETE
|
static java.lang.String |
TXN_OPERATION_INSERT
|
static ActionType |
TYPE_ACTIVATION_SCHEDULE_DEPLOY
The constant representing "Schedule a config deploy for activation key" [ID:22] |
static ActionType |
TYPE_ACTIVATION_SCHEDULE_PKG_INSTALL
The constant representing "Schedule a package install for activation key". |
static ActionType |
TYPE_CONFIGFILES_DEPLOY
The constant representing "Deploy config files to system". |
static ActionType |
TYPE_CONFIGFILES_DIFF
The constant representing "Show differences between profiled config files and deployed config files" [ID:18] |
static ActionType |
TYPE_CONFIGFILES_MTIME_UPLOAD
The constant representing "Upload config file data based upon mtime to server" [ID:23] |
static ActionType |
TYPE_CONFIGFILES_UPLOAD
The constant representing "Import config file data from system". |
static ActionType |
TYPE_CONFIGFILES_VERIFY
The constant representing "Verify deployed config files" [ID:17] |
static ActionType |
TYPE_DAEMON_CONFIG
The constant representing "RHN Daemon Configuration". |
static ActionType |
TYPE_ERRATA
The constant representing Errata action. |
static ActionType |
TYPE_HARDWARE_REFRESH_LIST
The constant representing Hardware Refreshlist action. |
static ActionType |
TYPE_KICKSTART_INITIATE
The constant representing "Initiate a kickstart". |
static ActionType |
TYPE_KICKSTART_INITIATE_GUEST
The constant representing "Initiate a kickstart for a guest". |
static ActionType |
TYPE_KICKSTART_SCHEDULE_SYNC
The constant representing "Schedule a package sync for kickstarts". |
static ActionType |
TYPE_PACKAGES_AUTOUPDATE
The constant representing "Automatic package installation". |
static ActionType |
TYPE_PACKAGES_DELTA
The constant representing Package Delta action. |
static ActionType |
TYPE_PACKAGES_REFRESH_LIST
The constant representing Package Refresh List action. |
static ActionType |
TYPE_PACKAGES_REMOVE
The constant representing Package Remove action. |
static ActionType |
TYPE_PACKAGES_RUNTRANSACTION
The constant representing "Package Synchronization". |
static ActionType |
TYPE_PACKAGES_UPDATE
The constant representing Package Update action. |
static ActionType |
TYPE_PACKAGES_VERIFY
The constant representing "Verify deployed packages" [ID:33] |
static ActionType |
TYPE_REBOOT
The constant representing Reboot action. |
static ActionType |
TYPE_RHN_APPLET_USE_SATELLITE
The constant representing "Allows for rhn-applet use with an Spacewalk" [ID:34] |
static ActionType |
TYPE_ROLLBACK_CONFIG
The constant representing Rollback Config action. |
static ActionType |
TYPE_ROLLBACK_LISTTRANSACTIONS
The constant representing "Refresh server-side transaction list" [ID:11] |
static ActionType |
TYPE_ROLLBACK_ROLLBACK
The constant representing "Rollback a transaction". |
static ActionType |
TYPE_SCRIPT_RUN
The constant representing "Run an arbitrary script". |
static ActionType |
TYPE_SOLARISPKGS_INSTALL
The constant representing "Solaris Package Install" [ID:24] |
static ActionType |
TYPE_SOLARISPKGS_PATCHCLUSTERINSTALL
The constant representing "Solaris Patch Cluster Install" [ID:28] |
static ActionType |
TYPE_SOLARISPKGS_PATCHCLUSTERREMOVE
The constant representing "Solaris Patch Cluster Removal" [ID:29] |
static ActionType |
TYPE_SOLARISPKGS_PATCHINSTALL
The constant representing "Solaris Patch Install" [ID:26] |
static ActionType |
TYPE_SOLARISPKGS_PATCHREMOVE
The constant representing "Solaris Patch Removal" [ID:27] |
static ActionType |
TYPE_SOLARISPKGS_REFRESH_LIST
The constant representing "Solaris Package List Refresh". |
static ActionType |
TYPE_SOLARISPKGS_REMOVE
The constant representing "Solaris Package Removal". |
static ActionType |
TYPE_UP2DATE_CONFIG_GET
The constant representing RHN Get server up2date config action. |
static ActionType |
TYPE_UP2DATE_CONFIG_UPDATE
The constant representing RHN Update server up2date config action. |
static ActionType |
TYPE_VIRTIZATION_HOST_SUBSCRIBE_TO_TOOLS_CHANNEL
The constant representing "Subscribes a server to the RHN Tools channel associated with its base channel." [ID:46] |
static ActionType |
TYPE_VIRTUALIZATION_DESTROY
The constant representing "Destroys a Xen Domain." [ID:41] |
static ActionType |
TYPE_VIRTUALIZATION_GUEST_PACKAGE_INSTALL
The constant representing "Allows for rhn-applet use with an Spacewalk" [ID:45] |
static ActionType |
TYPE_VIRTUALIZATION_GUEST_SUBSCRIBE_TO_TOOLS_CHANNEL
The constant represting "Subscribes a virtualization guest to the RHN Tools channel associated with its base channel." [ID: 47] |
static ActionType |
TYPE_VIRTUALIZATION_HOST_PACKAGE_INSTALL
The constant representing "Allows for rhn-applet use with an Spacewalk" [ID:44] |
static ActionType |
TYPE_VIRTUALIZATION_REBOOT
The constant representing "Reboots a Xen domain." [ID:40] |
static ActionType |
TYPE_VIRTUALIZATION_RESUME
The constant representing "Resumes a Xen domain." [ID:39] |
static ActionType |
TYPE_VIRTUALIZATION_SCHEDULE_POLLER
The constant representing "Allows for rhn-applet use with an Spacewalk" [ID:43] |
static ActionType |
TYPE_VIRTUALIZATION_SET_MEMORY
The constant representing "Sets the maximum memory usage for a Xen domain." [ID:42] |
static ActionType |
TYPE_VIRTUALIZATION_SET_VCPUS
The constant representing "Sets the Vcpu usage for a Xen domain." [ID:48] |
static ActionType |
TYPE_VIRTUALIZATION_SHUTDOWN
The constant representing "Shuts down a Xen domain." [ID:36] |
static ActionType |
TYPE_VIRTUALIZATION_START
The constant representing "Starts up a Xen domain." [ID:37] |
static ActionType |
TYPE_VIRTUALIZATION_SUSPEND
The constant representing "Suspends a Xen domain." [ID:38] |
| Method Summary | |
|---|---|
static void |
addConfigRevisionToAction(ConfigRevision revision,
Server server,
ConfigAction parent)
Create a ConfigRevisionAction for the given server and add it to the parent action. |
static void |
addServerToAction(java.lang.Long sid,
Action parent)
Creates a ServerAction and adds it to an Action |
static void |
addServerToAction(Server server,
Action parent)
Creates a ServerAction and adds it to an Action |
static boolean |
checkActionArchType(Action actionCheck,
java.lang.String actionStyle)
Check the ActionType against the ActionArchType to see |
static Action |
createAction(ActionType typeIn)
Create a new Action from scratch. |
static Action |
createAction(ActionType typeIn,
java.util.Date earliest)
Create a new Action from scratch with the given earliest execution. |
static ScriptActionDetails |
createScriptActionDetails(java.lang.String username,
java.lang.String groupname,
java.lang.Long timeout,
java.lang.String script)
Creates a ScriptActionDetails which contains an arbitrary script to be run by a ScriptRunAction. |
static void |
deleteServerActionsByParent(java.util.Set parentActions)
Delete the server actions associated with the given set of parent actions. |
static boolean |
doesServerHaveKickstartScheduled(java.lang.Long serverId)
Check to see if a server has a pending kickstart scheduled |
protected Logger |
getLogger()
Get the Logger for the derived class so log messages show up on the correct class |
static java.util.List |
listActionsForServer(User user,
Server serverIn)
Lookup a List of Action objects for a given Server. |
static Action |
lookupById(java.lang.Long id)
Lookup a Action by their id |
static Action |
lookupByUserAndId(User user,
java.lang.Long id)
Lookup an Action by the id, assuming that it is in the same Org as the user doing the search. |
static ConfigRevisionActionResult |
lookupConfigActionResult(java.lang.Long actionConfigRevisionId)
Helper method to get a ConfigRevisionActionResult by Action Config Revision Id |
static ConfigRevisionAction |
lookupConfigRevisionAction(java.lang.Long id)
Helper method to get a ConfigRevisionAction by Action Config Revision Id |
static java.util.Set |
lookupDependentActions(Action parentAction)
Recursively query the hierarchy of actions dependent on a given parent. |
static Action |
lookupLastCompletedAction(User user,
ActionType type,
Server server)
Lookup the last completed Action on a Server given the user, action type and server. |
static void |
remove(Action actionIn)
Remove a Action from the DB |
static int |
removeAction(java.lang.Long actionId)
Removes an action from all its associated systems |
static int |
removeActionForSystemSet(java.lang.Number actionId,
java.lang.String setLabel,
User user)
Remove an action for an rhnset of system ids with the given label |
static void |
save(Action actionIn)
Insert or Update a Action. |
| Methods inherited from class com.redhat.rhn.common.hibernate.HibernateFactory |
|---|
addConfigurator, blobToByteArray, blobToString, byteArrayToBlob, closeSession, closeSessionFactory, commitTransaction, createSessionFactory, executeSelectMode, getByteArrayContents, getObject, getSession, initialize, inTransaction, isClosed, isInitialized, listObjectsByNamedQuery, listObjectsByNamedQuery, lookupObjectByNamedQuery, lookupObjectByNamedQuery, reload, removeObject, rollbackTransaction, saveObject, saveObject, stringToBlob |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ActionStatus STATUS_QUEUED
public static final ActionStatus STATUS_COMPLETED
public static final ActionStatus STATUS_FAILED
public static final ActionType TYPE_PACKAGES_REFRESH_LIST
public static final ActionType TYPE_HARDWARE_REFRESH_LIST
public static final ActionType TYPE_PACKAGES_UPDATE
public static final ActionType TYPE_PACKAGES_REMOVE
public static final ActionType TYPE_ERRATA
public static final ActionType TYPE_UP2DATE_CONFIG_GET
public static final ActionType TYPE_UP2DATE_CONFIG_UPDATE
public static final ActionType TYPE_PACKAGES_DELTA
public static final ActionType TYPE_REBOOT
public static final ActionType TYPE_ROLLBACK_CONFIG
public static final ActionType TYPE_ROLLBACK_LISTTRANSACTIONS
public static final ActionType TYPE_PACKAGES_AUTOUPDATE
public static final ActionType TYPE_PACKAGES_RUNTRANSACTION
public static final ActionType TYPE_CONFIGFILES_UPLOAD
public static final ActionType TYPE_CONFIGFILES_DEPLOY
public static final ActionType TYPE_CONFIGFILES_VERIFY
public static final ActionType TYPE_CONFIGFILES_DIFF
public static final ActionType TYPE_KICKSTART_INITIATE
public static final ActionType TYPE_KICKSTART_INITIATE_GUEST
public static final ActionType TYPE_KICKSTART_SCHEDULE_SYNC
public static final ActionType TYPE_ACTIVATION_SCHEDULE_PKG_INSTALL
public static final ActionType TYPE_ACTIVATION_SCHEDULE_DEPLOY
public static final ActionType TYPE_CONFIGFILES_MTIME_UPLOAD
public static final ActionType TYPE_SOLARISPKGS_INSTALL
public static final ActionType TYPE_SOLARISPKGS_REMOVE
public static final ActionType TYPE_SOLARISPKGS_PATCHINSTALL
public static final ActionType TYPE_SOLARISPKGS_PATCHREMOVE
public static final ActionType TYPE_SOLARISPKGS_PATCHCLUSTERINSTALL
public static final ActionType TYPE_SOLARISPKGS_PATCHCLUSTERREMOVE
public static final ActionType TYPE_SCRIPT_RUN
public static final ActionType TYPE_SOLARISPKGS_REFRESH_LIST
public static final ActionType TYPE_DAEMON_CONFIG
public static final ActionType TYPE_PACKAGES_VERIFY
public static final ActionType TYPE_RHN_APPLET_USE_SATELLITE
public static final ActionType TYPE_ROLLBACK_ROLLBACK
public static final ActionType TYPE_VIRTUALIZATION_SHUTDOWN
public static final ActionType TYPE_VIRTUALIZATION_START
public static final ActionType TYPE_VIRTUALIZATION_SUSPEND
public static final ActionType TYPE_VIRTUALIZATION_RESUME
public static final ActionType TYPE_VIRTUALIZATION_REBOOT
public static final ActionType TYPE_VIRTUALIZATION_DESTROY
public static final ActionType TYPE_VIRTUALIZATION_SET_MEMORY
public static final ActionType TYPE_VIRTUALIZATION_SET_VCPUS
public static final ActionType TYPE_VIRTUALIZATION_SCHEDULE_POLLER
public static final ActionType TYPE_VIRTUALIZATION_HOST_PACKAGE_INSTALL
public static final ActionType TYPE_VIRTUALIZATION_GUEST_PACKAGE_INSTALL
public static final ActionType TYPE_VIRTIZATION_HOST_SUBSCRIBE_TO_TOOLS_CHANNEL
public static final ActionType TYPE_VIRTUALIZATION_GUEST_SUBSCRIBE_TO_TOOLS_CHANNEL
public static final java.lang.String TXN_OPERATION_INSERT
public static final java.lang.String TXN_OPERATION_DELETE
| Method Detail |
|---|
public static int removeAction(java.lang.Long actionId)
actionId - action to remove
public static int removeActionForSystemSet(java.lang.Number actionId,
java.lang.String setLabel,
User user)
actionId - the action to removesetLabel - the set label to pull the ids fromuser - the user witht he set
protected Logger getLogger()
getLogger in class HibernateFactory
public static void addServerToAction(java.lang.Long sid,
Action parent)
sid - The server idparent - The parent action
public static void addServerToAction(Server server,
Action parent)
server - The serverparent - The parent action
public static void addConfigRevisionToAction(ConfigRevision revision,
Server server,
ConfigAction parent)
revision - The config revision to add to the action.server - The server for the actionparent - The parent action
public static ScriptActionDetails createScriptActionDetails(java.lang.String username,
java.lang.String groupname,
java.lang.Long timeout,
java.lang.String script)
username - Username of scriptgroupname - Group script runs asscript - Script contentstimeout - script timeout
public static boolean doesServerHaveKickstartScheduled(java.lang.Long serverId)
serverId - server
public static Action createAction(ActionType typeIn)
typeIn - the type of Action we want to create
public static Action createAction(ActionType typeIn,
java.util.Date earliest)
typeIn - the type of Action we want to createearliest - The earliest time that this action can occur.
public static Action lookupByUserAndId(User user,
java.lang.Long id)
user - the user doing the searchid - of the Action to search for
public static Action lookupLastCompletedAction(User user,
ActionType type,
Server server)
user - the user doing the search (needed for permssion checking)type - the action type of the action to be queried.server - the server who's latest completed action is desired.
public static Action lookupById(java.lang.Long id)
id - the id to search for
public static ConfigRevisionActionResult lookupConfigActionResult(java.lang.Long actionConfigRevisionId)
actionConfigRevisionId - the id of the ActionConfigRevision
for whom we want to lookup the result
public static ConfigRevisionAction lookupConfigRevisionAction(java.lang.Long id)
id - the id of the ActionConfigRevision
for whom we want to lookup the result
public static void save(Action actionIn)
actionIn - Action to be stored in database.public static void remove(Action actionIn)
actionIn - Action to be removed from database.
public static boolean checkActionArchType(Action actionCheck,
java.lang.String actionStyle)
actionCheck - the Action we want to see if the type matches againstactionStyle - the String type we want to check
public static java.util.Set lookupDependentActions(Action parentAction)
parentAction - Parent action.
public static void deleteServerActionsByParent(java.util.Set parentActions)
parentActions - Set of parent actions.
public static java.util.List listActionsForServer(User user,
Server serverIn)
user - the user doing the searchserverIn - you want to limit the list of Actions to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||