Package com.google.gerrit.server.project
Class ProjectsCollection
- java.lang.Object
- 
- com.google.gerrit.server.project.ProjectsCollection
 
- 
- All Implemented Interfaces:
- AcceptsCreate<TopLevelResource>,- RestCollection<TopLevelResource,ProjectResource>
 
 public class ProjectsCollection extends Object implements RestCollection<TopLevelResource,ProjectResource>, AcceptsCreate<TopLevelResource> 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateProjectcreate(TopLevelResource parent, IdString name)Handle creation of a child resource.RestView<TopLevelResource>list()Create a view to list the contents of the collection.ProjectResourceparse(TopLevelResource parent, IdString id)Parse a path component into a resource handle.ProjectResourceparse(String id)Parses a project ID from a request body and returns the project.ProjectResourceparse(String id, boolean checkAccess)Parses a project ID from a request body and returns the project.DynamicMap<RestView<ProjectResource>>views()Get the views that support this collection.
 
- 
- 
- 
Method Detail- 
listpublic RestView<TopLevelResource> list() Description copied from interface:RestCollectionCreate a view to list the contents of the collection.The returned view should accept the parent type to scope the search, and may want to take a "q" parameter option to narrow the results. - Specified by:
- listin interface- RestCollection<TopLevelResource,ProjectResource>
- Returns:
- view to list the collection.
 
 - 
parsepublic ProjectResource parse(TopLevelResource parent, IdString id) throws ResourceNotFoundException, IOException, PermissionBackendException Description copied from interface:RestCollectionParse a path component into a resource handle.- Specified by:
- parsein interface- RestCollection<TopLevelResource,ProjectResource>
- Parameters:
- parent- the handle to the collection.
- id- string identifier supplied by the client. In a URL such as- /changes/1234/abandonthis string is- "1234".
- Returns:
- a resource handle for the identified object.
- Throws:
- ResourceNotFoundException- the object does not exist, or the caller is not permitted to know if the resource exists.
- IOException
- PermissionBackendException
 
 - 
parsepublic ProjectResource parse(String id) throws UnprocessableEntityException, IOException, PermissionBackendException Parses a project ID from a request body and returns the project.- Parameters:
- id- ID of the project, can be a project name
- Returns:
- the project
- Throws:
- UnprocessableEntityException- thrown if the project ID cannot be resolved or if the project is not visible to the calling user
- IOException- thrown when there is an error.
- PermissionBackendException
 
 - 
parsepublic ProjectResource parse(String id, boolean checkAccess) throws UnprocessableEntityException, IOException, PermissionBackendException Parses a project ID from a request body and returns the project.- Parameters:
- id- ID of the project, can be a project name
- checkAccess- if true, check the project is accessible by the current user
- Returns:
- the project
- Throws:
- UnprocessableEntityException- thrown if the project ID cannot be resolved or if the project is not visible to the calling user and checkVisibility is true.
- IOException- thrown when there is an error.
- PermissionBackendException
 
 - 
viewspublic DynamicMap<RestView<ProjectResource>> views() Description copied from interface:RestCollectionGet the views that support this collection.Within a resource the views are accessed as RESOURCE/plugin~view.- Specified by:
- viewsin interface- RestCollection<TopLevelResource,ProjectResource>
- Returns:
- map of views.
 
 - 
createpublic CreateProject create(TopLevelResource parent, IdString name) Description copied from interface:AcceptsCreateHandle creation of a child resource.- Specified by:
- createin interface- AcceptsCreate<TopLevelResource>
- Parameters:
- parent- parent collection handle.
- name- id of the resource being created.
- Returns:
- a view to perform the creation. The create method must embed the id into the newly returned view object, as it will not be passed.
 
 
- 
 
-