Add an authentication filter to check if the user is an admin.
Currently there are only two roles: admin and user. Admin has the permission to some special REST APIs, for example. shutdown.
An HTTP request may contain a basic authentication header with the username and password provided. Any user that is not recognized as an admin will be treated as an ordinary user.
Get the admin password from catalog.
Catalog has it if the password is specified in the deployment.cfg.
Use RolesAllowed.
Also add an API to get the path to the deployment file, restricted to admin only. This is reserved for the watchdog.
Change the shutdown test to check the password.
Return 401 when the user says it's admin with an incorrect password.
Change test to test it.
MasterResource: return a message on successful shutdown

Fix #636
MasterDaemonTest: fix for change to shutdown response content
fixes
remove unused sc
refactor authentication
change enum values of FTMODE and ROLE to uppercase
merge from master
fix tests
remove unnecessary valueOf()
change QueryStatusEncoding.ftMode to enum
To initiate basic auth, the server should respond with a 401 Not Authorized, not a 403 Forbidden (see https://en.wikipedia.org/wiki/Basic_access_authentication)
upgrade jersey to 2.13, change corresponding APIs, classes, etc
simpler way to register singleton instances.
Merge pull request #652 from uwescience/jwang_upgradeJersey

upgrade jersey to 2.13, change corresponding APIs, classes, etc
Merge from master, using Jersey 2 to implement resource access authentication.

Use @NameBinding to bind the admin auth filter only to certain
resources.

If we have a request accessing a resource that requires admin:
Empty auth: UNAUTHORIZED
Non-admin user:
 Wrong password: UNAUTHORIZED (but we don't have this case for now, non-admin users don't need to provide password)
 Correct password: FORBIDDEN (currently always the case for non-admin users)
Admin user:
 Wrong password: UNAUTHORIZED
 Correct password: Pass