public class KickstartFactory extends HibernateFactory
Modifier and Type | Field and Description |
---|---|
static CryptoKeyType |
KEY_TYPE_GPG |
static CryptoKeyType |
KEY_TYPE_SSL |
static KickstartSessionState |
SESSION_STATE_COMPLETE |
static KickstartSessionState |
SESSION_STATE_CONFIG_ACCESSED |
static KickstartSessionState |
SESSION_STATE_CREATED |
static KickstartSessionState |
SESSION_STATE_FAILED |
static KickstartSessionState |
SESSION_STATE_STARTED |
static KickstartTreeType |
TREE_TYPE_EXTERNAL |
static KickstartVirtualizationType |
VIRT_TYPE_PV_HOST |
static KickstartVirtualizationType |
VIRT_TYPE_XEN_PV |
Modifier and Type | Method and Description |
---|---|
static KickstartCommand |
createKickstartCommand(KickstartData ksdata,
java.lang.String nameIn)
Create a new KickstartCommand object
|
static void |
failKickstartSessions(java.util.Set actionsToDelete,
java.util.Set servers)
Fail the kickstart sessions associated with the given actions and servers.
|
static KickstartableTree |
findTreeById(java.lang.Long treeId,
java.lang.Long orgId)
Load a tree based on its id and org id
|
protected org.apache.log4j.Logger |
getLogger()
Get the Logger for the derived class so log messages
show up on the correct class
|
static KickstartableTree |
getNewestTree(KickstartTreeUpdateType updateType,
java.lang.Long channelId,
Org org)
Returns the most recently modified KickstartableTree for that channel
|
static java.util.List<KickstartData> |
listAllKickstartData()
Lookup a list of all KickstartData objects located on the Satellite
Should not be used by much.
|
static java.util.List<KickstartData> |
listKickstartDataByCKeyDescription(java.lang.String ckDescription)
List kickstart data by crypto key
|
static java.util.List<java.lang.String> |
listKickstartDataCobblerIds()
Returns a list of kickstart data cobbler ids
this is useful for cobbler only profiles..
|
static java.util.List<KickstartableTree> |
listTreesByOrg(Org org)
Return a list of KickstartableTree objects in the Org
|
static java.util.List<KickstartableTree> |
listUnsyncedKickstartTrees()
Get a list of all trees that have a cobbler id of null
|
static java.util.List<KickstartableTree> |
lookupAccessibleTreesByOrg(Org org)
Fetch all trees for an org, these include
trees where org_id is null or org_id = org.id
|
static java.util.List<KickstartCommandName> |
lookupAllKickstartCommandNames(KickstartData ksdata)
Get the list of KickstartCommandName objects that are supportable by
the passed in KickstartData.
|
static java.util.List |
lookupAllKickstartSessionsByServer(java.lang.Long sidIn)
Get all the KickstartSessions associated with the passed in server id
|
static CryptoKey |
lookupCryptoKey(java.lang.String description,
Org org)
Lookup a crypto key by its description and org.
|
static CryptoKey |
lookupCryptoKeyById(java.lang.Long keyId,
Org org)
Lookup a crypto key by its id.
|
static java.util.List<CryptoKey> |
lookupCryptoKeys(Org org)
Find all crypto keys for a given org
|
static KickstartSession |
lookupDefaultKickstartSessionForKickstartData(KickstartData ksdata)
Lookup most recent KickstartSession for a the passed in KickstartData
|
static java.util.List<KickstartableTree> |
lookupKickstartableTrees(java.lang.Long channelId,
Org org)
Lookup a list of KickstartableTree objects that use the passed in channelId
|
static KickstartCommandName |
lookupKickstartCommandName(java.lang.String commandName)
Looks up a specific KickstartCommandName
|
static java.util.List<KickstartCommandName> |
lookupKickstartCommandNames(KickstartData ksdata)
Get the list of KickstartCommandName objects that are supportable by
the passed in KickstartData.
|
static KickstartData |
lookupKickstartDataByCILabelAndOrgId(java.lang.String label,
java.lang.Long orgId)
Lookup a KickstartData based on a case insensitive label and orgId
This is needed due to the cobbler converts the kickstart profiles to lowecase
|
static KickstartData |
lookupKickstartDataByCobblerIdAndOrg(Org orgIn,
java.lang.String cobblerId) |
static KickstartData |
lookupKickstartDataByIdAndOrg(Org orgIn,
java.lang.Long ksid) |
static KickstartData |
lookupKickstartDataByLabel(java.lang.String label)
Lookup a KickstartData based on a label
|
static KickstartData |
lookupKickstartDataByLabelAndOrgId(java.lang.String label,
java.lang.Long orgId)
Lookup a KickstartData based on a label and orgId
|
static java.util.List<KickstartData> |
lookupKickstartDataByUpdateable()
Lookup a list of all KickstartData objects that can automatically
update their KS Tree.
|
static java.util.List<KickstartData> |
lookupKickstartDatasByTree(KickstartableTree tree)
Lookup a list of KickstartData objects by the KickstartableTree.
|
static KickstartInstallType |
lookupKickstartInstallTypeByLabel(java.lang.String label)
Lookup a KickstartInstallType by label
|
static java.util.List |
lookupKickstartInstallTypes()
Return a List of KickstartInstallType classes.
|
static java.util.List |
lookupKickstartRequiredOptions() |
static KickstartScript |
lookupKickstartScript(Org org,
java.lang.Integer id)
Gets a kickstart script
|
static KickstartSession |
lookupKickstartSessionById(java.lang.Long sessionId)
Lookup a KickstartSession by its id.
|
static KickstartSession |
lookupKickstartSessionByServer(java.lang.Long sidIn)
Lookup a KickstartSession for a the passed in Server.
|
static KickstartableTree |
lookupKickstartTreeByCobblerIdOrXenId(java.lang.String cobblerId)
lookup kickstart tree by it's cobbler id
|
static KickstartableTree |
lookupKickstartTreeByIdAndOrg(java.lang.Long treeId,
Org org)
Lookup KickstartableTree by tree id and org id
|
static KickstartableTree |
lookupKickstartTreeByLabel(java.lang.String label)
Lookup a KickstartableTree by its label.
|
static KickstartableTree |
lookupKickstartTreeByLabel(java.lang.String label,
Org org)
Lookup a KickstartableTree by its label.
|
static java.util.List<KickstartableTree> |
lookupKickstartTrees()
list all kickstart trees stored in the satellite
|
static java.util.List<KickstartableTree> |
lookupKickstartTreesByChannelAndNullOrg(java.lang.Long channelId)
Lookup a list of KickstartableTree objects that use the passed in channelId
|
static java.util.List<KickstartableTree> |
lookupKickstartTreesByChannelAndOrg(java.lang.Long channelId,
Org org)
Lookup a list of KickstartableTree objects that use the passed in channelId
|
static KickstartVirtualizationType |
lookupKickstartVirtualizationTypeByLabel(java.lang.String label)
Lookup a KickstartVirtualizationType by label
|
static java.util.List<KickstartPackage> |
lookupKsPackageByKsDataAndPackageName(KickstartData ksData,
PackageName packageName) |
static KickstartData |
lookupOrgDefault(Org org)
Lookup a KickstartData that has its isOrgDefault value set to true
This may return null if there aren't any set.
|
static java.util.List<KickstartIpRange> |
lookupRangeByOrg(Org org) |
static KickstartSessionState |
lookupSessionStateByLabel(java.lang.String label)
Helper method to lookup KickstartSessionState by label
|
static SslCryptoKey |
lookupSslCryptoKeyById(java.lang.Long keyId,
Org org)
Lookup a ssl crypto key by its id.
|
static java.util.List<SslCryptoKey> |
lookupSslCryptoKeys(Org org)
Find all ssl crypto keys for a given org
|
static java.util.List |
lookupVirtualizationTypes()
Fetch all virtualization types
|
static void |
removeCryptoKey(CryptoKey cryptoKeyIn)
remove a CryptoKey from the DB.
|
static void |
removeKickstartableTree(KickstartableTree tree)
Remove KickstartableTree from the DB.
|
static int |
removeKickstartData(KickstartData ksdataIn) |
static void |
removeKickstartScript(KickstartScript script)
Completely remove a kickstart script from the system
|
static void |
removeKickstartTemplatePath(KickstartData ksdataIn)
Removes ks cfg template path
|
static void |
removePackage(KickstartPackage p) |
static void |
saveCommand(KickstartCommand commandIn)
Insert or Update a Command.
|
static void |
saveCryptoKey(CryptoKey cryptoKeyIn)
Insert or Update a CryptoKey.
|
static void |
saveKickstartableTree(KickstartableTree tree)
Save the KickstartableTree to the DB.
|
static void |
saveKickstartData(KickstartData ksdataIn) |
static void |
saveKickstartData(KickstartData ksdataIn,
KickstartSession ksession)
Save a KickstartData to the DB and associate
the storage with the KickstartSession passed in.
|
static void |
saveKickstartSession(KickstartSession ksession)
Save a KickstartSession object
|
static void |
savePackage(KickstartPackage p) |
static boolean |
verifyTreeAssignment(java.lang.Long channelId,
java.lang.Long orgId,
java.lang.Long treeId)
Verfies that a given kickstart tree can be used based on a channel id
and org id
|
addConfigurator, blobToByteArray, byteArrayToBlob, closeSession, closeSessionFactory, commitTransaction, createSessionFactory, createSessionFactory, executeCallableMode, executeSelectMode, getBlobContents, getByteArrayContents, getObject, getSession, initialize, inTransaction, isClosed, isInitialized, listObjectsByNamedQuery, listObjectsByNamedQuery, listObjectsByNamedQuery, lockObject, lookupObjectByNamedQuery, lookupObjectByNamedQuery, reload, removeObject, rollbackTransaction, saveObject, saveObject, stringToByteArray
public static final CryptoKeyType KEY_TYPE_GPG
public static final CryptoKeyType KEY_TYPE_SSL
public static final KickstartSessionState SESSION_STATE_FAILED
public static final KickstartSessionState SESSION_STATE_CREATED
public static final KickstartSessionState SESSION_STATE_STARTED
public static final KickstartSessionState SESSION_STATE_COMPLETE
public static final KickstartSessionState SESSION_STATE_CONFIG_ACCESSED
public static final KickstartVirtualizationType VIRT_TYPE_PV_HOST
public static final KickstartVirtualizationType VIRT_TYPE_XEN_PV
public static final KickstartTreeType TREE_TYPE_EXTERNAL
protected org.apache.log4j.Logger getLogger()
getLogger
in class HibernateFactory
public static KickstartableTree getNewestTree(KickstartTreeUpdateType updateType, java.lang.Long channelId, Org org)
updateType
- The type of kickstart tree to allow, all or redhat-onlychannelId
- The base chanenlorg
- The users org to look for cusome kickstart trees inpublic static KickstartData lookupKickstartDataByIdAndOrg(Org orgIn, java.lang.Long ksid)
orgIn
- Org associated with Kickstart Dataksid
- Kickstart Data Id to lookuppublic static KickstartData lookupKickstartDataByCobblerIdAndOrg(Org orgIn, java.lang.String cobblerId)
orgIn
- Org associated with Kickstart DatacobblerId
- Kickstart Data Cobbler Id Id to lookuppublic static KickstartData lookupKickstartDataByLabelAndOrgId(java.lang.String label, java.lang.Long orgId)
label
- to lookuporgId
- who owns KickstartDatapublic static KickstartData lookupKickstartDataByCILabelAndOrgId(java.lang.String label, java.lang.Long orgId)
label
- to lookuporgId
- who owns KickstartDatapublic static KickstartData lookupKickstartDataByLabel(java.lang.String label)
label
- to lookuppublic static java.util.List<java.lang.String> listKickstartDataCobblerIds()
public static KickstartableTree lookupKickstartTreeByCobblerIdOrXenId(java.lang.String cobblerId)
cobblerId
- the cobbler id to lookuppublic static java.util.List<KickstartCommandName> lookupKickstartCommandNames(KickstartData ksdata)
ksdata
- KickstartData object to check compatibility withpublic static java.util.List<KickstartCommandName> lookupAllKickstartCommandNames(KickstartData ksdata)
ksdata
- KickstartData object to check compatibility withpublic static KickstartCommandName lookupKickstartCommandName(java.lang.String commandName)
commandName
- name of the KickstartCommandNamepublic static KickstartCommand createKickstartCommand(KickstartData ksdata, java.lang.String nameIn)
ksdata
- to associate withnameIn
- of KickstartCommandpublic static java.util.List lookupKickstartRequiredOptions()
public static void saveCryptoKey(CryptoKey cryptoKeyIn)
cryptoKeyIn
- CryptoKey to be stored in database.public static void removeCryptoKey(CryptoKey cryptoKeyIn)
cryptoKeyIn
- CryptoKey to be removed from the database.public static void saveCommand(KickstartCommand commandIn)
commandIn
- Command to be stored in database.public static void saveKickstartData(KickstartData ksdataIn, KickstartSession ksession)
ksdataIn
- Kickstart Data to be stored in dbksession
- KickstartSession to associate with this save.public static void saveKickstartData(KickstartData ksdataIn)
ksdataIn
- Kickstart Data to be stored in dbpublic static int removeKickstartData(KickstartData ksdataIn)
ksdataIn
- Kickstart Data to be removed from the dbpublic static void removeKickstartTemplatePath(KickstartData ksdataIn)
ksdataIn
- kickstart datapublic static CryptoKey lookupCryptoKey(java.lang.String description, Org org)
description
- to checkorg
- to lookup inpublic static java.util.List<CryptoKey> lookupCryptoKeys(Org org)
org
- owning orgpublic static java.util.List<SslCryptoKey> lookupSslCryptoKeys(Org org)
org
- owning orgpublic static CryptoKey lookupCryptoKeyById(java.lang.Long keyId, Org org)
keyId
- to lookuporg
- who owns the keypublic static SslCryptoKey lookupSslCryptoKeyById(java.lang.Long keyId, Org org)
keyId
- to lookuporg
- who owns the keypublic static java.util.List<KickstartIpRange> lookupRangeByOrg(Org org)
org
- who owns the Kickstart Rangepublic static KickstartableTree lookupKickstartTreeByLabel(java.lang.String label, Org org)
label
- to lookuporg
- who owns the Tree. If none found will lookup RHN owned Treespublic static KickstartableTree lookupKickstartTreeByLabel(java.lang.String label)
label
- to lookuppublic static java.util.List<KickstartableTree> lookupKickstartTreesByChannelAndOrg(java.lang.Long channelId, Org org)
channelId
- that owns the kickstart treesorg
- who owns the treespublic static java.util.List<KickstartableTree> lookupKickstartTreesByChannelAndNullOrg(java.lang.Long channelId)
channelId
- The base channel of the kickstart treespublic static java.util.List<KickstartableTree> lookupKickstartableTrees(java.lang.Long channelId, Org org)
channelId
- that owns the kickstart treesorg
- who owns the treespublic static java.util.List<KickstartableTree> lookupAccessibleTreesByOrg(Org org)
org
- owning orgpublic static java.util.List<KickstartableTree> listTreesByOrg(Org org)
org
- to lookup bypublic static java.util.List<KickstartData> listKickstartDataByCKeyDescription(java.lang.String ckDescription)
ckDescription
- crypto key descriptionpublic static java.util.List<KickstartableTree> lookupKickstartTrees()
public static KickstartableTree lookupKickstartTreeByIdAndOrg(java.lang.Long treeId, Org org)
treeId
- desired treeorg
- owning orgpublic static KickstartSession lookupKickstartSessionByServer(java.lang.Long sidIn)
sidIn
- id of the Server that you want to lookup the most
recent KickstartSession forpublic static KickstartSession lookupDefaultKickstartSessionForKickstartData(KickstartData ksdata)
ksdata
- object you want to get recent KickstartSession forpublic static KickstartSessionState lookupSessionStateByLabel(java.lang.String label)
label
- Label to lookuppublic static void saveKickstartSession(KickstartSession ksession)
ksession
- to save.public static java.util.List lookupAllKickstartSessionsByServer(java.lang.Long sidIn)
sidIn
- of Server we want the Sessions forpublic static KickstartSession lookupKickstartSessionById(java.lang.Long sessionId)
sessionId
- to lookuppublic static boolean verifyTreeAssignment(java.lang.Long channelId, java.lang.Long orgId, java.lang.Long treeId)
channelId
- base channelorgId
- orgtreeId
- kickstart treepublic static KickstartableTree findTreeById(java.lang.Long treeId, java.lang.Long orgId)
treeId
- kickstart tree idorgId
- org idpublic static KickstartInstallType lookupKickstartInstallTypeByLabel(java.lang.String label)
label
- to lookup bypublic static java.util.List lookupKickstartInstallTypes()
public static void saveKickstartableTree(KickstartableTree tree)
tree
- to savepublic static void removeKickstartableTree(KickstartableTree tree)
tree
- to deletepublic static java.util.List<KickstartData> lookupKickstartDatasByTree(KickstartableTree tree)
tree
- to lookup bypublic static java.util.List<KickstartData> listAllKickstartData()
public static java.util.List<KickstartData> lookupKickstartDataByUpdateable()
public static KickstartData lookupOrgDefault(Org org)
org
- who owns the Kickstart.public static java.util.List lookupVirtualizationTypes()
public static KickstartVirtualizationType lookupKickstartVirtualizationTypeByLabel(java.lang.String label)
label
- to lookup bypublic static void failKickstartSessions(java.util.Set actionsToDelete, java.util.Set servers)
actionsToDelete
- Actions associated with the kickstart sessions to fail.servers
- Servers assocaited with the kickstart sessions to fail.public static KickstartScript lookupKickstartScript(Org org, java.lang.Integer id)
org
- the org doing the requestid
- the id of the scriptpublic static void removeKickstartScript(KickstartScript script)
script
- the script to removepublic static java.util.List<KickstartableTree> listUnsyncedKickstartTrees()
public static void savePackage(KickstartPackage p)
p
- KickstartPackage to add to DBpublic static void removePackage(KickstartPackage p)
p
- KickstartPackage to remove from DBpublic static java.util.List<KickstartPackage> lookupKsPackageByKsDataAndPackageName(KickstartData ksData, PackageName packageName)
ksData
- KcikstartData to lookuppackageName
- PackageName to lookup