public class AccountsCollection extends java.lang.Object implements RestCollection<TopLevelResource,AccountResource>
Constructor and Description |
---|
AccountsCollection(AccountResolver accountResolver,
com.google.inject.Provider<QueryAccounts> list,
DynamicMap<RestView<AccountResource>> views) |
Modifier and Type | Method and Description |
---|---|
RestView<TopLevelResource> |
list()
Create a view to list the contents of the collection.
|
AccountResource |
parse(TopLevelResource root,
IdString id)
Parse a path component into a resource handle.
|
DynamicMap<RestView<AccountResource>> |
views()
Get the views that support this collection.
|
@Inject public AccountsCollection(AccountResolver accountResolver, com.google.inject.Provider<QueryAccounts> list, DynamicMap<RestView<AccountResource>> views)
public AccountResource parse(TopLevelResource root, IdString id) throws ResourceNotFoundException, AuthException, java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException
RestCollection
parse
in interface RestCollection<TopLevelResource,AccountResource>
root
- 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
java.io.IOException
org.eclipse.jgit.errors.ConfigInvalidException
public RestView<TopLevelResource> list() throws ResourceNotFoundException
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,AccountResource>
ResourceNotFoundException
- if the collection doesn't support listing.public DynamicMap<RestView<AccountResource>> views()
RestCollection
Within a resource the views are accessed as RESOURCE/plugin~view
.
views
in interface RestCollection<TopLevelResource,AccountResource>