srm: fix file ownership queries

Currently, the SRM relies on down-casting the supplied SRMUser object to an
AuthorizationRecord to discover the uid and gid of this user.  This is used either
when querying whether a file is owned by some user or the user is a member of the
group that owns this file.

Since we recently moved away from AuthorizationRecord and used DcacheUser as the
concrete class that provides SRMUser, the ability to discover uid and gid of a user
was lost.

This patch fixes the problem by downcasting to the correct class.

A problem not fixed by this patch is that group-ownership is checked only against
the user's primary gid (all groups should be checked).  A future patch will fix
this.

Target: master
Requires-notes: no
Requires-book: no
Patch: http://rb.dcache.org/r/5905
Acked-by: Dmitry Litvintsev
Acked-by: Gerd Behrmann
*dcap, *ftp, ssh1: fix error handling

LoginManager is agnostic to the underlying protocol and delegates
this responsibility to some StreamEngine.  The StreamEngine is
instantated via reflection, which may result in an
InvocationTargetException being thrown, which wraps the underlying
cause of the problem.

There are two problems with the current code: first, if the underlying
problem is an Error (e.g. OutOfMemoryError) then this is not
propagated and dCache will try to continue in this ill-defined state;
second, the error message logged is that of the ITE, which does
not include a description of the underlying problem.

This patch fixes these two problems.

Target: master
Request: 2.6
Request: 2.2
Patch: http://rb.dcache.org/r/5906
Acked-by: Tigran Mkrtchyan
dcap: drop READV io log level from info to debug

Ticket: #7980
Acked-by: Paul Millar
Target: master, 2.6
Require-book: no
Require-notes: yes
IPv6: Improve address handling by Subnet (was 4639)

In some cases class Subnet handles converted IPv6 to IPv4 addresses in
an incorrect way: It accepts some invalid addresses and in some cases it
converts the address without adjusting the netmask.
This patch fixes these problems by adding special handling for special
addresses.

Acked-by: Tigran
Target: master
Require-book: no
Require-notes: no
gplazma-ldap: make DN search string configurable

added a new property to specify DN search criteria:

gplazma.ldap.userfilter

The default value is 'uid', which is used in posix
schema.

This is a very lite filter version. Can be changed if needed.

Acked-by: Paul Millar
Target: master,2.6
Require-book: yes
Require-notes: yes
Patch: http://rb.dcache.org/r/5922/
startup: fix logging multiple stacktraces on RuntimeException

When dCache fails to start up a service because a cell throws
a RuntimeException then the same stack-trace is logged three times:
once by AbstractCell's doInit and twice within Bootload.

This patch reduces this to just once.  It also fixes the problem
that multiple RuntimeExceptions have null as their message, so
toString is used instead.

Note that there is still a RuntimeException that wraps the previous
RuntimeException and adds the context information (which line and file
triggered the problem), therefore the stack-trace includes two
exceptions.

Target: master
Requires-book: no
Requires-notes: no
Patch: http://rb.dcache.org/r/5919
Acked-by: Tigran Mkrtchyan
poolmanager: provide reasonable error message if partition type is unknown

If the admin has saved a partition type 'classic' in their
poolmanager.conf then dCache will fail to start with a meaningless
error message and a stack-trace.

This patch provides a meaningful error message.  Due to a
hack/work-around for another problem, the message is wrapped in a
RuntimeException, which triggers reporting the problem as a bug (with
a stack-trace).

Target: master
Requires-notes: no
Requires-book: no
Patch: http://rb.dcache.org/r/5920/
Acked-by: Karsten Schwank
pom: yet another fix to datanucleus dependency

use the same plugin across components

Acked-by: Paul Millar
Acked-by: Karsten Schwank
Target: master
Require-book: no
Require-notes: no
Patch: http://rb.dcache.org/r/5923/
[maven-release-plugin] prepare branch 2.7
[maven-release-plugin] prepare for next development iteration
srm: Optimize Job loading logic

Addresses performance issues in code to read SRM requests from the
SRM database.

The Job class has a static method for retrieving Jobs by id. The method
is unaware of the Job type though, and thus has to use trial and error
to find the right JobStorage from which to load the request.

This patch refines the logic such that the method makes use of a class
parameter to reduce the number of JobStorages to probe.

A subsequent patch will refine callers of the above method to supply
a more narrow type than is currently the case.

Target: trunk
Require-notes: yes
Require-book: no
srm: Generify ContainerRequest, FileRequest and JobStorage

Addresses performance issues in code to load SRM requests from
the SRM database. Also addresses bugs triggered by disabling
database support in the SRM.

The patch generifies a number of SRM classes and interfaces. Besides
removing the need for a lot of type casting, this change allows
generic code in the base classes to know the type of their collaborators.
In particular, this allows a more precise type to be specified when
loading SRM requests back from the database, thus reducing the need
to probe several JobStorages.

The patch removes some dead code to avoid having to update it.

The patch addresses issues in which admin shell commands to cancel
active requests and to query recent requests would fail with a
ClassCastException if database support was disabled. That fix
also addresses issues in which an attempt to cancel requests that
are incompetely stored in the database would cause erroneous
results.

An example of the above issue is

[Gerds-MacBook-Pro.local] (SRM-Gerds-MacBook-Pro) admin > ls completed
java.lang.ClassCastException: org.dcache.srm.scheduler.NoopJobStorage cannot be cast to org.dcache.srm.request.sql.DatabaseRequestStorage

Target: trunk
Require-notes: yes
Require-book: no
Interim