public interface ProjectSupplier
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.
Modifier and Type | Method and Description |
---|---|
Project |
getById(int id)
|
Project |
getByKey(String key)
|
Project |
getByKey(String namespace,
String key)
Deprecated.
in 7.18 for removal in 8.0. Use
getByKey(String) instead. |
Project |
getByName(String name)
|
Project |
getByName(String namespace,
String name)
Deprecated.
in 7.18 for removal without replacement in 8.0
|
@Nullable Project getById(int id)
id
- the ID
of the project to retrievenull
if no such project existsAuthorisationException
- if the current user does not have permission to
access the requested project@Nullable Project getByKey(@Nonnull String key)
key
- the key
of the project to retrievenull
if the key does not match an existing projectAuthorisationException
- if the current user does not have permission to
access the requested projectProjectMovedException
- when the project key has been updated and the provided key
parameter is
the old value@Deprecated @Nullable Project getByKey(@Nullable String namespace, @Nonnull String key)
getByKey(String)
instead.namespace
- the namespace
of the project to retrievekey
- the key
of the project to retrievenull
if the key does not match an existing projectAuthorisationException
- if the current user does not have permission to
access the requested projectProjectMovedException
- when the project key and/or namespace has been updated and the provided
parameters identify the project by it's old value(s).@Nullable Project getByName(@Nonnull String name)
name
- the name
of the project to retrievenull
if the name does not match an existing projectAuthorisationException
- if the current user does not have permission to
access the requested project@Deprecated @Nullable Project getByName(@Nullable String namespace, @Nonnull String name)
namespace
- the namespace
of the project to retrievename
- the name
of the project to retrievenull
if the key does not match an existing projectAuthorisationException
- if the current user does not have permission to
access the requested projectCopyright © 2022 Atlassian. All rights reserved.