Introduce GerritClient#getPlugins()

Sending --plugin-config options in a create-project command will
fail if the corresponding plugin is not installed in the target
Gerrit.

This patch introduces a new client method, getPlugins(), that
will return the plugins installed in a target Gerrit server
using the "plugin ls" command. Note that this command requires
the "View Plugins" capability assigned to the requesting user,
otherwise the request will fail.

Since this command is not available before Gerrit 2.5 the feature
constant LS_PLUGINS has been introduced, too. For older servers
getPlugins() will always return empty results.

The result of the "plugin ls" command is cached in the client
instance to avoid unnecessary roundtrips.

A test will be provided in a subsequent patch since some refactoring
must be done before.

Change-Id: Ieeea3f1e3c825c47ad9833a36e447661b788b4de
Signed-off-by: Michael Ochmann <michael.ochmann@sap.com>
5 files changed