Class ListProjects
- java.lang.Object
-
- com.google.gerrit.server.restapi.project.ListProjects
-
- All Implemented Interfaces:
RestReadView<TopLevelResource>,RestView<TopLevelResource>
public class ListProjects extends Object implements RestReadView<TopLevelResource>
List projects visible to the calling user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classListProjects.FilterType
-
Constructor Summary
Constructors Modifier Constructor Description protectedListProjects(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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShowBranch(String branch)SortedMap<String,ProjectInfo>apply()Objectapply(TopLevelResource resource)Process the view operation by reading from the resource.SortedMap<String,ProjectInfo>display(PrintWriter stdout)voiddisplayToStream(OutputStream displayOutputStream)com.google.gerrit.json.OutputFormatgetFormat()List<String>getShowBranch()booleanisShowDescription()booleanisShowTree()voidsetAll(boolean all)voidsetFilterType(ListProjects.FilterType type)ListProjectssetFormat(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 Detail
-
ListProjects
@Inject protected ListProjects(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)
-
-
Method Detail
-
addShowBranch
public void addShowBranch(String branch)
-
setShowTree
public void setShowTree(boolean showTree)
-
setFilterType
public void setFilterType(ListProjects.FilterType type)
-
setShowDescription
public void setShowDescription(boolean showDescription)
-
setAll
public void setAll(boolean all)
-
setState
public void setState(ProjectState state)
-
setLimit
public void setLimit(int limit)
-
setStart
public void setStart(int start)
-
setMatchPrefix
public void setMatchPrefix(String matchPrefix)
-
setMatchSubstring
public void setMatchSubstring(String matchSubstring)
-
setMatchRegex
public void setMatchRegex(String matchRegex)
-
setGroupUuid
public void setGroupUuid(AccountGroup.UUID groupUuid)
-
isShowTree
public boolean isShowTree()
-
isShowDescription
public boolean isShowDescription()
-
getFormat
public com.google.gerrit.json.OutputFormat getFormat()
-
setFormat
public ListProjects setFormat(com.google.gerrit.json.OutputFormat fmt)
-
apply
public Object apply(TopLevelResource resource) throws BadRequestException, PermissionBackendException
Description copied from interface:RestReadViewProcess the view operation by reading from the resource.- Specified by:
applyin interfaceRestReadView<TopLevelResource>- Parameters:
resource- resource to read.- Returns:
- result to return to the client. Use
BinaryResultto avoid automatic conversion to JSON. - Throws:
BadRequestException- the request was incorrectly specified and cannot be handled by this view.PermissionBackendException
-
apply
public SortedMap<String,ProjectInfo> apply() throws BadRequestException, PermissionBackendException
-
displayToStream
public void displayToStream(OutputStream displayOutputStream) throws BadRequestException, PermissionBackendException
-
display
public SortedMap<String,ProjectInfo> display(PrintWriter stdout) throws BadRequestException, PermissionBackendException
-
-