class CoreTokenResource implements CollectionResourceProvider {

    public Promise<ResourceResponse, ResourceException> updateInstance(Context serverContext, String tokenId,
            UpdateRequest updateRequest) {
        String principal = PrincipalRestUtils.getPrincipalNameFromServerContext(serverContext);

        String value = updateRequest.getContent().toString();
        Token newToken = serialisation.deserialise(value, Token.class);

        try {
            store.updateAsync(newToken);

            ResourceResponse resource = newResourceResponse(
                    newToken.getTokenId(),
                    String.valueOf(currentTimeMillis()),
                    new JsonValue("Token Updated"));

            debug("UPDATE by {0}: Updated token resource with ID: {1}", principal, tokenId);
            return newResultPromise(resource);
        } catch (CoreTokenException e) {
            error(e, "UPDATE by {0}: Error updating token resource with ID: {1}", principal, tokenId);
            return generateException(e).asPromise();
        }
    }

    public  CoreTokenResource(JSONSerialisation serialisation, CTSPersistentStore store, Debug debug);

}