public class ErrataFactory extends HibernateFactory
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ERRATA_TYPE_BUG |
static java.lang.String |
ERRATA_TYPE_ENHANCEMENT |
static java.lang.String |
ERRATA_TYPE_SECURITY |
Modifier and Type | Method and Description |
---|---|
static ErrataOverview |
cloneErratum(java.lang.Long originalEid,
java.lang.String advisory,
java.lang.String advisoryName,
java.lang.Long orgId)
Clone an erratum in the db.
|
static Errata |
createClone(Org org,
Errata e) |
static Bug |
createPublishedBug(java.lang.Long id,
java.lang.String summary,
java.lang.String url)
Creates a new Published Bug object with the given id and summary.
|
static Errata |
createPublishedErrata()
Create a new PublishedErrata from scratch
|
static ErrataFile |
createPublishedErrataFile(ErrataFileType ft,
java.lang.String cs,
java.lang.String name)
Creates a new Published Errata file with given ErrataFileType, checksum, and name
|
static ErrataFile |
createPublishedErrataFile(ErrataFileType ft,
java.lang.String cs,
java.lang.String name,
java.util.Set packages)
Creates a new Published Errata file with given ErrataFileType, checksum, and name
|
static Bug |
createUnpublishedBug(java.lang.Long id,
java.lang.String summary,
java.lang.String url)
Creates a new Unpublished Bug object with the given id and summary.
|
static Errata |
createUnpublishedErrata()
Create a new UnpublishedErrata
|
static ErrataFile |
createUnpublishedErrataFile(ErrataFileType ft,
java.lang.String cs,
java.lang.String name,
java.util.Set packages)
Creates a new Unpublished Errata file with given ErrataFileType, checksum, and name
|
protected org.apache.log4j.Logger |
getLogger()
Get the Logger for the derived class so log messages
show up on the correct class
|
static ErrataOverview |
getOverviewByAdvisory(java.lang.String advisory)
Get ErrataOverview by advisory
|
static ErrataOverview |
getOverviewById(java.lang.Long eid)
Get ErrataOverview by errata id
|
static java.util.Set<java.lang.String> |
listAdvisoriesEndingWith(java.lang.String ending)
Get all advisory strings (published or unpublished) that end in the given string.
|
static java.util.Set<java.lang.String> |
listAdvisoryNamesEndingWith(java.lang.String ending)
Get all advisory names (published or unpublished) that end in the given string.
|
static java.util.List<Errata> |
listErrata(java.util.Collection<java.lang.Long> ids)
List errata objects by ID
|
static java.util.List<java.lang.Long> |
listErrataChannelPackages(java.lang.Long cid,
java.lang.Long eid)
List the package ids that were pushed to a channel because of an errata
|
static java.util.List |
listPublishedBrothersInChannels(Org org,
Channel channelFrom,
Channel channelTo)
Lists errata from channelFrom, that are cloned from the same original
as errata in channelTo
|
static java.util.List |
listPublishedClonesInChannels(Org org,
Channel channelFrom,
Channel channelTo)
Lists errata from channelFrom, that have clones in channelTo
|
static DataResult<OwnedErrata> |
listPublishedOwnedUnmodifiedClonedErrata(java.lang.Long orgId)
List all owned, published, unmodified, cloned errata in an org.
|
static java.util.List |
listSamePublishedInChannels(Org org,
Channel channelFrom,
Channel channelTo)
Lists errata present in both channels
|
static Errata |
lookupByAdvisory(java.lang.String advisory,
Org org)
Look up an errata by the advisory name.
|
static Errata |
lookupByAdvisoryId(java.lang.String advisoryId,
Org org)
Finds errata based on advisory id
|
static java.util.List<Errata> |
lookupByChannelBetweenDates(Org org,
Channel channel,
java.lang.String startDate,
java.lang.String endDate)
Lists errata assigned to a particular channel between
the given start and end date.
|
static java.util.List |
lookupByChannelSorted(Org org,
Channel channel)
Lists errata assigned to a particular channel,
sorted by date (from oldest to newest)
|
static java.util.List |
lookupByCVE(java.lang.String cve)
Finds errata based on CVE string
|
static Errata |
lookupById(java.lang.Long id)
Lookup a Errata by their id
|
static java.util.List |
lookupByIdentifier(java.lang.String identifier,
Org org)
Tries to locate errata based on either the errataum's id or the
CVE/CAN identifier string.
|
static java.util.List |
lookupByOriginal(Org org,
Errata original)
Lookup all the clones of a particular errata
|
static java.util.List<ErrataFile> |
lookupErrataFile(Errata errata,
Package pack)
Lookup an errataFile object by it's errata and package
|
static java.util.List |
lookupErrataFilesByErrataAndFileType(java.lang.Long errataId,
java.lang.String fileType)
Lookup ErrataFiles by errata and file type
|
static ErrataFileType |
lookupErrataFileType(java.lang.String label)
Lookup a ErrataFileType based on a label
|
static java.util.List |
lookupErratasByAdvisoryType(java.lang.String advisoryType)
Lookup a Errata by the advisoryType string
|
static java.util.List |
lookupPublishedByOriginal(Org org,
Errata original)
Lookup all the clones of a particular errata
|
static Errata |
lookupPublishedErrataById(java.lang.Long id)
Finds published errata by id
|
static Errata |
publish(Errata unpublished)
publish takes an unpublished errata and copies its contents into a Published Errata
object (and then returns this object).
|
static Errata |
publishToChannel(Errata errata,
Channel chan,
User user,
java.util.Set<Package> packages)
Publish an errata to a channel but only push a small set of packages
along with it
|
static java.util.List<Errata> |
publishToChannel(java.util.List<Errata> errataList,
Channel chan,
User user,
boolean inheritPackages)
Takes a published or unpublished errata and publishes to a channel, creating
all of the correct ErrataFile* entries.
|
static java.util.List<Errata> |
publishToChannel(java.util.List<Errata> errataList,
Channel chan,
User user,
boolean inheritPackages,
boolean performPostActions)
Takes a published or unpublished errata and publishes to a channel, creating
all of the correct ErrataFile* entries.
|
static DataResult<ErrataOverview> |
relevantToOneChannelButNotAnother(java.lang.Long fromCid,
java.lang.Long toCid)
Get list of errata ids that are in one channel but not another
|
static void |
remove(Keyword deleteme)
Delete a Keyword
|
static void |
removeBug(Bug deleteme)
Delete a bug
|
static void |
removeFile(ErrataFile deleteme)
Remove a file.
|
static void |
save(Errata errataIn)
Insert or Update a Errata.
|
static java.util.List<ErrataOverview> |
search(java.util.List eids,
Org org)
Returns a list of ErrataOverview that match the given errata ids.
|
static java.util.List<ErrataOverview> |
searchByPackageIds(java.util.List pids)
Returns a list of ErrataOverview of Errata that match the given Package
ids.
|
static java.util.List<ErrataOverview> |
searchByPackageIdsWithOrg(java.util.List pids,
Org org)
Returns a list of ErrataOverview of Errata that match the given Package
ids.
|
static void |
syncErrataDetails(PublishedClonedErrata cloned)
Sync all the errata details from one errata to another
|
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 ERRATA_TYPE_BUG
public static final java.lang.String ERRATA_TYPE_ENHANCEMENT
public static final java.lang.String ERRATA_TYPE_SECURITY
protected org.apache.log4j.Logger getLogger()
getLogger
in class HibernateFactory
public static java.util.List<java.lang.Long> listErrataChannelPackages(java.lang.Long cid, java.lang.Long eid)
cid
- the channel ideid
- the errata idpublic static java.util.List lookupByIdentifier(java.lang.String identifier, Org org)
identifier
- erratum id or CVE/CAN id stringorg
- User organizationpublic static Errata publish(Errata unpublished)
unpublished
- The Errata to publishpublic static java.util.List<Errata> publishToChannel(java.util.List<Errata> errataList, Channel chan, User user, boolean inheritPackages)
errataList
- list of errata to publishchan
- channel to publish it into.user
- the user doing the pushinginheritPackages
- include only original channel packagespublic static java.util.List<Errata> publishToChannel(java.util.List<Errata> errataList, Channel chan, User user, boolean inheritPackages, boolean performPostActions)
errataList
- list of errata to publishchan
- channel to publish it into.user
- the user doing the pushinginheritPackages
- include only original channel packagesperformPostActions
- true (default) if you want to refresh newest package
cache and schedule repomd regeneration. False only if you're going to do those
things yourself.public static Errata publishToChannel(Errata errata, Channel chan, User user, java.util.Set<Package> packages)
errata
- errata to publishchan
- channel to publish it into.user
- the user doing the pushingpackages
- the packages to pushpublic static Errata createClone(Org org, Errata e)
org
- Org performing the cloninge
- Errata to be clonedpublic static Errata createPublishedErrata()
public static Errata createUnpublishedErrata()
public static Bug createUnpublishedBug(java.lang.Long id, java.lang.String summary, java.lang.String url)
id
- The id for the new bugsummary
- The summary for the new bugurl
- The bug URLpublic static Bug createPublishedBug(java.lang.Long id, java.lang.String summary, java.lang.String url)
id
- The id for the new bugsummary
- The summary for the new bugurl
- The bug URLpublic static ErrataFile createUnpublishedErrataFile(ErrataFileType ft, java.lang.String cs, java.lang.String name, java.util.Set packages)
ft
- ErrataFileType for the new ErrataFilecs
- MD5 Checksum for the new Errata Filename
- name for the filepackages
- Packages associated with this errata file.public static ErrataFile createPublishedErrataFile(ErrataFileType ft, java.lang.String cs, java.lang.String name)
ft
- ErrataFileType for the new ErrataFilecs
- MD5 Checksum for the new Errata Filename
- name for the filepublic static ErrataFile createPublishedErrataFile(ErrataFileType ft, java.lang.String cs, java.lang.String name, java.util.Set packages)
ft
- ErrataFileType for the new ErrataFilecs
- MD5 Checksum for the new Errata Filename
- name for the filepackages
- Packages associated with this errata file.public static ErrataFileType lookupErrataFileType(java.lang.String label)
label
- file type label (RPM, IMG, etc)public static java.util.List lookupErrataFilesByErrataAndFileType(java.lang.Long errataId, java.lang.String fileType)
errataId
- errata idfileType
- file type labelpublic static Errata lookupById(java.lang.Long id)
id
- the id to search forpublic static java.util.List lookupErratasByAdvisoryType(java.lang.String advisoryType)
advisoryType
- to search forpublic static Errata lookupPublishedErrataById(java.lang.Long id)
id
- errata idpublic static Errata lookupByAdvisory(java.lang.String advisory, Org org)
advisory
- The advisory to lookuporg
- User organizationpublic static Errata lookupByAdvisoryId(java.lang.String advisoryId, Org org)
advisoryId
- errata advisory idorg
- User organizationpublic static java.util.List lookupByCVE(java.lang.String cve)
cve
- cve textpublic static java.util.List lookupByOriginal(Org org, Errata original)
org
- Org that the clones belongs tooriginal
- Original errata that the clones are clones ofpublic static java.util.List lookupPublishedByOriginal(Org org, Errata original)
org
- Org that the clones belongs tooriginal
- Original errata that the clones are clones ofpublic static java.util.List listSamePublishedInChannels(Org org, Channel channelFrom, Channel channelTo)
org
- orgaznizationchannelFrom
- channel1channelTo
- channel2public static java.util.List listPublishedBrothersInChannels(Org org, Channel channelFrom, Channel channelTo)
org
- orgaznizationchannelFrom
- channel1channelTo
- channel2public static java.util.List listPublishedClonesInChannels(Org org, Channel channelFrom, Channel channelTo)
org
- orgaznizationchannelFrom
- channel1channelTo
- channel2public static void save(Errata errataIn)
errataIn
- Errata to be stored in database.public static void removeBug(Bug deleteme)
deleteme
- Bug to deletepublic static void remove(Keyword deleteme)
deleteme
- Keyword to deletepublic static void removeFile(ErrataFile deleteme)
deleteme
- ErrataFile to deletepublic static java.util.List lookupByChannelSorted(Org org, Channel channel)
org
- the Org in questionchannel
- the channel you want to get the errata forpublic static java.util.List<Errata> lookupByChannelBetweenDates(Org org, Channel channel, java.lang.String startDate, java.lang.String endDate)
org
- the Org in questionchannel
- the channel you want to get the errata forstartDate
- the start dateendDate
- the end datepublic static java.util.List<ErrataFile> lookupErrataFile(Errata errata, Package pack)
errata
- the errata associatedpack
- the package associatedpublic static java.util.List<ErrataOverview> search(java.util.List eids, Org org)
eids
- Errata ids.org
- Organization to match results withpublic static java.util.List<ErrataOverview> searchByPackageIds(java.util.List pids)
pids
- Package ids whose Errata are being sought.public static java.util.List<ErrataOverview> searchByPackageIdsWithOrg(java.util.List pids, Org org)
pids
- Package ids whose Errata are being sought.org
- Organization to match results withpublic static void syncErrataDetails(PublishedClonedErrata cloned)
cloned
- the cloned errata that needs syncingpublic static java.util.List<Errata> listErrata(java.util.Collection<java.lang.Long> ids)
ids
- list of idspublic static DataResult<ErrataOverview> relevantToOneChannelButNotAnother(java.lang.Long fromCid, java.lang.Long toCid)
fromCid
- errata are in this channeltoCid
- but not in this onepublic static DataResult<OwnedErrata> listPublishedOwnedUnmodifiedClonedErrata(java.lang.Long orgId)
orgId
- Org id to look forpublic static java.util.Set<java.lang.String> listAdvisoriesEndingWith(java.lang.String ending)
ending
- String ending of the advisorypublic static java.util.Set<java.lang.String> listAdvisoryNamesEndingWith(java.lang.String ending)
ending
- String ending of the advisorypublic static ErrataOverview getOverviewById(java.lang.Long eid)
eid
- errata idpublic static ErrataOverview getOverviewByAdvisory(java.lang.String advisory)
advisory
- the advisorypublic static ErrataOverview cloneErratum(java.lang.Long originalEid, java.lang.String advisory, java.lang.String advisoryName, java.lang.Long orgId)
originalEid
- erratum id to clone fromadvisory
- unique advisoryadvisoryName
- unique nameorgId
- org id to clone into