public class GroupsCollection extends java.lang.Object implements RestCollection<TopLevelResource,GroupResource>, NeedsParams
Constructor and Description |
---|
GroupsCollection(DynamicMap<RestView<GroupResource>> views,
com.google.inject.Provider<ListGroups> list,
com.google.inject.Provider<QueryGroups> queryGroups,
GroupControl.Factory groupControlFactory,
GroupResolver groupResolver,
com.google.inject.Provider<CurrentUser> self) |
Modifier and Type | Method and Description |
---|---|
RestView<TopLevelResource> |
list()
Create a view to list the contents of the collection.
|
GroupResource |
parse(TopLevelResource parent,
IdString id)
Parse a path component into a resource handle.
|
void |
setParams(com.google.common.collect.ListMultimap<java.lang.String,java.lang.String> params)
Sets the request parameter.
|
DynamicMap<RestView<GroupResource>> |
views()
Get the views that support this collection.
|
@Inject public GroupsCollection(DynamicMap<RestView<GroupResource>> views, com.google.inject.Provider<ListGroups> list, com.google.inject.Provider<QueryGroups> queryGroups, GroupControl.Factory groupControlFactory, GroupResolver groupResolver, com.google.inject.Provider<CurrentUser> self)
public void setParams(com.google.common.collect.ListMultimap<java.lang.String,java.lang.String> params) throws BadRequestException
NeedsParams
setParams
in interface NeedsParams
params
- the request parameterBadRequestException
public RestView<TopLevelResource> list() throws ResourceNotFoundException, AuthException
RestCollection
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.
list
in interface RestCollection<TopLevelResource,GroupResource>
ResourceNotFoundException
- if the collection doesn't support listing.AuthException
- if the collection requires authentication.public GroupResource parse(TopLevelResource parent, IdString id) throws AuthException, ResourceNotFoundException
RestCollection
parse
in interface RestCollection<TopLevelResource,GroupResource>
parent
- the handle to the collection.id
- string identifier supplied by the client. In a URL such as /changes/1234/abandon
this string is "1234"
.ResourceNotFoundException
- the object does not exist, or the caller is not permitted to
know if the resource exists.AuthException
public DynamicMap<RestView<GroupResource>> views()
RestCollection
Within a resource the views are accessed as RESOURCE/plugin~view
.
views
in interface RestCollection<TopLevelResource,GroupResource>