Package com.atlassian.bitbucket.project
Interface ProjectSupplier
- All Known Subinterfaces:
ProjectService
public interface ProjectSupplier
Allows retrieving
projects by their ID or key.
This is a simplification of the ProjectService, intended to be used in cases where a component needs to
be able to look up projects but doesn't need the full service functionality. Using this interface instead makes
such components easier to test.
Plugin developers: Plugins cannot autowire their components when importing both ProjectSupplier and
ProjectService. In general, if a plugin needs ProjectService methods, it should only
use the ProjectService. This interface should be used when a plugin only needs to retrieve projects.
-
Method Summary
-
Method Details
-
getById
- Parameters:
id- theIDof the project to retrieve- Returns:
- the project instance or
nullif no such project exists - Throws:
AuthorisationException- if the current user does not have permission to access the requested project
-
getByKey
- Parameters:
key- thekeyof the project to retrieve- Returns:
- the keyed project, or
nullif the key does not match an existing project - Throws:
AuthorisationException- if the current user does not have permission to access the requested projectProjectMovedException- when the project key has been updated and the providedkeyparameter is the old value
-
getByName
- Parameters:
name- thenameof the project to retrieve- Returns:
- the named project, or
nullif the name does not match an existing project - Throws:
AuthorisationException- if the current user does not have permission to access the requested project
-