public class ActivationKeyFactory extends HibernateFactory
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DESCRIPTION |
Constructor and Description |
---|
ActivationKeyFactory() |
Modifier and Type | Method and Description |
---|---|
static ActivationKey |
createNewKey(User user,
Server server,
java.lang.String key,
java.lang.String note,
java.lang.Long usageLimit,
Channel baseChannel,
boolean universalDefault)
Creates and fills out a new Activation Key (Including generating a key/token).
|
static ActivationKey |
createNewKey(User user,
java.lang.String note)
Creates and fills out a new Activation Key (Including generating a key/token).
|
static java.lang.String |
generateKey()
Generate a random activation key string.
|
protected org.apache.log4j.Logger |
getLogger()
Get the Logger for the derived class so log messages show up on the
correct class
|
static java.util.List<KickstartData> |
listAssociatedKickstarts(ActivationKey key)
List all kickstarts associated with an activation key
|
static ActivationKey |
lookupByKey(java.lang.String key)
Lookup an ActivationKey by it's key string.
|
static ActivationKey |
lookupByKickstartSession(KickstartSession sess)
Lookup an ActivationKey by its associated KickstartSession.
|
static java.util.List<ActivationKey> |
lookupByServer(Server server)
Lookup an ActivationKey by its associated Server.
|
static ActivationKey |
lookupByToken(Token tokenIn)
Lookup the root ActivationKey based on the token.
|
static void |
removeKey(ActivationKey key)
Remove an ActivationKey
|
static int |
removeKeysForServer(java.lang.Long sid)
Remove all activation-keys associated with a given server
|
static void |
save(ActivationKey keyIn)
Saves an ActivationKey to the database
|
static void |
validateKeyName(java.lang.String key)
Basically validates the name of key, makes sure it doesnot have invalid chars etc...
|
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 java.lang.String DEFAULT_DESCRIPTION
public static ActivationKey lookupByKey(java.lang.String key)
key
- The key for the ActivationKeypublic static ActivationKey lookupByToken(Token tokenIn)
tokenIn
- token coming inpublic static ActivationKey createNewKey(User user, java.lang.String note)
user
- The user for the keynote
- The note to attach to the keypublic static ActivationKey createNewKey(User user, Server server, java.lang.String key, java.lang.String note, java.lang.Long usageLimit, Channel baseChannel, boolean universalDefault)
user
- The user for the keyserver
- The server for the keykey
- Key to use, blank to have one auto-generatednote
- The note to attach to the keyusageLimit
- Usage limit for the activation keybaseChannel
- Base channel for the activation keyuniversalDefault
- Whether or not this key should be set as the universal
default.public static void validateKeyName(java.lang.String key)
key
- the name of the key.public static java.lang.String generateKey()
public static void save(ActivationKey keyIn)
keyIn
- The ActivationKey to save.protected org.apache.log4j.Logger getLogger()
getLogger
in class HibernateFactory
public static ActivationKey lookupByKickstartSession(KickstartSession sess)
sess
- that is associated with ActivationKeypublic static java.util.List<ActivationKey> lookupByServer(Server server)
server
- that is associated with ActivationKeypublic static int removeKeysForServer(java.lang.Long sid)
sid
- server-id of the server of interestpublic static void removeKey(ActivationKey key)
key
- to removepublic static java.util.List<KickstartData> listAssociatedKickstarts(ActivationKey key)
key
- the key to look for associations with