public static long getSessionIdFromRequest(HttpRequest request) {
        BindingMatch<?> bm = Utils.getBindingMatch(request, "http://*/application/v2/tenant/*/prepareandactivate/*");
        try {
            return Long.parseLong(bm.group(3));
        }
        catch (NumberFormatException e) {
            throw new BadRequestException("Session id '" + bm.group(3) + "' is not a number: " + e.getMessage());
        }
    }
* The implementation of the /application/v2 API.


@author hmusum
configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationApiHandler.java