dcache-srm: Move AuthorizationRecord and related classes to dcache-srm

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7218/
srm: Make dcache-core independent of srm-server

To make this possible, I changed how TransferManager generates IDs. It
now uses the TimebasedCounter class. Granularity of the counter is
increased to 1 Mhz, which should be more transfers than we will ever
see for the entire system, and certainly more than any single door or
transfer manager. The counter still allows for about half a million
years before it wraps around.

This change also means that TransferManager will not use a database
unless transfermanagers.enable.log-to-database is set to true.

Target: trunk
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7234/
dcache-common: change NetworkUtil getCanonicalHostname to prefer DNS name

The utility method in NetworkUtils which gets the canonical host name for
the localhost currently picks the first entry from an external-to-
internal sorted array. However, this can produce an ipv6-style name
which is not as readily legible.

Since this method is primarily for metadata purposes
(and currently used only by alarms code), it has been changed to
prefer a tradition DNS name, if it exists.

Target: master
Request: 2.10
Patch: https://rb.dcache.org/r/7243/
Require-notes: no
Require-book: no
Acked-by: Tigran
Update to Jetty 9

Jetty 9 has an entirely rewritten I/O system. Therefore our GSIConnector is no
longer usable.

This patch introduces GlobusContextFactory which can be used with Jetty to
create SSL and GSI connections using certificate stores and certificate
validation from JGlobus. GlobusContextFactory can be configured to wrap the
SSLEngine with GsiEngine, which implements GSI delegation on top of plain SSL.
The JGlobus provided GlobusGSSContextImpl is no longer used with Jetty.

Parts of the SRM had to be altered to remove the dependency on
GlobusGSSContextImpl.

GsiFrameEngine is another SSLEngine decorator, which implements the legacy
GSI framing mode. It auto-detects whether the client uses framing.

Other parts of dCache had to be updated as well to compensate for other API
changes.

Jetty 9 implements TLS compliant shutdown of the connection. This involves
sending a CLOSE notification to the client before closing the socket. Some
clients (in particular the current versions of our own SRM client) misinterpret
this notification as a fatal error. To maintain compatibility with such clients,
the new property srm.enable.legacy-close should be set to true. A patch for
JGlobus to fix the client has been submitted.

Jetty 9 uses asynchronous I/O, which means idle connections will no longer
occupy a thread.

Jetty 9 changes the low-resource timeout handling. Previous versions only
lowered the timeout of new connections. Jetty 9 now lowers the timeout on
existing connections if resources are low - and if that has no effect it
lowers the timeout on new connections too.

Trust store and key store reload is partially handled internally in JGlobus.
It watches files it has loaded for modifications every 60 seconds and
reloads them if changed. It does however not detect if any of those
files were deleted or if new files were added. For this reason we periodically
recreate the entire SSLContext. Since this reloads bost the trust store
and the key store, the lowest of the two configuration properties is used
to specify the context lifetime.

Target: trunk
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7193/
Mark deprecated properties as forbidden

Marks all properties that were deprecated in 2.10 as forbidden.

Properties previously marked forbidden or obsolete are removed.

Target: trunk
Require-notes: yes
Require-book: yes
Acked-by: Paul Millar <paul.millar@desy.de>
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: https://rb.dcache.org/r/7168/
Fix CacheException references in error messages

A regression in CacheExceptionFactory results in CacheException#toString
form to be included as the message of another CacheException. The
intention of the code was that sub-classes of CacheException do not
get wrapped, but the code was flawed.

Target: trunk
Request: 2.10
Request: 2.9
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7267/
chimera: Fix creation time flag in ls command

The ls command of the chimera CLI fails to interpret the creation time
flag correctly.

Target: trunk
Request: 2.10
Request: 2.9
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7268/
srm: Fix reporting of infinite space lifetime

A lifetime of -1 indidicates that the space has an infinite lifetime. This
needs to be taken into account when converting between seconds and milli-
seconds.

Target: trunk
Request: 2.10
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7269/
chimera: protect list initialization from FS inconsistencies

we observe that in some situations nlink count get out of
sync. As this is a bug by itself, protect directory listing
from from invalid initial capacity initialization.

Acked-by: Karsten Schwank
Target: master
Require-book: no
Require-notes: no