Document classes in com.google.gerrit.server.restapi.access

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Idf32d8c4b58b53daf81315ff9a9c3b21eb3e444b
This commit is contained in:
Edwin Kempin
2019-12-30 14:15:57 +01:00
parent 32da8d5d18
commit b11fa307cc
4 changed files with 14 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
/** REST collection that serves requests to {@code /access/}. */
@Singleton
public class AccessCollection implements RestCollection<TopLevelResource, AccessResource> {
private final Provider<ListAccess> list;

View File

@@ -18,6 +18,13 @@ import com.google.gerrit.extensions.restapi.RestResource;
import com.google.gerrit.extensions.restapi.RestView;
import com.google.inject.TypeLiteral;
/**
* REST resource that represents members in {@link AccessCollection}.
*
* <p>{@link AccessCollection} doesn't support accessing single members, hence this class only
* defines the {@link TypeLiteral} for the resource kind that is needed for binding the REST
* collection.
*/
public class AccessResource implements RestResource {
public static final TypeLiteral<RestView<AccessResource>> ACCESS_KIND =
new TypeLiteral<RestView<AccessResource>>() {};

View File

@@ -27,6 +27,11 @@ import java.util.Map;
import java.util.TreeMap;
import org.kohsuke.args4j.Option;
/**
* REST endpoint to list members of the {@link AccessCollection}.
*
* <p>This REST endpoint handles {@code GET /access/} requests.
*/
public class ListAccess implements RestReadView<TopLevelResource> {
@Option(

View File

@@ -19,6 +19,7 @@ import static com.google.gerrit.server.restapi.access.AccessResource.ACCESS_KIND
import com.google.gerrit.extensions.registration.DynamicMap;
import com.google.gerrit.extensions.restapi.RestApiModule;
/** Guice module that binds all REST endpoints for {@code /access/}. */
public class Module extends RestApiModule {
@Override
protected void configure() {