Adapt to current Gerrit plugin API

The plugin still compiled against APIs that were removed years ago:
the ReviewDb entity classes, CapabilityControl, ProjectControl via
ProjectResource.getControl(), and the pre-2.16 location and Input
type of the core SetParent REST endpoint.

Migrate to the NoteDb-era equivalents:

* com.google.gerrit.reviewdb.client.Project is now
  com.google.gerrit.entities.Project; NameKey instances are created
  via Project.nameKey().
* Capability and ownership checks go through PermissionBackend:
  ADMINISTRATE_SERVER for admins, PluginPermission for the two
  plugin capabilities, and ProjectPermission.WRITE_CONFIG on the
  project as the modern equivalent of ProjectControl.isOwner().
* The core endpoint moved to
  com.google.gerrit.server.restapi.project.SetParent and takes
  ParentInput from the extensions API; RestModifyView.apply() now
  returns Response<String>.
* ProjectCache.get() returns Optional<ProjectState>.

The delegation to the core endpoint with checkIfAdmin=false is
unchanged, as are the jail/protectorate rules from gerrit.config.

Change-Id: I5c1f4b29d8a37e60f14c2db9a5b8e17203f6c4d8
3 files changed
tree: d3c98a9a21310f6339ebce59a19f03c616de93b6
  1. .settings/
  2. src/
  3. .gitignore
  4. BUILD
  5. LICENSE