org.shredzone.repowatch.repository
Interface PackageDAO

All Superinterfaces:
BaseDAO<Package>
All Known Implementing Classes:
PackageDAOHibImpl

@Secured(value="IS_AUTHENTICATED_ANONYMOUSLY")
public interface PackageDAO
extends BaseDAO<Package>

Gives access to the package management.

Version:
$Revision: 317 $

Method Summary
 long countAllPackages()
          Counts all packages known.
 long countPackages(Repository repo)
          Counts all packages that belong to the given Repository.
 long countSearchResult(SearchDTO data)
          Counts the number of returned packages matching the given search.
 void deleteAllPackagesForDomain(Domain domain)
          Deletes all packages refering to the given domain.
 List<Package> findAllPackages(Domain domain, int start, int limit)
          Finds all packages for a Domain, within certain limits.
 SortedMap<String,String> findAllPackages(int start, int limit)
          Finds all packages for a Domain, within certain limits.
 List<Package> findAllPackagesForDomain(Domain domain)
          Finds all packages for a Domain.
 Package findLatestPackage(String name)
          Finds the latest version of a package with the given name.
 Package findPackage(Domain domain, String name)
          Finds a package with the given name, in the given Domain.
 List<Package> findSearchResult(SearchDTO data, int start, int limit)
          Returns the packages matching the given search.
 
Methods inherited from interface org.shredzone.repowatch.repository.BaseDAO
delete, fetch, insert, merge
 

Method Detail

countPackages

long countPackages(Repository repo)
Counts all packages that belong to the given Repository.

Parameters:
repo - A Repository
Returns:
Number of packages belonging to the repository.

countAllPackages

long countAllPackages()
Counts all packages known.

Returns:
Number of all packages.

findPackage

Package findPackage(Domain domain,
                    String name)
Finds a package with the given name, in the given Domain.

Parameters:
domain - Domain to find the package in.
name - Name of the package.
Returns:
Package matching the name, or null if there is none.

findLatestPackage

Package findLatestPackage(String name)
Finds the latest version of a package with the given name.

Parameters:
name - Name of the package
Returns:
Latest Package matching the name, or null if there is no package with that name at all.

findAllPackagesForDomain

List<Package> findAllPackagesForDomain(Domain domain)
Finds all packages for a Domain.

Parameters:
domain - A Domain
Returns:
A list of all Packages belonging to that Domain.

findAllPackages

List<Package> findAllPackages(Domain domain,
                              int start,
                              int limit)
Finds all packages for a Domain, within certain limits.

Parameters:
domain - A Domain
start - The first entity to start with
limit - The maximum number of returned entities
Returns:
A list of all Packages belonging to that Domain.

findAllPackages

SortedMap<String,String> findAllPackages(int start,
                                         int limit)
Finds all packages for a Domain, within certain limits. Returns the package name along with a package description.

Parameters:
start - The first entity to start with
limit - The maximum number of returned entities
Returns:
A sorted map of all Package names belonging to that Domain. The map's value contains a description of the package.

countSearchResult

long countSearchResult(SearchDTO data)
Counts the number of returned packages matching the given search.

Parameters:
data - SearchDTO with the search parameters
Returns:
Number of packages that were found.

findSearchResult

List<Package> findSearchResult(SearchDTO data,
                               int start,
                               int limit)
Returns the packages matching the given search.

Parameters:
data - SearchDTO with the search parameters
start - The first entity to start with
limit - The maximum number of returned entities
Returns:
A list of all Packages matching the search.

deleteAllPackagesForDomain

@Secured(value="ROLE_ADMIN")
void deleteAllPackagesForDomain(Domain domain)
Deletes all packages refering to the given domain.

Parameters:
domain - Domain to delete all packages of.


Copyright © 2007-2011 shredzone.org. All Rights Reserved.