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.Implement
GET /projects/, without aquery=parameter.
-
-
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()Response<Object>apply(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 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 interfaceRestReadView<TopLevelResource>- 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
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
-
-