public class ActivationKeyManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addChannel(ActivationKey key,
Channel channel)
Add a channel to an activation key.
|
void |
addEntitlements(ActivationKey key,
java.util.List<java.lang.String> entitlementLabels)
Add entitlements to an activation key.
|
void |
addPackage(ActivationKey key,
PackageName packageName,
PackageArch packageArch)
Add a package to an activation key using the PackageName and PackageArch
provided.
|
void |
addServerGroup(ActivationKey key,
ManagedServerGroup group)
Add a ServerGroup to an activation key.
|
void |
changeKey(java.lang.String newKey,
ActivationKey key,
User user)
Renames a given key to new key.
|
ActivationKey |
createNewActivationKey(User user,
java.lang.String note)
Create a new ActivationKey object for a given user, and note.
|
ActivationKey |
createNewActivationKey(User user,
java.lang.String key,
java.lang.String note,
java.lang.Long usageLimit,
Channel baseChannel,
boolean universalDefault)
Create a new ActivationKey object for a given user, and note.
|
ActivationKey |
createNewReActivationKey(User user,
Server server,
java.lang.String note)
Create a new Re-ActivationKey object for a given user, server, and note
|
ActivationKey |
createNewReActivationKey(User user,
Server server,
java.lang.String note,
KickstartSession session)
Create a new Re-ActivationKey object for a given user, server, and note
|
ActivationKey |
createNewReActivationKey(User user,
Server server,
java.lang.String key,
java.lang.String note,
java.lang.Long usageLimit,
Channel baseChannel,
boolean universalDefault,
KickstartSession session)
Create a new Re-ActivationKey object for a given user, server, and note.
|
java.util.List<ActivationKey> |
findAll(User requester)
Finds all activation keys visible to user.
|
java.util.List<ActivationKey> |
findByServer(Server server,
User user)
Look up an ActivationKey object by server
|
static ActivationKeyManager |
getInstance() |
ActivationKey |
lookupByKey(java.lang.String key,
User user)
Look up an ActivationKey object by it's key.
|
void |
remove(ActivationKey key,
User user)
Removes an activation key.
|
void |
removeChannel(ActivationKey key,
Channel channel)
Remove a channel from an activation key.
|
void |
removeEntitlements(ActivationKey key,
java.util.List<java.lang.String> entitlementLabels)
Remove entitlements from an activation key.
|
void |
removePackage(ActivationKey key,
PackageName packageName,
PackageArch packageArch)
Removes all packages from the activation key that match the PackageName
and PackageArch given.
|
void |
removeServerGroup(ActivationKey key,
ServerGroup group)
Remove a ServerGroup from an activation key.
|
void |
setupAutoConfigDeployment(ActivationKey key)
setups auto deployment of config files
basically does things like adding config mgmt packages
and subscribing to config channels...
|
void |
setupVirtEntitlement(ActivationKey key)
Enables the activation key to be virtualization ready
Adds the virt channel, the tools channel
and adds the rn-virtualization-host package
|
void |
update(ActivationKey target,
java.lang.String description,
Channel baseChannel)
Update the given ActivationKey details.
|
void |
validateAddOnEntitlements(java.util.List<java.lang.String> entitlements,
boolean adding)
Validate the requested entitlements.
|
void |
validateCredentials(User user,
java.lang.String keyStr,
ActivationKey key)
validates that the given user can administer
the given activation key.
|
public static ActivationKeyManager getInstance()
public java.util.List<ActivationKey> findByServer(Server server, User user)
server
- The server in questionuser
- needed for authenticationpublic ActivationKey lookupByKey(java.lang.String key, User user)
key
- The activation key we're searching for.user
- needed for authentication..public ActivationKey createNewReActivationKey(User user, Server server, java.lang.String note, KickstartSession session)
user
- The user creating the activation keyserver
- The server for the activation keynote
- A note about the activation keysession
- the kickstart session associated with the keypublic ActivationKey createNewReActivationKey(User user, Server server, java.lang.String note)
user
- The user creating the activation keyserver
- The server for the activation keynote
- A note about the activation keypublic ActivationKey createNewReActivationKey(User user, Server server, java.lang.String key, java.lang.String note, java.lang.Long usageLimit, Channel baseChannel, boolean universalDefault, KickstartSession session)
user
- The user creating the activation keyserver
- the server to create the key forkey
- Key to use, empty string to have one auto-generatednote
- A note about the activation 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.session
- the kickstart session to associatepublic ActivationKey createNewActivationKey(User user, java.lang.String note)
user
- The user creating the activation keynote
- A note about the activation keypublic ActivationKey createNewActivationKey(User user, java.lang.String key, java.lang.String note, java.lang.Long usageLimit, Channel baseChannel, boolean universalDefault)
user
- The user creating the activation keykey
- Key to use, empty string to have one auto-generatednote
- A note about the activation 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 void update(ActivationKey target, java.lang.String description, Channel baseChannel)
target
- Key to update.description
- New key description, null to leave unchanged.baseChannel
- New base channelpublic void addEntitlements(ActivationKey key, java.util.List<java.lang.String> entitlementLabels)
key
- Activation key to be acted uponentitlementLabels
- List of string entitlement labels for the activation keypublic void removeEntitlements(ActivationKey key, java.util.List<java.lang.String> entitlementLabels)
key
- Activation key to be acted uponentitlementLabels
- List of string entitlement labels for the activation keypublic void addChannel(ActivationKey key, Channel channel)
key
- Activation key to be acted uponchannel
- Channel to addpublic void removeChannel(ActivationKey key, Channel channel)
key
- Activation key to be acted uponchannel
- Channel to removepublic void addServerGroup(ActivationKey key, ManagedServerGroup group)
key
- Activation key to be acted upongroup
- ServerGroup to addpublic void removeServerGroup(ActivationKey key, ServerGroup group)
key
- Activation key to be acted upongroup
- ServerGroup to removepublic void addPackage(ActivationKey key, PackageName packageName, PackageArch packageArch)
key
- Activation key to be acted uponpackageName
- PackageName to addpackageArch
- PackageArch to addpublic void removePackage(ActivationKey key, PackageName packageName, PackageArch packageArch)
key
- Activation key to be acted uponpackageName
- PackageName to removepackageArch
- PackageArch to removepublic java.util.List<ActivationKey> findAll(User requester)
requester
- User requesting the list.public void validateCredentials(User user, java.lang.String keyStr, ActivationKey key)
user
- the user to authenticatekeyStr
- Key string used for lookup. Null if none was used. (i.e. lookup
by server)key
- the key to authenticatepublic void remove(ActivationKey key, User user)
key
- the key to removeuser
- TODOpublic void validateAddOnEntitlements(java.util.List<java.lang.String> entitlements, boolean adding)
entitlements
- List of string entitlement labels to be validated.adding
- True if adding entitlements, false if removing.public void changeKey(java.lang.String newKey, ActivationKey key, User user)
newKey
- the key to rename tokey
- the key object to be renameduser
- TODOpublic void setupAutoConfigDeployment(ActivationKey key)
key
- the activation key to be updated.public void setupVirtEntitlement(ActivationKey key)
key
- the activation key to be updated.