Catch implicit exception

CacheBuilder.expireAfterWrite() has possibility to raise exception if
expiration is negative. So cache object cannot be set to final member in
ReplicationCache. Also its exception is not catched anywhere.

This patch moves cache creation and logging to new method.
And adds factory class for initializing ReplicationCache correctly.

Fix for JENKINS-22814: Some infomations are logged from constructor on
startup 
https://issues.jenkins-ci.org/browse/JENKINS-22814
Support for review notification levels

This is basically support for Rest API's 'notify' field on ReviewInputs.
as specified in [1].

UI changes
* Add 'Notification Level' dropdown on GerritServer allowing to
  select one the permitted values.  The default is 'ALL', which
  matches to the existing behavior of notifying all interested users.
* Add 'Notification Level' dropdown on GerritTrigger allowing to
  override the server default.

In case of multiple builds for a Gerrit event, the highest value is
chosen.

[1] https://gerrit-documentation.storage.googleapis.com/Documentation/2.7/rest-api-changes.html#set-review
Improve to treat arguments and logging
Change form value check to non-negative integer
Merge pull request #150 from rinrinne/replication-cache

Catch implicit exception
Support for review notification levels

This is basically support for Rest API's 'notify' field on ReviewInputs.
as specified in [1].

UI changes
* Add 'Notification Level' dropdown on GerritServer allowing to
  select one the permitted values.  The default is 'ALL', which
  matches to the existing behavior of notifying all interested users.
* Add 'Notification Level' dropdown on GerritTrigger allowing to
  override the server default.

In case of multiple builds for a Gerrit event, the highest value is
chosen.

[1] https://gerrit-documentation.storage.googleapis.com/Documentation/2.7/rest-api-changes.html#set-review
Merge pull request #152 from chgeo/notify-support

Support for review notification levels
[maven-release-plugin] prepare release gerrit-trigger-2.12.0-beta-2
[maven-release-plugin] prepare for next development iteration
Add option to exclude drafts when triggering on patchset created event.

Gerrit support draft changes and draft patchsets. Gerrit Trigger was able
to trigger a build when a draft change is published (transitioned from draft to
regular change) but it was missing an option to allow user to exclude draft
patchsets when triggering on patchset created event.

This change add a checkbox in the patchset created type of trigger to exclude
draft patchsets. By default, this option is not enabled to be compatible with behaviour
prior to this change.

Change-Id: I279a34662a46c6aa9657b2b604027b0e52f76adc
Merge pull request #153 from hugares/excludeDrafts

Add option to exclude drafts when triggering on patchset created event.
Permit the setting of Build Schedule Delay to "0".

Delay not needed with Replication Events. Also fixed dependent projects
feature to no longer rely on this default 3 seconds delay. [FIXED JENKINS-22812]

Change-Id: Ic11f0fb7b9e43e95ae7dec71c30fe1e6fab1e8ac
Copy REST API setting

when create new server by copying existing ones, REST API settings are
not copied.

This patch can copy REST API settings.

As a side note, Secret.fromString() calls Jenkins instance to use
confidencial key. So ConfigTest have to use it.

Fix for JENKINS-23189
Merge pull request #143 from scoheb/permit-no-delay

Permit the setting of Build Schedule Delay to "0". Delay not needed with Replication Events
Merge pull request #156 from rinrinne/copy-restapi-config

Copy REST API setting
Store encrypted password

Now password for SSH authentication file is stored as plain text.

This patch fixes it. Already stored password would be replaced to
encrypted ones if config is saved once.

Fix for JENKINS-23165
Fix tests depends on Config class

To use Config class, jenkins instance is needed.

And add PowerMockIgnore annotation to prevent ClassCastException.
Merge pull request #157 from rinrinne/encrypt-pw

Store encrypted password
Prevent to send plaintext password to browser

Fix for JENKINS-23165 and pull #157
Prevent to send plain HTTP password to browser