com.redhat.rhn.domain.token
Class ActivationKey

java.lang.Object
  extended by com.redhat.rhn.domain.BaseDomainHelper
      extended by com.redhat.rhn.domain.token.ActivationKey

public class ActivationKey
extends BaseDomainHelper

ActivationKey


Constructor Summary
ActivationKey()
           
 
Method Summary
 void addChannel(Channel channelIn)
          Add a Channel to this ActivationKey
 void addEntitlement(ServerGroupType entitlementIn)
           
 void addPackageName(PackageName packageNameIn)
          Add a PackageName to this ActivationKey
 void addServerGroup(ManagedServerGroup serverGroupIn)
          Add a ServerGroup to this ActivationKey
 void clearChannels()
          Clear all channels associated with this token.
 void clearConfigChannels()
          Clear all config channel associated with this activation key.
 void clearPackageNames()
          Clear all package names associated with this activation key.
 Channel getBaseChannel()
          Return the base channel or null if none exists
 java.util.Set<Channel> getChannels()
          Get the Set of Channels associated with this ActivationKey
 java.util.List getConfigChannelsFor(User user)
          Returns the config channels associated to this activation key Throws a LookupException if the user does NOT have permissson to access/deal with these channels.
 User getCreator()
           
 boolean getDeployConfigs()
           
 java.util.Set<ServerGroupType> getEntitlements()
           
 java.lang.Long getId()
           
 java.lang.String getKey()
           
 KickstartSession getKickstartSession()
           
 java.lang.String getNote()
           
 Org getOrg()
           
 java.util.Set<PackageName> getPackageNames()
          Get the Set of PackageName objects associated with this ActivationKey
 Server getServer()
           
 java.util.Set<ServerGroup> getServerGroups()
          Get the Set of ServerGroup objects associated with this ActivationKey
 Token getToken()
           
 java.lang.Long getUsageLimit()
           
 boolean isDisabled()
           
 boolean isUniversalDefault()
          Returns true if this token is the org default.
static java.lang.String makePrefix(Org org)
          Makes the Activation key prefix that will get added to the base key
 void removeChannel(Channel channelIn)
          Remove a Channel from this ActivationKey
 void removeEntitlement(ServerGroupType entitlementIn)
           
 void removePackageName(PackageName packageNameIn)
          Remove a PackageName from this ActivationKey
 void removeServerGroup(ServerGroup serverGroupIn)
          Remove a ServerGroup from this ActivationKey
 void setBaseChannel(Channel chan)
          sets the base channel..
 void setCreator(User user)
           
 void setDeployConfigs(boolean b)
           
 void setDisabled(java.lang.Long disabled)
           
 void setEntitlements(java.util.Set entitlementsIn)
           
 void setId(java.lang.Long id)
           
 void setKey(java.lang.String keyIn)
           
 void setKickstartSession(KickstartSession kickstartSessionIn)
           
 void setNote(java.lang.String note)
           
 void setOrg(Org org)
           
 void setServer(Server server)
           
protected  void setToken(Token tokenIn)
           
 void setUniversalDefault(boolean def)
          Sets the universal default.
 void setUsageLimit(java.lang.Long limit)
           
 java.lang.String toString()
          
 
Methods inherited from class com.redhat.rhn.domain.BaseDomainHelper
getCreated, getModified, setCreated, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActivationKey

public ActivationKey()
Method Detail

getKey

public java.lang.String getKey()
Returns:
Returns the key.

setKey

public void setKey(java.lang.String keyIn)
Parameters:
keyIn - The key to set.

getKickstartSession

public KickstartSession getKickstartSession()
Returns:
Returns the kickstartSession.

setKickstartSession

public void setKickstartSession(KickstartSession kickstartSessionIn)
Parameters:
kickstartSessionIn - The kickstartSession to set.

getToken

public Token getToken()
Returns:
Returns the token.

setToken

protected void setToken(Token tokenIn)
Parameters:
tokenIn - The token to set.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

setId

public void setId(java.lang.Long id)
Parameters:
id - The id to set

getId

public java.lang.Long getId()
Returns:
Returns the token's id

setCreator

public void setCreator(User user)
Parameters:
user - The user to set

getCreator

public User getCreator()
Returns:
Returns the tokens user

setOrg

public void setOrg(Org org)
Parameters:
org - The org to set

getOrg

public Org getOrg()
Returns:
Returns the org

setServer

public void setServer(Server server)
Parameters:
server - The server to set

getServer

public Server getServer()
Returns:
Returns the server

setNote

public void setNote(java.lang.String note)
Parameters:
note - The note to set

getNote

public java.lang.String getNote()
Returns:
Returns the tokens note

setDeployConfigs

public void setDeployConfigs(boolean b)
Parameters:
b - Deploy configs

getDeployConfigs

public boolean getDeployConfigs()
Returns:
Returns deploy configs

setDisabled

public void setDisabled(java.lang.Long disabled)
Parameters:
disabled - The disabled to set

isDisabled

public boolean isDisabled()
Returns:
Is this token disabled?

setUsageLimit

public void setUsageLimit(java.lang.Long limit)
Parameters:
limit - The usage limit to set

getUsageLimit

public java.lang.Long getUsageLimit()
Returns:
The usage limit for this token

setEntitlements

public void setEntitlements(java.util.Set entitlementsIn)
Parameters:
entitlementsIn - The entitlements to set

getEntitlements

public java.util.Set<ServerGroupType> getEntitlements()
Returns:
Returns the set of entitlements for this activation key

addEntitlement

public void addEntitlement(ServerGroupType entitlementIn)
Parameters:
entitlementIn - The entitlement to add to the tokens entitlements set.

removeEntitlement

public void removeEntitlement(ServerGroupType entitlementIn)
Parameters:
entitlementIn - The entitlement to remove from the tokens entitlements set.

addChannel

public void addChannel(Channel channelIn)
Add a Channel to this ActivationKey

Parameters:
channelIn - to add

removeChannel

public void removeChannel(Channel channelIn)
Remove a Channel from this ActivationKey

Parameters:
channelIn - to remove

clearChannels

public void clearChannels()
Clear all channels associated with this token.


getChannels

public java.util.Set<Channel> getChannels()
Get the Set of Channels associated with this ActivationKey

Returns:
Set of Channel objects.

addServerGroup

public void addServerGroup(ManagedServerGroup serverGroupIn)
Add a ServerGroup to this ActivationKey

Parameters:
serverGroupIn - to add

removeServerGroup

public void removeServerGroup(ServerGroup serverGroupIn)
Remove a ServerGroup from this ActivationKey

Parameters:
serverGroupIn - to remove

getServerGroups

public java.util.Set<ServerGroup> getServerGroups()
Get the Set of ServerGroup objects associated with this ActivationKey

Returns:
Set of ServerGroup objects.

addPackageName

public void addPackageName(PackageName packageNameIn)
Add a PackageName to this ActivationKey

Parameters:
packageNameIn - Package name to add

removePackageName

public void removePackageName(PackageName packageNameIn)
Remove a PackageName from this ActivationKey

Parameters:
packageNameIn - Package name to remove

getPackageNames

public java.util.Set<PackageName> getPackageNames()
Get the Set of PackageName objects associated with this ActivationKey

Returns:
Set of PackageName objects.

clearPackageNames

public void clearPackageNames()
Clear all package names associated with this activation key.


clearConfigChannels

public void clearConfigChannels()
Clear all config channel associated with this activation key.


getConfigChannelsFor

public java.util.List getConfigChannelsFor(User user)
Returns the config channels associated to this activation key Throws a LookupException if the user does NOT have permissson to access/deal with these channels.

Parameters:
user - the user needed to ensure credentials
Returns:
the config channels associated to this activation key

setBaseChannel

public void setBaseChannel(Channel chan)
sets the base channel.. clears child channels if it has to

Parameters:
chan - the base channel associated to this activation key.

getBaseChannel

public Channel getBaseChannel()
Return the base channel or null if none exists

Returns:
the base channel.

setUniversalDefault

public void setUniversalDefault(boolean def)
Sets the universal default.

Parameters:
def - the universal default

isUniversalDefault

public boolean isUniversalDefault()
Returns true if this token is the org default.

Returns:
tru if its the org defaul false otherwise

makePrefix

public static java.lang.String makePrefix(Org org)
Makes the Activation key prefix that will get added to the base key

Parameters:
org - the org of the activation key
Returns:
the key prefix.