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 class
ListProjects.FilterType
-
Constructor Summary
Constructors Modifier Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addShowBranch(String branch)
SortedMap<String,ProjectInfo>
apply()
Object
apply(TopLevelResource resource)
Process the view operation by reading from the resource.SortedMap<String,ProjectInfo>
display(PrintWriter stdout)
void
displayToStream(OutputStream displayOutputStream)
com.google.gerrit.json.OutputFormat
getFormat()
List<String>
getShowBranch()
boolean
isShowDescription()
boolean
isShowTree()
void
setAll(boolean all)
void
setFilterType(ListProjects.FilterType type)
ListProjects
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 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:RestReadView
Process the view operation by reading from the resource.- Specified by:
apply
in interfaceRestReadView<TopLevelResource>
- Parameters:
resource
- resource to read.- Returns:
- result to return to the client. Use
BinaryResult
to 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
-
-