public class PackageFactory extends HibernateFactory
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARCH_TYPE_RPM |
static java.lang.String |
ARCH_TYPE_TAR |
static PackageKeyType |
PACKAGE_KEY_TYPE_GPG |
Modifier and Type | Method and Description |
---|---|
static void |
deletePackage(Package pack)
Deletes a particular package object from hibernate.
|
static void |
deletePackageKey(PackageKey key)
Deletes a package key
|
static void |
deletePackageSource(PackageSource src)
Deletes a particular package source object
|
static java.util.List<Package> |
findPackagesWithDifferentArch(Package pack)
Find other packages with the same NVRE but with different arches
|
static java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getErrataChannelIntersection(java.lang.Long cid,
java.lang.Long eid,
boolean published)
Returns package names that are shared between an erratum and a channel,
with string representations of the versions in each.
|
protected org.apache.log4j.Logger |
getLogger()
Get the Logger for the derived class so log messages show up on the
correct class
|
static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getPackageCapabilityMap()
Provides a mapping of arch type labels to sets of capabilities (ported from the if
statement mess in package_type_capable of Package.pm).
|
static DataResult |
getPackagesChannelArchCompatAndOrgAccess(java.lang.Long orgId,
java.lang.Long channelId,
java.util.List<java.lang.Long> packageIds)
Returns information, whether each package in the list is channel compatible
and whether the org has accesds to
|
static boolean |
isPackageInChannel(java.lang.Long cid,
java.lang.Long nameId,
java.lang.Long evrId)
Returns true if the Package with the given name and evr ids exists in the
Channel whose id is cid.
|
static java.util.List<PackageKey> |
listPackageKeys()
List all package keys
|
static java.util.List<PackageProvider> |
listPackageProviders()
list package providers
|
static java.util.List |
listPackagesByPackageName(PackageName pn)
List the Package objects by their Package Name
|
static Package |
lookupByIdAndOrg(java.lang.Long id,
Org org)
Lookup a Package by the id, in the context of a given org.
|
static Package |
lookupByIdAndUser(java.lang.Long id,
User user)
Lookup a Package by the id, in the context of a given user.
|
static InstalledPackage |
lookupByNameAndServer(java.lang.String name,
Server server)
Returns an InstalledPackage object, given a server and package name to
lookup the latest version of the package.
|
static java.util.List<Package> |
lookupByNevra(Org org,
java.lang.String name,
java.lang.String version,
java.lang.String release,
java.lang.String epoch,
PackageArch arch)
Find a package based off of the NEVRA
|
static PackageKeyType |
lookupKeyTypeByLabel(java.lang.String label)
Lookup a package key type by label
|
static PackageName |
lookupOrCreatePackageByName(java.lang.String pn)
lookup a PackageName object based on it's name, If one does not exist,
create a new one and return it.
|
static java.util.List |
lookupOrphanPackages(Org org)
lookup orphaned packages, i.e.
|
static PackageArch |
lookupPackageArchById(java.lang.Long id)
Lookup a PackageArch by its id.
|
static PackageArch |
lookupPackageArchByLabel(java.lang.String label)
Lookup a PackageArch by its label.
|
static PackageKey |
lookupPackageKey(java.lang.String key)
Lookup a package key object
|
static PackageName |
lookupPackageName(java.lang.Long id)
lookup a PackageName object based on it's id, returns null if it does
not exist
|
static PackageName |
lookupPackageName(java.lang.String pn)
lookup a PackageName object based on it's name, returns null if it does
not exist
|
static PackageProvider |
lookupPackageProvider(java.lang.String name)
Looup a package provider by name
|
static PackageSource |
lookupPackageSourceByIdAndOrg(java.lang.Long psid,
Org org)
Lookup package source by it's ID
|
static java.util.List<PackageSource> |
lookupPackageSources(Package pack)
Lookup package sources for a particular package
|
static java.util.List<PackageOverview> |
packageSearch(java.util.List<java.lang.Long> pids,
java.util.List<java.lang.String> archLabels,
java.lang.Long relevantUserId,
java.lang.Long filterChannelId,
java.lang.String searchType)
Returns PackageOverviews from a search.
|
static void |
save(PackageDelta delta)
Store the package delta.
|
static void |
save(PackageProvider prov)
Store the package provider.
|
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 PackageKeyType PACKAGE_KEY_TYPE_GPG
public static final java.lang.String ARCH_TYPE_RPM
public static final java.lang.String ARCH_TYPE_TAR
protected org.apache.log4j.Logger getLogger()
getLogger
in class HibernateFactory
public static boolean isPackageInChannel(java.lang.Long cid, java.lang.Long nameId, java.lang.Long evrId)
cid
- Channel id to look innameId
- Package name idevrId
- Package evr idpublic static Package lookupByIdAndUser(java.lang.Long id, User user)
id
- of the Package to search foruser
- the user doing the searchpublic static Package lookupByIdAndOrg(java.lang.Long id, Org org)
id
- of the Package to search fororg
- the org which much have access to the packagepublic static void save(PackageProvider prov)
prov
- The object we are commiting.public static void save(PackageDelta delta)
delta
- The object we are commiting.public static PackageArch lookupPackageArchById(java.lang.Long id)
id
- package arch label id sought.public static PackageArch lookupPackageArchByLabel(java.lang.String label)
label
- package arch label sought.public static java.util.List listPackagesByPackageName(PackageName pn)
pn
- to query bypublic static PackageName lookupOrCreatePackageByName(java.lang.String pn)
pn
- the package namepublic static PackageName lookupPackageName(java.lang.Long id)
id
- the package name idpublic static PackageName lookupPackageName(java.lang.String pn)
pn
- the package namepublic static java.util.List lookupOrphanPackages(Org org)
org
- the org to check forpublic static java.util.List<Package> lookupByNevra(Org org, java.lang.String name, java.lang.String version, java.lang.String release, java.lang.String epoch, PackageArch arch)
org
- the org that owns the packagename
- the name to search forversion
- the version to search forrelease
- the release to search forepoch
- if epoch is null, the best match for epoch will be used.arch
- the arch to search forpublic static InstalledPackage lookupByNameAndServer(java.lang.String name, Server server)
name
- name of the package to lookup onserver
- server where the give package was installed.public static java.util.List<PackageOverview> packageSearch(java.util.List<java.lang.Long> pids, java.util.List<java.lang.String> archLabels, java.lang.Long relevantUserId, java.lang.Long filterChannelId, java.lang.String searchType)
pids
- List of package ids returned from search server.archLabels
- List of channel arch labels.relevantUserId
- user id to filter by if relevant or architecture search
server the user can see is subscribed tofilterChannelId
- channel id to filter by if channel searchsearchType
- type of search to do, one of "relevant", "channel",
"architecture", or "all"public static PackageKeyType lookupKeyTypeByLabel(java.lang.String label)
label
- the label of the typepublic static void deletePackage(Package pack)
pack
- the package to deletepublic static void deletePackageSource(PackageSource src)
src
- the package source objectpublic static java.util.List<PackageSource> lookupPackageSources(Package pack)
pack
- the package associated with the package sourcespublic static PackageSource lookupPackageSourceByIdAndOrg(java.lang.Long psid, Org org)
psid
- id of the source packageorg
- the org with access to the source packagepublic static java.util.List<Package> findPackagesWithDifferentArch(Package pack)
pack
- the packagepublic static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getPackageCapabilityMap()
public static java.util.List<PackageProvider> listPackageProviders()
public static PackageProvider lookupPackageProvider(java.lang.String name)
name
- the namepublic static void deletePackageKey(PackageKey key)
key
- the key to deletepublic static PackageKey lookupPackageKey(java.lang.String key)
key
- the key to lookuppublic static java.util.List<PackageKey> listPackageKeys()
public static DataResult getPackagesChannelArchCompatAndOrgAccess(java.lang.Long orgId, java.lang.Long channelId, java.util.List<java.lang.Long> packageIds)
orgId
- organization idchannelId
- channel idpackageIds
- list of package idspublic static java.util.List<java.util.Map<java.lang.String,java.lang.String>> getErrataChannelIntersection(java.lang.Long cid, java.lang.Long eid, boolean published)
cid
- channel ideid
- errata idpublished
- whether the erratum is published or not