spacemanager: Avoid a transaction deadlock and reduce DB overhead

When uploading files outside a space reservation to a link group, space manager
creates an implicit reservation for the file. This reservation is created upon
intercepting PoolAcceptFileMessage using information space manager injected
into StorageInfo upon intercepting PoolSelectWritePoolMessage.

Before the link group name was injected into StorageInfo, forcing space manager
to look up link group details when intercepting PoolAcceptFileMessage. Besides
requiring extra database lookups, this also led to a deadlock: The initial read
of the link group creates a shared lock on that row. The subsequent creation of
a temporary reservation causes an update to the link group and thus requires an
excluside lock. When two concurrent transactions do this at the same time, both
may obtain the shared lock and will then block to obtain an exclusive lock.
The RDBMS breaks the deadlock by aborting one of the transactions - and space
manager correctly retries the operation - however this reduces space manager
throughput.

The resolution implemented in this patch is to inject the link group ID rather
than the link group name. The owner information is now calculated from the
subject rather than repeating an authorization check that was already done when
intercepting the pool manager message.

I request back-port to 2.10, as the periodic deadlocks could trigger support
requests (even when they are relatively harmless).

Target: trunk
Request: 2.11
Request: 2.10
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7373/
doors: Shorten session and initiator strings

Our session strings have been redundant in the sense that we added
uniquness counters at several levels. This has lead to fairly long
session strings.

Doors have also added their domain name to the session string, even
when doors usually are well-known and the cell name is unique within
the dCache instance.

This patch cleans this up by avoiding adding redundant uniqueness
counters and the domain name when not needed.

This affects the session string that appears in log files and the
initiator strings that appear in billing.

Target: trunk
Require-notes: yes
Require-book: yes
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7416/
httpd: Refactor wiring code

Moves more of the instantiation into spring.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: https://rb.dcache.org/r/7421/
httpd: Refactor handler instantiation

AliasEntry was tightly coupled to HttpServiceCell (apparent in that a admin
shell Args instance was passed to the AliasEntry factory method, and in that
several getters of HttpServiceCell were only used by the AliasEntry factory).

This patch moves the alias and handler creation into HttpServiceCell, thus
reducing coupling of AliasEntry.

The patch also simplifies the AliasType enum.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: https://rb.dcache.org/r/7423/
pool: Replace parboiled library with grappa

The author of parboiled has abandoned this version and moved on to parboiled2.
The new version is unfortunately a Scala only project, leaving us Java users
behind. parboiled1 doesn't support Java 8. Other users have forked the project
and added Java 8 support. The new project is called grappa.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Karsten Schwank <karsten.schwank@desy.de>
Patch: https://rb.dcache.org/r/7429/
Fix indentation

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7430/
chimera: prevent attempts to remove '.' and '..'

we have in place checks for NFS, but not for the
other protocols.

Acked-by: Paul MIllar
Target: master, 2.11 ..  2.6
Require-book: no
Require-notes: no
   imera: protect against NPE in FsSqlDriver#read

    RB: https://rb.dcache.org/r/7385/
    Acked-by: Paul Millar
    Target: trunk
    Request: 2.11 2.10 2.9 2.8 2.7 2.6
xrootd: Initialize session

Initializes a session string for xrootd.

Target: master
Request: 2.11
Request: 2.10
Require-notes: yes
Require-book: yes
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7437/
cells: Improve pinboard

- Port the pinboard code to Java 8
- Changes the time format to use the local time format (rather than
  hard-coding a 12 hour format with no indication wheter it is am or pm).
- Use a circular buffer rather than an array to keep the log - removing
  the oldest entry from an array is rather expensive as the entire array
  has to be copied. This change reduce the CPU overhead of the pinboard.
- Also reduced the memory foot print and CPU overhead of creating a
  pinboard entry (static inner and no Date instance stored in a field).

Target: trunk
Require-notes: yes
Require-book: yes
Acked-by: Albert Rossi <arossi@fnal.gov>
Acked-by: Paul Millar <paul.millar@desy.de> (email)
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Revert "cells: Improve pinboard"

This reverts commit 0cabf0960f10fb615b9959685fdcfbd8498af37b.
Move to Java 8

Require Java 8 for compilation and for execution.

A few code changes were required due to changes in how generics are
treated in Java 8.

srm-client and packages it depends on are still flagged as Java 7,
allowing us to release a Java 7 compatible SRM client.

Target: trunk
Require-notes: yes
Require-book: yes
Acked-by: Albert Rossi <arossi@fnal.gov>
Acked-by: Paul Millar <paul.millar@desy.de> (email)
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7166/
fix WebDAV door logging stacktrace on USERINFO request

Milton does not support the USERINFO request. If such an request arrives
(davfs2 uses it for example) it will produce an IllegalArgumentException
with the message "No enum constant io.milton.http.Request.Method.USERINFO"
that will end up as a StackTrace
in the log and sends back a HTTP response "500 No enum constant
io.milton.http.Request.Method.USERINFO".  Better would be to respond
with "501 Not implemented" and not log the StackTrace.  This patch
solves this issue by checking for the unsupported method before passing
it on to Milton and sending the approprate response.

Ticket:
Acked-by: Gerd
Target: master
Request: 2.11
Request: 2.10
Require-book: no
Require-notes: no