srm: Fix set max ready get command

A regression in 2.9.0 caused the 'set max ready get' command of the
SRM to break. The regression is fixed by this patch.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.10
Request: 2.9
Acked-by: Dmitry Litvintsev <litvinse@fnal.gov>
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7228/
srm: Fix restore of bring-online requests on restart

A regression introduced in 2.10.0 prevents the SRM from starting
when active bring-online requests are found in the SRM database.
The problem is that the scheduler timestamp isn't updated when
restoring jobs. This patch resolves the issue.

Target: trunk
Request: 2.10
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/7224/
srm: Fix credential store registration

A regression in 2.10.0 prevents credentials from being reloaded. This regression
results in errors like these:

28 Aug 2014 16:54:25 (c-dCacheDomain-101-102) [] Uncaught exception in thread pool-2-thread-1
java.lang.NullPointerException: null
        at org.dcache.srm.request.RequestCredential.getRequestCredential(RequestCredential.java:120) ~[srm-server-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at org.dcache.srm.request.Request.getCredential(Request.java:226) ~[srm-server-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at org.dcache.srm.request.ContainerRequest.toString(ContainerRequest.java:679) ~[srm-server-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at org.dcache.srm.SRM.listRequest(SRM.java:1183) ~[srm-server-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at diskCacheV111.srm.dcache.SrmCommandLineInterface.ac_ls_$_0_1(SrmCommandLineInterface.java:218) ~[dcache-core-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at sun.reflect.GeneratedMethodAccessor364.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_65]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_65]
        at dmg.util.command.AcCommandExecutor.execute(AcCommandExecutor.java:140) ~[cells-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at org.dcache.util.cli.CommandInterpreter$CommandEntry.execute(CommandInterpreter.java:260) ~[common-cli-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at org.dcache.util.cli.CommandInterpreter.doExecute(CommandInterpreter.java:169) ~[common-cli-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at dmg.cells.nucleus.CellAdapter.doExecute(CellAdapter.java:955) ~[cells-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at org.dcache.util.cli.CommandInterpreter.command(CommandInterpreter.java:155) ~[common-cli-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at dmg.cells.nucleus.CellAdapter.command(CellAdapter.java:184) ~[cells-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at dmg.cells.nucleus.CellAdapter.executeLocalCommand(CellAdapter.java:891) ~[cells-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at dmg.cells.nucleus.CellAdapter.messageArrived(CellAdapter.java:817) ~[cells-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at dmg.cells.nucleus.CellNucleus$DeliverMessageTask.innerRun(CellNucleus.java:1092) ~[cells-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at dmg.cells.nucleus.CellNucleus$AbstractNucleusTask.run(CellNucleus.java:1000) ~[cells-2.10.4-SNAPSHOT.jar:2.10.4-SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]

The regression is fixed by this patch.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.10
Acked-by: Dmitry Litvintsev <litvinse@fnal.gov>
Acked-by: Paul Millar <paul.millar@desy.de>
srm: Remove dead null check

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Dmitry Litvintsev <litvinse@fnal.gov>
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7227/
Update billing indexer to avoid deprecated Guava API

Target: trunk
Require-notes: no
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/7225/
dcache-spacemanager: Move space manager to its own Maven module

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7217/
Avoid thread-unsafe use of SimpleDateFormatter

SimpleDateFormatter is not thread safe, yet there are places in which we
use it in multi-threaded environments - or potentially multi-threaded
environments. The standard approach is to use a thread local instance.

This patch converts the places I could find. In a few cases I conservatively
estimated that a formatter could possibly be used from multiple thread and
converted it even when maybe not strictly required.

The alternative would be to use Java 8's new date/time API, but since we
are refusing to use Java 8 we have to solve the problem in other ways.

Target: trunk
Request: 2.10
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7219/
cells: Improve pinboard

- 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).

- Uses 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.
  This also reduces a potential contention point between threads of a cell
  all writing to the pinboard.

- Reduces 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
Request: 2.10
Acked-by: Paul Millar <paul.millar@desy.de>
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7220/
srm: Fix incomplete restore of "ready queued" jobs

When restoring jobs in the RQUEUED state, they are counted as a ready-queued
job, but the code fails to add them to the actual ready queue. As a consequence
such jobs do not appear in the output when listing the queue, and the queue
length and the count are different.

This patch resolves this issue. It is unknown for how long this bug has existed,
but until version 2.9 we didn't attempt to restore RQUEUED jobs and the bug
doesn't matter before that release.

Target: trunk
Request: 2.10
Reqeuest: 2.9
Require-notes: yes
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7230/
Update netty and berkeley DB to latest version

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7226/
libs: switch to jglobus-2.1.0-SNAPSHOT and bcpkix-1.50

Acked-by: Gerd Behrmann
Target: master
Require-book: no
Require-notes: yes
libs: use nfs 0.9.0

The highlights for dCache:
  * special export option 'all_root' to by-pass any permission check for a
    particular client as well as inherit parent directory uid and gid for newly created
    objects
  * a possibility to inject worker thread pool
  * a possibility to invalidate entries in VfsCache
  * faster validation of utf8 strings used as file system object names.

Changelog for nfs4j-0.8.0..nfs4j-0.9.0
    * [464967c] nfsv41: client: do not send getattr to DS
    * [4141d49] utils: use addAll instead of for-loop
    * [e59c277] utils: fix javadoc
    * [db1c50d] nfs: introduce exception per status code
    * [bfc2e94] test: suppress deprecation warning
    * [d1c6a02] test: update tests to expect exceptions of exact subtype
    * [74562c7] nfs4: log some specific error states
    * [2f47a8f] nfs4: tiny cleanup
    * [0d1e4da] vfs: chimera: convert ChimerFsExceptions into NfsExceptios
    * [832c22c] nfs: do not catch ChimeraFsExceptions
    * [014739d] basic-server: update h2 db to 1.4.178
    * [9e05390] nfs41: move device id generation into a dedicated method
    * [cea74c6] vfs: glorify logging of Subject
    * [7e8222b] vfs: access deny messages should include client ip
    * [409c038] basic-server: add initial paths creator for exports
    * [bb7a45a] nfs3: fix mounting of a exports with trailing slash
    * [7169e1b] libs: switch to guava 17.0 and bonecp 0.8.0
    * [b6a1b74] nfsv4: use guava's Utf8#isWellFormed() to detect bad strings
    * [efa8d79] nfsv3: check name constrains
    * [e20f05e] nfsv41: SequenceStub#generateRequest() accepts session4
    * [840379a] utils: add TimeSource to make time depending testing simpler
    * [75b5b0a] nfsv41: use random port number for testing
    * [886927f] nfsv41: destroy session can be sent only on a bound connection
    * [0734ed6] nfsv4: add method to validate full path
    * [c153cd4] client: add an option for non pnfs read/write
    * [436115e] nfsv4: client must accept IPv6 addresses
    * [7bf4c38] libs: switch to oncrpc4j-2.3.0
    * [1507bb8] vfs-cache: expose invalidateStatCache and invalidateLookupCache
    * [48ff842] vfs: introduce short cache of a parent inode on create
    * [6865cc1] vfs-cache: use  LoadingCache for caching
    * [7766393] nfs4: expose state handler
    * [de90462] nfs4: add a possibility to shutdown state handler
    * [7d265e7] src: remove unused import
    * [236d494] basic-server: adjust oncrpcsvc.xml to spring 4.x
    * [033f7eb] acl: fix permission check on listdirectory
    * [359dbfd] test: replace MountServerTest#arrayContains() with Ints.contains() from guava
    * [08e7d67] mount: add support for symlinks
    * [fece35b] vfs-cache: expose caches through JMX
    * [2147701] nfs: add export option 'all_root' to map all users to local root
    * [f418af3] pseudofs: inherit parent dirs uid/gid in all_root option is used

Acked-by: Gerd Behrmann
Target: master
Require-book: no
Require-notes: yes