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
ConstructorsModifierConstructorDescriptionprotectedListProjectsImpl(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 TypeMethodDescriptionvoidaddShowBranch(String branch) apply()apply(TopLevelResource resource) Process the view operation by reading from the resource.display(PrintWriter stdout) voiddisplayToStream(OutputStream displayOutputStream) com.google.gerrit.json.OutputFormatbooleanbooleanvoidsetAll(boolean all) voidvoidsetFormat(com.google.gerrit.json.OutputFormat fmt) voidsetGroupUuid(AccountGroup.UUID groupUuid) voidsetLimit(int limit) voidsetMatchPrefix(String matchPrefix) voidsetMatchRegex(String matchRegex) voidsetMatchSubstring(String matchSubstring) voidsetShowDescription(boolean showDescription) voidsetShowTree(boolean showTree) voidsetStart(int start) voidsetState(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:
setFormatin interfaceListProjects- Specified by:
setFormatin classAbstractListProjects
-
addShowBranch
- Specified by:
addShowBranchin interfaceListProjects- Specified by:
addShowBranchin classAbstractListProjects
-
setShowTree
public void setShowTree(boolean showTree) - Specified by:
setShowTreein interfaceListProjects- Specified by:
setShowTreein classAbstractListProjects
-
setFilterType
- Specified by:
setFilterTypein interfaceListProjects- Specified by:
setFilterTypein classAbstractListProjects
-
setShowDescription
public void setShowDescription(boolean showDescription) - Specified by:
setShowDescriptionin interfaceListProjects- Specified by:
setShowDescriptionin classAbstractListProjects
-
setAll
public void setAll(boolean all) - Specified by:
setAllin interfaceListProjects- Specified by:
setAllin classAbstractListProjects
-
setState
- Specified by:
setStatein interfaceListProjects- Specified by:
setStatein classAbstractListProjects
-
setLimit
public void setLimit(int limit) - Specified by:
setLimitin interfaceListProjects- Specified by:
setLimitin classAbstractListProjects
-
setStart
public void setStart(int start) - Specified by:
setStartin interfaceListProjects- Specified by:
setStartin classAbstractListProjects
-
setMatchPrefix
- Specified by:
setMatchPrefixin interfaceListProjects- Specified by:
setMatchPrefixin classAbstractListProjects
-
setMatchSubstring
- Specified by:
setMatchSubstringin interfaceListProjects- Specified by:
setMatchSubstringin classAbstractListProjects
-
setMatchRegex
- Specified by:
setMatchRegexin interfaceListProjects- Specified by:
setMatchRegexin classAbstractListProjects
-
setGroupUuid
- Specified by:
setGroupUuidin interfaceListProjects- Specified by:
setGroupUuidin 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:RestReadViewProcess 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.Redirectcan be returned for302 Found).Throwing a subclass of
RestApiExceptionresults in a 4XX response to the client. For any other exception the client will get a500 Internal Server Errorresponse.- Specified by:
applyin interfaceListProjects- Specified by:
applyin interfaceRestReadView<TopLevelResource>- Overrides:
applyin 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
-