Class ListProjectsImpl
java.lang.Object
com.google.gerrit.server.restapi.project.AbstractListProjects
com.google.gerrit.server.restapi.project.ListProjectsImpl
- All Implemented Interfaces:
RestReadView<TopLevelResource>
,RestView<TopLevelResource>
,ListProjects
List projects visible to the calling user.
Implement GET /projects/
, without a query=
parameter.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.gerrit.server.restapi.project.ListProjects
ListProjects.FilterType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ListProjectsImpl
(CurrentUser currentUser, ProjectCache projectCache, GroupResolver groupResolver, GroupControl.Factory groupControlFactory, GitRepositoryManager repoManager, PermissionBackend permissionBackend, ProjectNode.Factory projectNodeFactory, WebLinks webLinks, com.google.inject.Provider<QueryProjects> queryProjectsProvider, org.eclipse.jgit.lib.Config config, com.google.gerrit.index.project.ProjectIndexCollection projectIndexes) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addShowBranch
(String branch) apply()
apply
(TopLevelResource resource) Process the view operation by reading from the resource.display
(PrintWriter stdout) void
displayToStream
(OutputStream displayOutputStream) com.google.gerrit.json.OutputFormat
boolean
boolean
void
setAll
(boolean all) void
void
setFormat
(com.google.gerrit.json.OutputFormat fmt) void
setGroupUuid
(AccountGroup.UUID groupUuid) void
setLimit
(int limit) void
setMatchPrefix
(String matchPrefix) void
setMatchRegex
(String matchRegex) void
setMatchSubstring
(String matchSubstring) void
setShowDescription
(boolean showDescription) void
setShowTree
(boolean showTree) void
setStart
(int start) void
setState
(ProjectState state)
-
Constructor Details
-
ListProjectsImpl
@Inject protected ListProjectsImpl(CurrentUser currentUser, ProjectCache projectCache, GroupResolver groupResolver, GroupControl.Factory groupControlFactory, GitRepositoryManager repoManager, PermissionBackend permissionBackend, ProjectNode.Factory projectNodeFactory, WebLinks webLinks, com.google.inject.Provider<QueryProjects> queryProjectsProvider, org.eclipse.jgit.lib.Config config, com.google.gerrit.index.project.ProjectIndexCollection projectIndexes)
-
-
Method Details
-
setFormat
public void setFormat(com.google.gerrit.json.OutputFormat fmt) - Specified by:
setFormat
in interfaceListProjects
- Specified by:
setFormat
in classAbstractListProjects
-
addShowBranch
- Specified by:
addShowBranch
in interfaceListProjects
- Specified by:
addShowBranch
in classAbstractListProjects
-
setShowTree
public void setShowTree(boolean showTree) - Specified by:
setShowTree
in interfaceListProjects
- Specified by:
setShowTree
in classAbstractListProjects
-
setFilterType
- Specified by:
setFilterType
in interfaceListProjects
- Specified by:
setFilterType
in classAbstractListProjects
-
setShowDescription
public void setShowDescription(boolean showDescription) - Specified by:
setShowDescription
in interfaceListProjects
- Specified by:
setShowDescription
in classAbstractListProjects
-
setAll
public void setAll(boolean all) - Specified by:
setAll
in interfaceListProjects
- Specified by:
setAll
in classAbstractListProjects
-
setState
- Specified by:
setState
in interfaceListProjects
- Specified by:
setState
in classAbstractListProjects
-
setLimit
public void setLimit(int limit) - Specified by:
setLimit
in interfaceListProjects
- Specified by:
setLimit
in classAbstractListProjects
-
setStart
public void setStart(int start) - Specified by:
setStart
in interfaceListProjects
- Specified by:
setStart
in classAbstractListProjects
-
setMatchPrefix
- Specified by:
setMatchPrefix
in interfaceListProjects
- Specified by:
setMatchPrefix
in classAbstractListProjects
-
setMatchSubstring
- Specified by:
setMatchSubstring
in interfaceListProjects
- Specified by:
setMatchSubstring
in classAbstractListProjects
-
setMatchRegex
- Specified by:
setMatchRegex
in interfaceListProjects
- Specified by:
setMatchRegex
in classAbstractListProjects
-
setGroupUuid
- Specified by:
setGroupUuid
in interfaceListProjects
- Specified by:
setGroupUuid
in classAbstractListProjects
-
getShowBranch
-
isShowTree
public boolean isShowTree() -
isShowDescription
public boolean isShowDescription() -
getFormat
public com.google.gerrit.json.OutputFormat getFormat() -
apply
public Response<Object> apply(TopLevelResource resource) throws BadRequestException, PermissionBackendException Description copied from interface:RestReadView
Process the view operation by reading from the resource.The value of the returned response is automatically converted to JSON unless it is a
BinaryResult
.The returned response defines the status code that is returned to the client. For RestReadViews this is usually
200 OK
, but other 2XX or 3XX status codes are also possible (e.g.Response.Redirect
can be returned for302 Found
).Throwing a subclass of
RestApiException
results in a 4XX response to the client. For any other exception the client will get a500 Internal Server Error
response.- Specified by:
apply
in interfaceListProjects
- Specified by:
apply
in interfaceRestReadView<TopLevelResource>
- Overrides:
apply
in classAbstractListProjects
- Parameters:
resource
- resource to read- Returns:
- response to return to the client
- Throws:
BadRequestException
- the request was incorrectly specified and cannot be handled by this view.PermissionBackendException
-
apply
-
displayToStream
public void displayToStream(OutputStream displayOutputStream) throws BadRequestException, PermissionBackendException -
display
@CanIgnoreReturnValue public SortedMap<String,ProjectInfo> display(PrintWriter stdout) throws BadRequestException, PermissionBackendException
-