PDB-128: Support Oracle Java distribution.

On Debian it's possible to package releases from Oracle through
make-jpkg, a utility provided by the java-package package:
https://wiki.debian.org/JavaPackage

This commit adds support for:
 * Detecting Oracle Java 1.7 packaged RE or SDK
 * Satisfy the package requirement of Java by looking for the j2re1.7
   provides that the make-jpkg packages carry, both RE and SDK.

I've left out satisfying the dependency through j2re1.6 as @kbarber
and I agreed that we shouldn't promote the usage of Java 1.6 any
further.
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  Fixes an issue when using spyscope as a lein user profile

Conflicts:
	project.clj
Merge branch '1.6.x'

* 1.6.x:
  Fixes an issue when using spyscope as a lein user profile
Merge pull request #793 from daenney/debian-java-1.6.x

PDB-128: Support Oracle Java distribution.
Merge branch '1.6.x'

* 1.6.x:
  PDB-128: Support Oracle Java distribution.
(#23422) Use JSON in terminus instead of PSON

The PuppetDB API specifies that it is JSON, so we should parse it as
that and not as PSON.

Some Puppet classes (Puppet::Node and Puppet::Node::Facts) don't support
JSON serialization, so continue to use PSON serialization for them.
In Puppet 3.4.0+ they have methods to do seralization in other formats
than PSON though, so once support for older versions of Puppet is
dropped they can be seralized in JSON as well.
Merge pull request #776 from dalen/json_terminus

(#23422) Use JSON in terminus instead of PSON
Merge pull request #823 from cprice404/bug/1.5.x/PE-2675-change-filter-order-for-distinct-resource-events

Bug/1.5.x/pe 2675 change filter order for distinct resource events
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  Refactor `validate-distinct-options` into common events http ns
  Add documentation for `distinct-resources` query parameter
  (PE-2675) Change the order that filters are applied for events

Conflicts:
	src/com/puppetlabs/puppetdb/http/v3/aggregate_event_counts.clj
	src/com/puppetlabs/puppetdb/http/v3/event_counts.clj
	src/com/puppetlabs/puppetdb/http/v3/events.clj
Merge branch '1.6.x'

* 1.6.x:
  Refactor `validate-distinct-options` into common events http ns
  Add documentation for `distinct-resources` query parameter
  (PE-2675) Change the order that filters are applied for events
PDB-341 Fix some API version crossover issues

This patch fixes the immediate bug provided with PDB-341:

* select-resources not working for file/line in v3 api

But as a consequence of solving this problem we've found other inconsistencies
with the API:

* v3 of the resources end-point was using the v2 of the 'not' operator
* v3 of the resources end-point was using the v2 fact operators for select-facts

In short, these bugs can be put down to copy & paste errors when we cut the v3
release. The facts end-point in particular still had a lot of code pointing at
v2 api stuff which was fine when these were backwards compatible but in some
cases this has caused problems as we have found.

The patch here breaks up the facts endpoints into their versioned counterparts
as you would expect to hopefully avoid this issue. In the future we should
find a better way to version and decompose this (for example, using a multi-method,
condp or other 'case' still look for version behaviour for all the operators).

I've also copied over the testing from the v1 and v2 endpoints that was missing
from v3. I've achieved this by combining the tests into a single file and simply
iterating over the v2 and v3 end-points.

Also, I've removed the use of custom 'get-request' functions all over the place
since this was making the development inconsistent. There was also a minor
variant known as 'make-request' which I've removed.

'endpoint' is now declared at the top of each test to be re-used again to reduce
any copy and paste errors in the future as well.

Any other changes include either modifying items to fix bugs from the above
changes or a general increase in coverage where I saw it needed it.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-341 Remove extra get-response and fix ordering issues in tests

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-341 Ensure body of response is drained after query

This avoids a deadlock issue whereby the query is still running, but the next
test is trying to wipe the database.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #818 from kbarber/ticket/1.6.x/PDB-341-select-resources-file-line

PDB-341 Fix some API version crossover issues
Merge branch '1.6.x'

* 1.6.x:
  PDB-341 Ensure body of response is drained after query
  PDB-341 Remove extra get-response and fix ordering issues in tests
  PDB-341 Fix some API version crossover issues

Conflicts:
	test/com/puppetlabs/puppetdb/test/http/v1/deprecation.clj
Port to trapperkeeper 0.3.0

This commit updates PuppetDB to use the new trapperkeeper 0.3.0
API.  This includes:

* Slightly modified syntax for defining services and service
  lifecycle behavior
* Switch from log4j to logback, update documentation and packaging
  accordingly
* Switch from jetty7 to jetty9
* Add example of how to use "reloaded" interactive development pattern
  in REPL
WIP: debugging aot issues with prismatic