com.redhat.rhn.domain.channel
Class Channel

java.lang.Object
  extended by com.redhat.rhn.domain.BaseDomainHelper
      extended by com.redhat.rhn.domain.channel.Channel
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
ClonedChannel, TestChannel

public class Channel
extends BaseDomainHelper
implements java.lang.Comparable

Channel


Constructor Summary
Channel()
           
 
Method Summary
 void addChannelFamily(ChannelFamily channelFamilyIn)
          Adds a single channelFamily to the channel
 void addErrata(Errata errataIn)
          Adds a single errata to the channel
 void addPackage(Package packageIn)
          Adds a single package to the channel
 int compareTo(java.lang.Object o)
          
 boolean equals(java.lang.Object other)
          
 java.util.List<Channel> getAccessibleChildrenFor(User user)
          Returns the child channels associated to a base channel
 java.lang.String getBaseDir()
           
 ChannelArch getChannelArch()
           
 java.util.Set getChannelFamilies()
           
 ChannelFamily getChannelFamily()
          Get the channel family for this channel.
 java.lang.String getDescription()
           
 java.util.Set<DistChannelMap> getDistChannelMaps()
           
 java.util.Date getEndOfLife()
           
 java.util.Set getErratas()
           
 java.lang.String getGPGKeyFp()
           
 java.lang.String getGPGKeyId()
           
 java.lang.String getGPGKeyUrl()
           
 java.lang.Long getId()
           
 java.lang.String getLabel()
           
 java.util.Date getLastModified()
           
 java.lang.String getName()
           
 Org getOrg()
           
 int getPackageCount()
           
 java.util.Set getPackages()
           
 Channel getParentChannel()
           
 ChannelProduct getProduct()
           
 ProductName getProductName()
           
 java.lang.String getSummary()
           
 int hashCode()
          
 boolean isBaseChannel()
          Returns true if this channel is considered a base channel.
 boolean isCloned()
          Returns true if this channel is a cloned channel.
 boolean isGloballySubscribable()
           
 boolean isProxy()
          Returns true if this Channel is a Proxy channel.
 boolean isSatellite()
          Returns true if this Channel is a satellite channel.
 boolean isSubscribable(Org orgIn, Server server)
          Check if this channel is subscribable by the Org passed in.
 void removePackage(Package packageIn)
          Removes a single package from the channel
 void setBaseDir(java.lang.String b)
           
 void setChannelArch(ChannelArch c)
           
 void setChannelFamilies(java.util.Set channelFamiliesIn)
          Sets the channelFamilies set for this channel
 void setChannelFamily(ChannelFamily channelFamilyIn)
          Set the channel family for this channel.
 void setDescription(java.lang.String d)
           
 void setDistChannelMaps(java.util.Set distChannelMapsIn)
           
 void setEndOfLife(java.util.Date e)
           
 void setErratas(java.util.Set erratasIn)
          Sets the erratas set for this channel
 void setGloballySubscribable(boolean value)
          Sets the globally subscribable attribute for this channel
 void setGPGKeyFp(java.lang.String k)
           
 void setGPGKeyId(java.lang.String k)
           
 void setGPGKeyUrl(java.lang.String k)
           
 void setId(java.lang.Long i)
           
 void setLabel(java.lang.String l)
           
 void setLastModified(java.util.Date l)
           
 void setName(java.lang.String n)
           
 void setOrg(Org o)
           
 void setPackages(java.util.Set packagesIn)
          Sets the packages set for this channel
 void setParentChannel(Channel p)
           
 void setProduct(ChannelProduct productIn)
           
 void setProductName(ProductName productNameIn)
           
 void setSummary(java.lang.String s)
           
 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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Channel

public Channel()
Method Detail

isGloballySubscribable

public boolean isGloballySubscribable()
Returns:
Returns whether or not this channel is globally subscribable.

setGloballySubscribable

public void setGloballySubscribable(boolean value)
Sets the globally subscribable attribute for this channel

Parameters:
value - True if you want the channel to be globally subscribable, false if not.

isSatellite

public boolean isSatellite()
Returns true if this Channel is a satellite channel.

Returns:
true if this Channel is a satellite channel.

isProxy

public boolean isProxy()
Returns true if this Channel is a Proxy channel.

Returns:
true if this Channel is a Proxy channel.

getBaseDir

public java.lang.String getBaseDir()
Returns:
Returns the baseDir.

setBaseDir

public void setBaseDir(java.lang.String b)
Parameters:
b - The baseDir to set.

getChannelArch

public ChannelArch getChannelArch()
Returns:
Returns the channelArch.

setChannelArch

public void setChannelArch(ChannelArch c)
Parameters:
c - The channelArch to set.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String d)
Parameters:
d - The description to set.

getEndOfLife

public java.util.Date getEndOfLife()
Returns:
Returns the endOfLife.

setEndOfLife

public void setEndOfLife(java.util.Date e)
Parameters:
e - The endOfLife to set.

getGPGKeyFp

public java.lang.String getGPGKeyFp()
Returns:
Returns the gPGKeyFp.

setGPGKeyFp

public void setGPGKeyFp(java.lang.String k)
Parameters:
k - The gPGKeyFP to set.

getGPGKeyId

public java.lang.String getGPGKeyId()
Returns:
Returns the gPGKeyId.

setGPGKeyId

public void setGPGKeyId(java.lang.String k)
Parameters:
k - The gPGKeyId to set.

getGPGKeyUrl

public java.lang.String getGPGKeyUrl()
Returns:
Returns the gPGKeyUrl.

setGPGKeyUrl

public void setGPGKeyUrl(java.lang.String k)
Parameters:
k - The gPGKeyUrl to set.

getId

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

setId

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

getLabel

public java.lang.String getLabel()
Returns:
Returns the label.

setLabel

public void setLabel(java.lang.String l)
Parameters:
l - The label to set.

getLastModified

public java.util.Date getLastModified()
Returns:
Returns the lastModified.

setLastModified

public void setLastModified(java.util.Date l)
Parameters:
l - The lastModified to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String n)
Parameters:
n - The name to set.

getOrg

public Org getOrg()
Returns:
Returns the org.

setOrg

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

getParentChannel

public Channel getParentChannel()
Returns:
Returns the parentChannel.

setParentChannel

public void setParentChannel(Channel p)
Parameters:
p - The parentChannel to set.

getSummary

public java.lang.String getSummary()
Returns:
Returns the summary.

setSummary

public void setSummary(java.lang.String s)
Parameters:
s - The summary to set.

getErratas

public java.util.Set getErratas()
Returns:
Returns the set of erratas for this channel.

setErratas

public void setErratas(java.util.Set erratasIn)
Sets the erratas set for this channel

Parameters:
erratasIn - The set of erratas

addErrata

public void addErrata(Errata errataIn)
Adds a single errata to the channel

Parameters:
errataIn - The errata to add

getPackages

public java.util.Set getPackages()
Returns:
Returns the set of packages for this channel.

getPackageCount

public int getPackageCount()
Returns:
Returns the size of the package set for this channel.

setPackages

public void setPackages(java.util.Set packagesIn)
Sets the packages set for this channel

Parameters:
packagesIn - The set of erratas

addPackage

public void addPackage(Package packageIn)
Adds a single package to the channel

Parameters:
packageIn - The package to add

removePackage

public void removePackage(Package packageIn)
Removes a single package from the channel

Parameters:
packageIn - The package to remove

getChannelFamilies

public java.util.Set getChannelFamilies()
Returns:
Returns the set of channelFamiliess for this channel.

setChannelFamilies

public void setChannelFamilies(java.util.Set channelFamiliesIn)
Sets the channelFamilies set for this channel

Parameters:
channelFamiliesIn - The set of channelFamilies

addChannelFamily

public void addChannelFamily(ChannelFamily channelFamilyIn)
Adds a single channelFamily to the channel

Parameters:
channelFamilyIn - The channelFamily to add

setChannelFamily

public void setChannelFamily(ChannelFamily channelFamilyIn)
Set the channel family for this channel.

Parameters:
channelFamilyIn - The channelFamily to add

getChannelFamily

public ChannelFamily getChannelFamily()
Get the channel family for this channel.

Returns:
the channel's family, or null if none found

isBaseChannel

public boolean isBaseChannel()
Returns true if this channel is considered a base channel.

Returns:
true if this channel is considered a base channel.

isCloned

public boolean isCloned()
Returns true if this channel is a cloned channel.

Returns:
whether the channel is cloned or not

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getProduct

public ChannelProduct getProduct()
Returns:
Returns the product.

setProduct

public void setProduct(ChannelProduct productIn)
Parameters:
productIn - The product to set.

getDistChannelMaps

public java.util.Set<DistChannelMap> getDistChannelMaps()
Returns:
Returns the distChannelMaps.

setDistChannelMaps

public void setDistChannelMaps(java.util.Set distChannelMapsIn)
Parameters:
distChannelMapsIn - The distChannelMaps to set.

isSubscribable

public boolean isSubscribable(Org orgIn,
                              Server server)
Check if this channel is subscribable by the Org passed in. Checks: 1) If channel is a Proxy or Spacewalk channel == false 2) If channel has 0 (or less) available subscriptions == false.

Parameters:
orgIn - to check available subs
server - to check if subscribable
Returns:
boolean if subscribable or not

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getProductName

public ProductName getProductName()
Returns:
the productName

setProductName

public void setProductName(ProductName productNameIn)
Parameters:
productNameIn - the productName to set

getAccessibleChildrenFor

public java.util.List<Channel> getAccessibleChildrenFor(User user)
Returns the child channels associated to a base channel

Parameters:
user - the User needed for accessibility issues
Returns:
a list of child channels or empty list if there are none.

compareTo

public int compareTo(java.lang.Object o)

Specified by:
compareTo in interface java.lang.Comparable