releases: update dCache version to v2.11
srm: fix IllegalStateTransition for COPY requests

If the user cancels a COPY request then the file request is moved to
state CANCELLED; however, if the copy then succeeds anyway, the SRM
attempts to move the job to state DONE.  This cannot succeed since
CANCELLED is a final state.

Fix this by first checking whether the job is already in a final
state.  Also tidy up some messages.

Target: master
Request: 2.10
Requires-notes: no
Requires-book: no
Acked-by: Tigran Mkrtchyan
Patch: https://rb.dcache.org/r/7147
srm: fix deserialise of TExtraInfo

The SRM saves the content of TExtraInfo for COPY requests, but fails
to deserialise it correctly if the user supplied no TExtraInfo.
This patch fixes that.

Target: master
Request: 2.10
Requires-book: no
Requires-notes: no
Acked-by: Tigran Mkrtchyan
Patch: https://rb.dcache.org/r/7147/
srm: fix NPE when checking delegated credential

The SRM keeps "the best" delegated credential, if the user supplies one.
If the user doesn't delegate a credential then the current code throws
a NPE.  This is fixed with this patch.

Target: master
Request: 2.10
Requires-notes: no
Requires-book: no
Acked-by: Tigran Mkrtchyan
Patch: https://rb.dcache.org/r/7147/
srm: fix NPE when checking delegated credential

The SRM keeps "the best" delegated credential, if the user supplies one.
If the user doesn't delegate a credential then the current code throws
a NPE.  This is fixed with this patch.

Target: master
Request: 2.10
Requires-notes: no
Requires-book: no
Acked-by: Tigran Mkrtchyan
Patch: https://rb.dcache.org/r/7147/
Merge pull request #699 from paulmillar/fix/2.10/srm-delegated-credential

srm: fix NPE when checking delegated credential
srm: fix deserialise of TExtraInfo

The SRM saves the content of TExtraInfo for COPY requests, but fails
to deserialise it correctly if the user supplied no TExtraInfo.
This patch fixes that.

Target: master
Request: 2.10
Requires-book: no
Requires-notes: no
Acked-by: Tigran Mkrtchyan
Patch: https://rb.dcache.org/r/7147/
Merge pull request #700 from paulmillar/fix/2.10/srm-extra-info

srm: fix deserialise of TExtraInfo
alarms: add fuller support for Markers

Recently it was discovered that one of the alarm definitions
(for checksum) was out of sync with the code because the logging
statement it was based on had been modified and this modification
had gone undiscovered (see patch https://rb.dcache.org/r/7115).

The bug brought home the point that reliance on the remote-server
filters can be fragile. While it is desirable to continue to
support these filters, a more robust policy in terms of
development would be to make all such filters optional and
generated by admins. This would mean that all predefined
alarms (introduced by developers) should code them directly
via the alarm Marker provided for.

Currently, however, all such alarms end up being generic, and
their severity level is determined by the logging level at
which they are emitted. This situation is not optimal, as
developer-defined alarms should be capable of the same
finer-grained distinctions (severity and type) as are
permitted by the XML definitions processed on the remote end.

In anticipation of a subsequent patch converting all the
currently predefined alarms into alarms emitted directly
using a marker, this patch extends the internal alarms
API in order to support more fully the definition of
such code-driven alarms.

The main changes introduced by this patch are as follows:

1)  Fuller API for producing an Alarm Marker is provided.
    The main method now takes three parameters: severity,
    type, and key. An alarm marker thus consists of
    a principal marker (ALARM), plus two required
    attribute markers (severity, type) and one optional
    (key, allowing one to determine whether two alarms
    of this type are to be considered identical) whose
    actual values are submarkers of each.

    The creation of markers has now been moved to a static
    AlarmMarkerFactory, and this, plus the basic interfaces
    have been moved to dcache-common for availability
    everywhere.

2)  Extraction of these attributes to create a LogEntry
    has been modified accordingly.

3)  The dcache alarm send command has also been adjusted
    so that -l now denotes Severity level, not logging level.
    All alarms generated by this command are now sent at
    the error level; they are all still without a key,
    meaning each instance is considered to be a different
    alarm. The man page has also been updated.

4)  Because incoming alarms that have already been
    marked as such (and are not in need of being
    matched to a definition) now carry fuller type
    information, the current webadmin alarms page
    also needed modification. The drop-down box
    allowing one to filter the table entries
    currently carries the list of all alarms
    defined in the alarms-definition.xml. This
    has always had the disadvantage of requiring
    a copy of this file to be on the http server
    node as well as the node where the remote
    alarm server is running. But since this
    list no longer represents all the currently
    defined alarms, the usefulness of displaying
    that drop-down list based on that file has
    diminished.

    A compromise has been adopted here: instead
    of trying to display all the possible alarms,
    we have opted to display a list of all types
    which are "known" to the underlying store:
    that is, all types which have thus far been
    sent. One may thus suppose that if a particular
    type of alarm does not appear in the list,
    it has not been received (yet).

    In order to support the extraction of this
    list through the DataNucleus layer, we have
    used a JPA-like (JPQL) query run each time
    a load of the combo-box is called. Since there
    is already an index on the type attribute,
    the query should not cause severe response
    problems.

    We have also adjusted a few minor inconsistencies
    in the logging inside the DataNucleusAlarmStore
    and have eliminated the webadmin-specific
    alarms definition file path, since it is now
    unused on the httpd end.

5)  I have also eliminated the ChecksumAlarm simulator;
    this class was never really used and is in any case
    not necessary.)

Testing:

With RDBMS connector:

Tested production of alarm using dcache alarm send.
Checked the webadmin alarms page for proper loading
of the combo box.

With XML connector:

Same procedure. Works.

RELEASE NOTES

The "-l" option on the dcache alarm send command now takes a Severity level
rather than logging level.

Target: master
Patch: https://rb.dcache.org/r/7127/
Require-book: no
Require-notes: yes
Acked-by: Tigran
network utils: add constant for canonical host name

This patch is an add-on to 7127.  Since a number of alarm keys
need to include the host name in the set of identifiers,
the static initializer has been extended to make this
readily accessible as a static final field.

Target: master
Patch: https://rb.dcache.org/r/7140/
Require-notes: no
Require-book: no
Acked-by: Tigran
alarms: decorate data source to capture connector errors as alarms

This patch converts the alarm definitions which filter
database connection failures by creating a wrapper/decorator
class which logs these as Alarm types, and by substituting
the decorator class for its delegate classes in the
object field types and spring injection files.

It could be argued that a more elegant solution would
have been to do this using aspect (a natural fit), but
my experience with AspectJ is limited (coding examples
written during a workshop class), so I adopted this
approach as the shorter/quicker path.

Target: master
Patch: https://rb.dcache.org/r/7138/
Require-notes: yes
Require-book: no
Acked-by: Dmitry

RELEASE NOTES

Note: this patch ought to be applied together with 7137.
Since it falls under the general category of those
changes, no special notice need be given on the release notes.
src: move VspArgs into dcache-dcap module

Acked-by: Albert Rossi
Target: master
Require-book: no
Require-notes: no
poolmanager: remotve unused variable

Acked-by: Albert Rossi
Target: master
Require-book: no
Require-notes: no