edu.nrao.sss.model.project
Interface ProjectProvider


public interface ProjectProvider

A provider of projects.

CVS Info:

$Revision: 840 $
$Date: 2007-08-21 11:16:41 -0600 (Tue, 21 Aug 2007) $
$Author: dharland $

Since:
2006-08-03
Author:
David M. Harland

Method Summary
 Project findByCode(String code)
          Returns the Project with the given code, if any.
 Project findById(long id)
          Returns the Project with the given id, if any.
 List<Project> findByUserId(long uid)
          Return a List of Projects that are owned (a.k.a.
 List<Project> findProjects(EventSetStatus status)
          Returns the a list of projects held by this provider that have the given status.
 List<Project> findProjects(Long userId, EventSetStatus status)
          Returns the a list of projects held by this provider that have the given status and are owned by the user with the given ID.
 List<Project> findProjects(Long userId, String proposalCode)
          This method returns a List of Projects owned by userId that have a proposal code of proposalCode.
 List<Project> findTestProjects(Long userId)
          Returns the a list of test projects owned by the user with the given ID.
 List<Project> getAllProjects()
          Returns a list of all projects held by this provider.
 

Method Detail

findById

Project findById(long id)
                 throws RepositoryException
Returns the Project with the given id, if any.

If this provider holds no Project with an ID of id, null is returned.

Parameters:
id - The identifier (primary key) for a Project in this repository.
Returns:
The Project with the given id, or null, if this provider holds no such Project.
Throws:
RepositoryException - if anything goes wrong while trying to fetch projects from this provider.

findByCode

Project findByCode(String code)
                   throws RepositoryException
Returns the Project with the given code, if any.

Parameters:
code - the Project code to be searched for.
Throws:
RepositoryException - if anything goes wrong while trying to fetch projects from this provider.

findByUserId

List<Project> findByUserId(long uid)
                           throws RepositoryException
Return a List of Projects that are owned (a.k.a. editable) by the User uid

Throws:
RepositoryException

findProjects

List<Project> findProjects(Long userId,
                           String proposalCode)
                           throws RepositoryException
This method returns a List of Projects owned by userId that have a proposal code of proposalCode.

Parameters:
userId - user id of the user that owns this project.
proposalCode - the proposalCode to be searched for.
Returns:
A list of projects. The list may be empty, but should not be null!
Throws:
RepositoryException

findTestProjects

List<Project> findTestProjects(Long userId)
                               throws RepositoryException
Returns the a list of test projects owned by the user with the given ID.

If this provider holds no test projects for the given owner, an empty list is returned.

Parameters:
userId - ID of the user who owns projects.
Returns:
a list of test projects owned by the user with the given ID, or an empty list if this provider has no such projects.
Throws:
RepositoryException - if anything goes wrong while trying to fetch projects from this provider.

findProjects

List<Project> findProjects(Long userId,
                           EventSetStatus status)
                           throws RepositoryException
Returns the a list of projects held by this provider that have the given status and are owned by the user with the given ID.

If this provider holds no projects with the given status and owner, an empty list is returned.

Parameters:
userId - ID of the user who owns projects.
status - the execution status of a project.
Returns:
a list of projects whose execution status equals status, or an empty list if this provider has no such projects.
Throws:
RepositoryException - if anything goes wrong while trying to fetch projects from this provider.

findProjects

List<Project> findProjects(EventSetStatus status)
                           throws RepositoryException
Returns the a list of projects held by this provider that have the given status.

If this provider holds no projects with the given status, an empty list is returned.

Parameters:
status - the execution status of a project.
Returns:
a list of projects whose execution status equals status, or an empty list if this provider has no such projects.
Throws:
RepositoryException - if anything goes wrong while trying to fetch projects from this provider.

getAllProjects

List<Project> getAllProjects()
                             throws RepositoryException
Returns a list of all projects held by this provider.

Returns:
a list of all projects held by this provider. If the provider has no projects the returned list will be empty.
Throws:
RepositoryException - if anything goes wrong while trying to fetch projects from this provider.


Copyright © 2009. All Rights Reserved.