public class ChannelManager extends BaseManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
QRY_ROLE_MANAGE |
static java.lang.String |
QRY_ROLE_SUBSCRIBE |
static java.lang.String |
RHEL_PRODUCT_NAME |
static java.util.Set<java.lang.String> |
RHEL4_EUS_VERSIONS |
static java.lang.String |
RHEL7_EUS_VERSION |
static java.lang.String |
RHN_VIRT_HOST_PACKAGE_NAME
Package name of rhn-virtualization-host
|
static java.lang.String |
TOOLS_CHANNEL_PACKAGE_NAME
Key used to identify the rhn-tools channel.
|
static java.lang.String |
VIRT_CHANNEL_PACKAGE_NAME
Key used to identify the rhel-arch-server-vt-5 channel.
|
static java.lang.String |
VT_OS_PRODUCT
OS name for the virt child channel.
|
Modifier and Type | Method and Description |
---|---|
static void |
addManageRole(User user,
Channel channel)
Adds the mange role for the passed in user for the passed in channel.
|
static void |
addPackages(Channel chan,
java.util.List<java.lang.Long> packageIds,
User user)
Adds packages to a channel
|
static void |
addSubscribeRole(User user,
Channel channel)
Adds the subscribe role for the passed in user for the passed in channel.
|
static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
allChannelsTree(User user)
Returns the list of all channels the user can see.
|
static DataResult<ChannelTreeNode> |
allChannelTree(User user,
ListControl lc)
Returns a list of ChannelTreeNodes containing all channels
the user can see
|
static DataResult<SystemsPerChannelDto> |
baseChannelsInSet(User user)
Returns the list of all base-channels represented in the System Set.
|
static DataResult<ChannelTreeNode> |
channelFamilyTree(User user,
java.lang.Long familyId,
ListControl lc)
Returns a list of channels and their parents who are in a particular
channel family/entitlement
|
static DataResult |
channelsForContentSource(java.lang.Long csid,
PageControl pc) |
static java.util.List<java.lang.String> |
channelsForUser(User user)
channelsForUser returns a list containing the names of the channels
that this user has permissions to.
|
static DataResult<ChannelOverview> |
channelsOwnedByOrg(java.lang.Long orgId,
PageControl pc)
Returns a dataresult containing the channels in an org.
|
static DataResult<ChildChannelDto> |
childrenAvailableToSet(User user)
Returns the list of all child-channels in the user's System Set
|
static int |
cloneChannelPackages(java.lang.Long fromCid,
java.lang.Long toCid)
Clone all channel packages from one channel to another
|
static int |
cloneOriginalChannelPackages(java.lang.Long fromCid,
java.lang.Long toCid)
Clone the original channel packages from one channel to another
|
static java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
compatibleChildChannelArches(java.lang.String parentArchLabel) |
static void |
deleteChannel(User user,
java.lang.String label)
Deletes a software channel
|
static java.util.Map<java.lang.Long,ChannelActionDAO> |
filterChildSubscriptions(java.lang.String setLabel,
java.util.List<Channel> subChans,
java.util.List<Channel> unsubChans,
User user)
Takes a list of child channels and a set label and returns a Map
with system ids as the key and a set ChannelActionDAO's
as the value
|
static java.util.List<Channel> |
findAllBaseChannelsForOrg(User u)
List base channels (including Red Hat channels) for a given org.
|
static java.util.List<java.lang.Long> |
findChildChannelsWithPackage(Org org,
java.lang.Long parent,
java.lang.String packageName,
boolean expectOne)
Finds the id of a child channel with the given parent channel id that contains
a package with the given name.
|
static java.util.List<java.lang.Long> |
findChildChannelsWithPackage(java.lang.String packageName,
Org org)
Finds the ids of all child channels that contain
a package with the given name.
|
static java.lang.Long |
findChildChannelWithPackage(Org org,
java.lang.Long parent,
java.lang.String packageName)
Finds the id of a child channel with the given parent channel id that contains
a package with the given name.
|
static java.util.Map<Channel,Channel> |
findCompatibleChildren(Channel oldBaseChannel,
Channel newBaseChannel,
User user)
Given an old and a new base channel, return a map of old child channels to new
child channels with the same product name.
|
static DataResult<ErrataOverview> |
findCustomErrataForTarget(Channel targetChannel,
boolean packageAssoc)
find available errata from custom base channels and their child channels for a
particular channel
|
static DataResult<ErrataOverview> |
findErrataForTarget(Channel targetChannel,
boolean packageAssoc)
Finds non-custom errata for a target channel
|
static DataResult<ErrataOverview> |
findErrataFromRhnSetForTarget(Channel targetChannel,
boolean packageAssoc,
User user)
Finds errata associated with channels in the "channels_for_errata" rhnSet that
apply to a custom channel
|
static java.util.List<ChannelArch> |
getChannelArchitectures()
Returns list of ChannelArches
|
static java.util.List<Channel> |
getChannelsAccessibleByOrg(java.lang.Long orgid)
Get the list of Channels accessible by an org
|
static DataResult<ChannelTreeNode> |
getChannelsForSsm(User user,
ListControl lc)
Returns all channels that are applicable to the systems currently selected in
the SSM.
|
static java.util.List<ClonedChannel> |
getChannelsWithClonableErrata(Org org)
Get the list of Channels with clonable Errata
|
static java.util.Set<ChannelVersion> |
getChannelVersions(Channel channel)
Examines each DistChannelMap associated with the given channel to build the
master set of all supported channel version constants.
|
static java.lang.Long |
getLatestPackageEqual(java.lang.Long channelId,
java.lang.String packageName)
Get the id of latest packages equal in the passed in Channel and name
|
static java.lang.Long |
getLatestPackageEqualInTree(java.lang.Long channelId,
java.lang.String packageName)
Get the id of latest packages located in the channel tree where channelId
is a parent
|
static java.util.List<java.lang.String> |
getLatestSyncLogFiles(Channel c)
get the latest log file for spacewalk-repo-sync
|
static Channel |
getOriginalChannel(Channel channel)
|
static Channel |
getProxyChannelByVersion(java.lang.String version,
Server server)
Returns list of proxy channel names for a given version
|
static java.lang.String |
getRepoLastBuild(Channel channel)
get the last build date on repodata per channel
|
static java.util.List<java.lang.String> |
getSyncdChannelArches()
Returns a distinct list of ChannelArch labels for all synch'd and custom
channels in the satellite.
|
static Channel |
getToolsChannel(Channel baseChannel,
User user)
Search for the tools channel beneath the specified base channel.
|
static java.lang.Long |
guessServerBase(User usr,
java.lang.Long sid)
For the specified server, make a best-guess effort at what its base-channel
SHOULD be
|
static Channel |
guessServerBase(User usr,
Server s)
For the specified server, make a best-guess effort at what its base-channel
SHOULD be
|
static boolean |
isChannelLabelInProgress(java.lang.String channel)
Check the status of the cache repo data
|
static boolean |
isGloballySubscribable(User user,
java.lang.String chanLabel)
Returns true if the given channel is globally subscribable for the
given org.
|
static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
latestPackagesInChannel(Channel channel)
Returns list of latest packages in channel
|
static DataResult<PackageListItem> |
latestPackagesInChannel(java.lang.Long channelId)
Returns the latest packages in the channel.
|
static java.lang.Long |
likelyParentId(Channel original,
Org org)
Return the channel id of the "most likely" parent if we're cloning this
channel.
|
static java.util.List<PackageDto> |
listAllPackages(Channel channel)
Returns list of packages in channel
|
static java.util.List<PackageDto> |
listAllPackages(Channel channel,
java.util.Date startDate,
java.util.Date endDate)
Returns list of packages in channel
|
static java.util.List<PackageDto> |
listAllPackages(Channel channel,
java.lang.String startDate,
java.lang.String endDate)
Returns list of packages in channel
|
static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
listAllPackagesByDate(Channel channel,
java.lang.String startDate,
java.lang.String endDate)
Deprecated.
The only thing to use this is
ChannelSoftwareHandler.listAllPackagesByDate which is itself depricated
|
static java.util.List<EssentialChannelDto> |
listBaseChannelsForSystem(User usr,
Server s)
Given a system, find all the base channels available to the specified user
that the system may be re-subscribed to.
|
static java.util.List<EssentialChannelDto> |
listBaseEusChannelsByVersionReleaseAndChannelArch(User user,
ReleaseChannelMap rcm)
Lookup the EUS base channels suitable for the given version, release, and
channel arch.
|
static java.util.List<EssentialChannelDto> |
listBaseEusChannelsByVersionReleaseAndServerArch(User user,
java.lang.String version,
PackageEvr pevr,
java.lang.String serverArch)
Lookup the EUS base channels suitable for the given version, release, and
server arch.
|
static java.util.List<java.lang.Long> |
listChannelManagerIdsForChannel(Org org,
Channel channel)
returns channel manager ids within the given org for a given channel
|
static java.util.List<java.lang.Long> |
listChannelSubscriberIdsForChannel(Org org,
Channel channel)
returns channel subscriber ids within the given org for a given channel
|
static java.util.List<EssentialChannelDto> |
listCompatibleBaseChannelsForChannel(User u,
Channel inChan)
Given a base-channel, find all the base channels available to the specified user
that a system with the specified channel may be re-subscribed to.
|
static java.util.List<java.lang.String> |
listCompatiblePackageArches(java.lang.String[] channelArchLabels)
Returns a list of compatible packages arches for the given ChannelArch
labels.
|
static DataResult<EssentialChannelDto> |
listCustomBaseChannelsForServer(Server server)
List base channels offered for the given server
|
static DataResult<ErrataOverview> |
listErrata(Channel channel,
java.util.Date start,
java.util.Date end,
boolean lastModified,
User user)
List the errata applicable to a channel between start and end date
|
static DataResult<java.util.Map<java.lang.String,java.lang.Object>> |
listErrataByType(Channel channel,
java.lang.String type)
List the errata of a particular type that are applicable to a channel.
|
static DataResult<java.util.Map<java.lang.String,java.lang.Object>> |
listErrataForDates(Channel channel,
java.lang.String start,
java.lang.String end)
Deprecated.
Use appropriate listErrata
|
static java.util.List<ErrataOverview> |
listErrataNeedingResync(Channel c,
User user)
List errata that is within a channel that needs to be resynced
This is determined by the packages in the channel
|
static java.util.List<PackageDto> |
listErrataPackages(Channel chan,
Errata errata)
List packages that are contained in an errata and in a channel
|
static java.util.List<PackageOverview> |
listErrataPackagesForResync(Channel c,
User user)
List errata packages that need to be resynced
|
static java.util.List<PackageOverview> |
listErrataPackagesForResync(Channel c,
User user,
java.lang.String setLabel)
List errata packages that need to be resynced
|
static DataResult<ErrataOverview> |
listErrataSimple(java.lang.Long channelId)
List the errata applicable to a channel (used for repomd generation)
|
static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
listLatestPackagesEqual(java.lang.Long channelId,
java.lang.String packageName)
List the latest packages equal in the passed in Channel and name
|
static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
listLatestPackagesLike(java.lang.Long channelId,
java.lang.String packageName)
List the latest packages in a channel *like* the given package name.
|
static Channel |
lookupByIdAndUser(java.lang.Long cid,
User userIn)
Returns a Channel object with the given id and user
|
static Channel |
lookupByLabel(Org org,
java.lang.String label)
Returns the Channel whose label matches the given label.
|
static Channel |
lookupByLabelAndUser(java.lang.String label,
User userIn)
Returns a Channel object with the given label and user
|
static ReleaseChannelMap |
lookupDefaultReleaseChannelMapForChannel(Channel channel)
Lookup the default release channel map for the given channel.
|
static DistChannelMap |
lookupDistChannelMapByPnReleaseArch(Org org,
java.lang.String productName,
java.lang.String release,
ChannelArch channelArch)
Lookup the dist channel map for the given os, release, and channel arch.
|
static EssentialChannelDto |
lookupLatestEusChannelForRhelVersion(User user,
java.lang.String rhelVersion,
java.lang.Long channelArchId)
Lookup the latest EUS base channel for the given version and server arch.
|
static java.lang.Long |
lookupOriginalId(Channel channel)
Returns an id of the original channel
|
static DataResult<ChannelTreeNode> |
myChannelTree(User user,
ListControl lc)
Returns a list of ChannelTreeNodes that have orgId null
or has a parent with org_id null
|
static java.lang.String |
normalizeRhelReleaseForMapping(java.lang.String rhelVersion,
java.lang.String originalRelease)
Convert redhat-release release values to those that are stored in the
rhnReleaseChannelMap table.
|
static DataResult<ChannelTreeNode> |
ownedChannelsTree(User user)
Returns a list of channels owned by the user.
|
static DataResult<ChannelTreeNode> |
popularChannelTree(User user,
java.lang.Long serverCount,
ListControl lc)
Returns a list of ChannelTreeNodes that have orgId null
or has a prarent with org_id null
|
static void |
queueChannelChange(java.lang.String channelLabel,
java.lang.String client,
java.lang.String reason) |
static void |
refreshWithNewestPackages(Channel channel,
java.lang.String label)
Refreshes the channel with the "newest" packages.
|
static void |
refreshWithNewestPackages(java.lang.Long channelId,
java.lang.String label)
Refreshes the channel with the "newest" packages.
|
static DataResult<java.lang.Long> |
relevantPackages(java.lang.Long channelId,
Errata e)
Returns the package ids for packages relevant to a channel for a published errata
|
static void |
removeErrata(Channel chan,
java.util.Set<java.lang.Long> errataIds,
User user)
Remove a set of erratas from a channel
and remove associated packages
|
static void |
removeManageRole(User user,
Channel channel)
Removes the manage role from the passed in user for the passed in channel.
|
static void |
removePackages(Channel chan,
java.util.List<java.lang.Long> packageIds,
User user)
Remove packages from a channel very quickly
|
static void |
removeSubscribeRole(User user,
Channel channel)
Removes the subscribe role from the passed in user for the passed in channel.
|
static DataResult<ChannelTreeNode> |
retiredChannelTree(User user,
ListControl lc)
Returns a list of ChannelTreeNodes containing end-of-life
retired channels the user can see
|
static DataResult<ChannelTreeNode> |
sharedChannelTree(User user,
ListControl lc)
Returns a list of ChannelTreeNodes containing shared channels
the user can see
|
static java.util.Set<java.lang.Long> |
subscribableChannelIdsForUser(User user)
returns a list of channel ids that the user can subscribe to
|
static Channel |
subscribeToChildChannelByOSProduct(User user,
Server current,
java.lang.String osProductName)
Subscribe a Server to the first child channel of its base channel supplies OS level
functionality based on the "osProductName" passed in.
|
static Channel |
subscribeToChildChannelWithPackageName(User user,
Server current,
java.lang.String packageName)
Subscribe a Server to the first child channel of its base channel that contains
the packagename passed in.
|
static DataResult<ChannelTreeNode> |
trustChannelConsume(Org org,
Org trustOrg,
User user,
ListControl lc)
Returns a list of ChannelTreeNodes containing all channels
the trusted org is consuming from a specific org
|
static void |
unscheduleEventualRepoSync(Channel channel,
User user)
Unschedule eventual repo sync schedule
|
static java.util.List<Channel> |
userAccessibleChildChannels(java.lang.Long orgid,
java.lang.Long cid)
Returns the list of Channel ids which the given orgid has access to.
|
static DataResult<ChannelTreeNode> |
vendorChannelTree(User user,
ListControl lc)
Returns a list of ChannelTreeNodes that have orgId null
or has a parent with org_id null
|
static boolean |
verifyChannelAdmin(User user,
java.lang.Long cid)
Verify that a user is a channel admin
|
static boolean |
verifyChannelManage(User user,
java.lang.Long cid)
Makes sure the passed in user has manage permissions to the channel with the
given id.
|
static boolean |
verifyChannelSubscribe(User user,
java.lang.Long cid)
Makes sure the passed in user has subscribe permissions to the channel with the
given id.
|
makeDataResult, makeDataResult, makeDataResult, makeDataResult, makeDataResultNoPagination, makeDataResultNoPagination, processListControl, processPageControl
public static final java.lang.String QRY_ROLE_MANAGE
public static final java.lang.String QRY_ROLE_SUBSCRIBE
public static final java.util.Set<java.lang.String> RHEL4_EUS_VERSIONS
public static final java.lang.String RHEL7_EUS_VERSION
public static final java.lang.String RHEL_PRODUCT_NAME
public static final java.lang.String TOOLS_CHANNEL_PACKAGE_NAME
public static final java.lang.String VIRT_CHANNEL_PACKAGE_NAME
public static final java.lang.String RHN_VIRT_HOST_PACKAGE_NAME
public static final java.lang.String VT_OS_PRODUCT
public static void refreshWithNewestPackages(Channel channel, java.lang.String label)
channel
- channel to be refreshedlabel
- the labelpublic static void refreshWithNewestPackages(java.lang.Long channelId, java.lang.String label)
channelId
- identifies the channel to be refreshedlabel
- the labelpublic static DataResult<ChannelTreeNode> vendorChannelTree(User user, ListControl lc)
user
- who we are requesting channels forlc
- ListControl to usepublic static DataResult<ChannelTreeNode> popularChannelTree(User user, java.lang.Long serverCount, ListControl lc)
user
- who we are requesting Red Hat channels forserverCount
- the number of systems registered to that channel for it to
be popularlc
- ListControl to usepublic static DataResult<ChannelTreeNode> myChannelTree(User user, ListControl lc)
user
- who we are requesting Red Hat channels forlc
- ListControl to usepublic static DataResult<ChannelTreeNode> trustChannelConsume(Org org, Org trustOrg, User user, ListControl lc)
org
- Org that is sharing the channelstrustOrg
- org that is consuming the shared channelsuser
- User of the sharing Orglc
- ListControl to usepublic static DataResult<ChannelTreeNode> allChannelTree(User user, ListControl lc)
user
- who we are requesting channels forlc
- ListControl to usepublic static DataResult<ChannelTreeNode> ownedChannelsTree(User user)
user
- cannot be null
public static DataResult<ChannelTreeNode> sharedChannelTree(User user, ListControl lc)
user
- who we are requesting channels forlc
- ListControl to usepublic static DataResult<ChannelTreeNode> retiredChannelTree(User user, ListControl lc)
user
- who we are requesting channels forlc
- ListControl to usepublic static DataResult<ChannelTreeNode> channelFamilyTree(User user, java.lang.Long familyId, ListControl lc)
user
- who we are requesting channels forfamilyId
- Id of the family we want a tree forlc
- ListControl to usepublic static DataResult<ChannelOverview> channelsOwnedByOrg(java.lang.Long orgId, PageControl pc)
orgId
- The org in questionpc
- page control for the userpublic static DataResult<java.lang.Long> relevantPackages(java.lang.Long channelId, Errata e)
channelId
- The id for the channel in questione
- the errata in questionpublic static Channel lookupByIdAndUser(java.lang.Long cid, User userIn)
cid
- The id for the channel you wantuserIn
- The User looking for the channelpublic static Channel lookupByLabelAndUser(java.lang.String label, User userIn)
label
- The label for the channel you wantuserIn
- The User looking for the channelpublic static java.util.Set<java.lang.Long> subscribableChannelIdsForUser(User user)
user
- User to checkpublic static java.util.List<java.lang.String> channelsForUser(User user)
user
- The user in questionpublic static java.util.List<Channel> userAccessibleChildChannels(java.lang.Long orgid, java.lang.Long cid)
orgid
- Org idcid
- Base Channel id.public static java.util.List<ClonedChannel> getChannelsWithClonableErrata(Org org)
org
- org we want to search againstpublic static java.util.List<Channel> getChannelsAccessibleByOrg(java.lang.Long orgid)
orgid
- The id of the orgpublic static Channel getProxyChannelByVersion(java.lang.String version, Server server)
version
- proxy versionserver
- Serverpublic static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> allChannelsTree(User user)
user
- User whose channels are sought.public static java.util.List<ChannelArch> getChannelArchitectures()
ChannelArch
public static void deleteChannel(User user, java.lang.String label) throws InvalidChannelRoleException, NoSuchChannelException
user
- User with access to delete the channel.label
- Channel labelInvalidChannelRoleException
- thrown if User does not have access
to delete channel.NoSuchChannelException
- thrown if no channel exists with the
given labelpublic static void unscheduleEventualRepoSync(Channel channel, User user)
channel
- relevant channeluser
- executivepublic static boolean verifyChannelAdmin(User user, java.lang.Long cid) throws InvalidChannelRoleException
user
- the user to verifycid
- the channel id to verifyInvalidChannelRoleException
- if the user does not have permspublic static void addSubscribeRole(User user, Channel channel)
user
- The user in question.channel
- The channel in question.public static void removeSubscribeRole(User user, Channel channel)
user
- The user in question.channel
- The channel in question.public static void addManageRole(User user, Channel channel)
user
- The user in question.channel
- The channel in question.public static void removeManageRole(User user, Channel channel)
user
- The user in question.channel
- The channel in question.public static boolean verifyChannelSubscribe(User user, java.lang.Long cid)
user
- The user in questioncid
- The id for the channel in questionpublic static boolean verifyChannelManage(User user, java.lang.Long cid)
user
- The user in questioncid
- The id for the channel in questionpublic static boolean isGloballySubscribable(User user, java.lang.String chanLabel)
user
- UserchanLabel
- label of Channel to validatepublic static Channel lookupByLabel(Org org, java.lang.String label)
org
- The org of the user looking up the channellabel
- Channel label sought.public static DataResult<PackageListItem> latestPackagesInChannel(java.lang.Long channelId)
latestPackagesInChannel(com.redhat.rhn.domain.channel.Channel)
.channelId
- identifies the channelpublic static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> latestPackagesInChannel(Channel channel)
channel
- channel whose packages are soughtpublic static DataResult<ErrataOverview> listErrata(Channel channel, java.util.Date start, java.util.Date end, boolean lastModified, User user)
channel
- channel whose errata are soughtstart
- start dateend
- end dateuser
- the user doing the listlastModified
- use query selecting by last_modified timestamp or notpublic static DataResult<ErrataOverview> listErrataSimple(java.lang.Long channelId)
channelId
- channel whose errata are sought@Deprecated public static DataResult<java.util.Map<java.lang.String,java.lang.Object>> listErrataForDates(Channel channel, java.lang.String start, java.lang.String end)
channel
- channel whose errata are soughtstart
- start dateend
- end datepublic static DataResult<java.util.Map<java.lang.String,java.lang.Object>> listErrataByType(Channel channel, java.lang.String type)
channel
- channel whose errata are soughttype
- type of erratapublic static java.util.List<PackageDto> listAllPackages(Channel channel, java.lang.String startDate, java.lang.String endDate)
channel
- channel whose packages are soughtstartDate
- package start dateendDate
- package end datepublic static java.util.List<PackageDto> listAllPackages(Channel channel)
channel
- channel whose packages are soughtpublic static java.util.List<PackageDto> listAllPackages(Channel channel, java.util.Date startDate, java.util.Date endDate)
channel
- channel whose packages are soughtstartDate
- package start dateendDate
- package end date@Deprecated public static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> listAllPackagesByDate(Channel channel, java.lang.String startDate, java.lang.String endDate)
channel
- channel whose packages are soughtstartDate
- package start dateendDate
- package end datepublic static java.lang.Long getLatestPackageEqual(java.lang.Long channelId, java.lang.String packageName)
channelId
- to lookup package againstpackageName
- to checkpublic static java.lang.Long getLatestPackageEqualInTree(java.lang.Long channelId, java.lang.String packageName)
channelId
- to lookup package againstpackageName
- to checkpublic static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> listLatestPackagesEqual(java.lang.Long channelId, java.lang.String packageName)
channelId
- to lookup package againstpackageName
- to checkpublic static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> listLatestPackagesLike(java.lang.Long channelId, java.lang.String packageName)
channelId
- to lookup package againstpackageName
- to checkpublic static java.lang.Long findChildChannelWithPackage(Org org, java.lang.Long parent, java.lang.String packageName)
org
- Organization of the current user.parent
- The id of the parent channelpackageName
- The exact name of the package sought for.public static java.util.List<java.lang.Long> findChildChannelsWithPackage(Org org, java.lang.Long parent, java.lang.String packageName, boolean expectOne)
org
- Organization of the current user.parent
- The id of the parent channelpackageName
- The exact name of the package sought for.expectOne
- if true, throws exception, if more child channels are returnedpublic static java.util.List<java.lang.Long> findChildChannelsWithPackage(java.lang.String packageName, Org org)
packageName
- The exact name of the package sought for.org
- the org this is inpublic static Channel subscribeToChildChannelWithPackageName(User user, Server current, java.lang.String packageName)
user
- requesting the subscriptioncurrent
- System to be subbedpackageName
- to use to lookup the channel with.public static Channel subscribeToChildChannelByOSProduct(User user, Server current, java.lang.String osProductName)
user
- requesting the subscriptioncurrent
- System to be subbedosProductName
- to use to lookup the channel with.public static Channel guessServerBase(User usr, Server s)
usr
- User asking the questions
- Server of interestpublic static java.lang.Long guessServerBase(User usr, java.lang.Long sid)
usr
- User asking the questionsid
- Server id of interestpublic static java.lang.String normalizeRhelReleaseForMapping(java.lang.String rhelVersion, java.lang.String originalRelease)
rhelVersion
- RHEL version we're comparing release for. (5Server, 4AS, 4ES)originalRelease
- Original package release.public static Channel getToolsChannel(Channel baseChannel, User user)
baseChannel
- Base channel to search for a tools channel beneath.user
- User performing the search.public static java.util.Set<ChannelVersion> getChannelVersions(Channel channel)
channel
- Channel to return the versions for.public static DataResult<ChannelTreeNode> getChannelsForSsm(User user, ListControl lc)
user
- logged in userlc
- controller for the UI listpublic static DataResult<ChildChannelDto> childrenAvailableToSet(User user)
user
- User whose channels are sought.public static DataResult<SystemsPerChannelDto> baseChannelsInSet(User user)
user
- User whose System Set is being consideredpublic static java.util.List<EssentialChannelDto> listBaseChannelsForSystem(User usr, Server s)
usr
- requesting lists
- Server to check againstpublic static java.util.List<EssentialChannelDto> listCompatibleBaseChannelsForChannel(User u, Channel inChan)
u
- User of interestinChan
- Base-channel of interestpublic static ReleaseChannelMap lookupDefaultReleaseChannelMapForChannel(Channel channel)
channel
- Channel to lookup mapping forpublic static DistChannelMap lookupDistChannelMapByPnReleaseArch(Org org, java.lang.String productName, java.lang.String release, ChannelArch channelArch)
org
- organizationproductName
- Product name.release
- Version.channelArch
- Channel arch.public static java.util.List<EssentialChannelDto> listBaseEusChannelsByVersionReleaseAndServerArch(User user, java.lang.String version, PackageEvr pevr, java.lang.String serverArch)
user
- User performing the query.version
- RHEL version.pevr
- Package EVR of the package whose release we're checking.serverArch
- RHEL server arch.public static java.util.List<EssentialChannelDto> listBaseEusChannelsByVersionReleaseAndChannelArch(User user, ReleaseChannelMap rcm)
user
- User performing the query.rcm
- ReleaseChannelMap entry for this Channelpublic static EssentialChannelDto lookupLatestEusChannelForRhelVersion(User user, java.lang.String rhelVersion, java.lang.Long channelArchId)
user
- User performing the query.rhelVersion
- RHEL version.channelArchId
- Channel arch id.public static DataResult<EssentialChannelDto> listCustomBaseChannelsForServer(Server server)
server
- serverpublic static java.util.List<Channel> findAllBaseChannelsForOrg(User u)
u
- User to list base channels for.public static java.util.Map<Channel,Channel> findCompatibleChildren(Channel oldBaseChannel, Channel newBaseChannel, User user)
oldBaseChannel
- the base channel to which we need to find the equivalent
child channelsnewBaseChannel
- the base channel which holds the a child channel with
same product nameuser
- user needed for authentication purposespublic static Channel getOriginalChannel(Channel channel)
channel
- channelpublic static DataResult<ErrataOverview> findErrataForTarget(Channel targetChannel, boolean packageAssoc)
targetChannel
- the channel to search forpackageAssoc
- whether to filter packages on what packages are already
in the channelpublic static DataResult<ErrataOverview> findErrataFromRhnSetForTarget(Channel targetChannel, boolean packageAssoc, User user)
targetChannel
- the channel to search foruser
- the user doing the querypackageAssoc
- whether to filter packages on what packages are already
in the channelpublic static DataResult<ErrataOverview> findCustomErrataForTarget(Channel targetChannel, boolean packageAssoc)
targetChannel
- the channel to targetpackageAssoc
- whether to filter packages on what packages are already
in the channelpublic static java.util.List<java.lang.String> listCompatiblePackageArches(java.lang.String[] channelArchLabels)
channelArchLabels
- List of ChannelArch labels.public static java.util.List<java.lang.String> getSyncdChannelArches()
public static void queueChannelChange(java.lang.String channelLabel, java.lang.String client, java.lang.String reason)
channelLabel
- channel labelclient
- client inforeason
- reason for queuepublic static void removePackages(Channel chan, java.util.List<java.lang.Long> packageIds, User user)
chan
- the channelpackageIds
- list of package idsuser
- the user doing the removingpublic static void addPackages(Channel chan, java.util.List<java.lang.Long> packageIds, User user)
chan
- the channelpackageIds
- list of package idsuser
- the user adding packagespublic static void removeErrata(Channel chan, java.util.Set<java.lang.Long> errataIds, User user)
chan
- The channel to remove fromerrataIds
- set of errata ids to removeuser
- the user doing the removingpublic static java.util.List<PackageDto> listErrataPackages(Channel chan, Errata errata)
chan
- The channelerrata
- the Erratapublic static java.lang.Long lookupOriginalId(Channel channel)
channel
- The cloned channelpublic static java.util.List<ErrataOverview> listErrataNeedingResync(Channel c, User user)
c
- the channeluser
- the userpublic static java.util.List<PackageOverview> listErrataPackagesForResync(Channel c, User user)
c
- the channel to look for packages inuser
- the user doing itpublic static java.util.List<PackageOverview> listErrataPackagesForResync(Channel c, User user, java.lang.String setLabel)
c
- the channel to look for packages inuser
- the user doing itsetLabel
- the set of errata to base the package off ofpublic static boolean isChannelLabelInProgress(java.lang.String channel)
channel
- the channel to look for statuspublic static java.lang.String getRepoLastBuild(Channel channel)
channel
- the channel to look for repodata build datepublic static java.util.List<java.lang.String> getLatestSyncLogFiles(Channel c)
c
- channelpublic static java.util.Map<java.lang.Long,ChannelActionDAO> filterChildSubscriptions(java.lang.String setLabel, java.util.List<Channel> subChans, java.util.List<Channel> unsubChans, User user)
setLabel
- the set label of System idssubChans
- the list of channels to subscribeunsubChans
- the list of channels to unsubscribeuser
- the user doing the workpublic static java.util.List<java.lang.Long> listChannelManagerIdsForChannel(Org org, Channel channel)
org
- given organizationchannel
- channelpublic static java.util.List<java.lang.Long> listChannelSubscriberIdsForChannel(Org org, Channel channel)
org
- given organizationchannel
- channelpublic static DataResult channelsForContentSource(java.lang.Long csid, PageControl pc)
csid
- content source (repository) IDpc
- pageControlpublic static java.util.List<java.util.Map<java.lang.String,java.lang.String>> compatibleChildChannelArches(java.lang.String parentArchLabel)
parentArchLabel
- The channel arch label of the parent channelpublic static int cloneOriginalChannelPackages(java.lang.Long fromCid, java.lang.Long toCid)
fromCid
- The original channel's idtoCid
- The cloned channel's idpublic static int cloneChannelPackages(java.lang.Long fromCid, java.lang.Long toCid)
fromCid
- The original channel's idtoCid
- The cloned channel's idpublic static java.lang.Long likelyParentId(Channel original, Org org)
original
- Original channel that we are cloningorg
- Org to look for clones in