class SubjectTypesResource implements CollectionResourceProvider {

    @Override
    public Promise<ResourceResponse, ResourceException> readInstance(Context context, String resourceId,
            ReadRequest request) {

        final Class<? extends EntitlementSubject> subjectClass = entitlementRegistry.getSubjectType(resourceId);

        final String principalName = PrincipalRestUtils.getPrincipalNameFromServerContext(context);

        if (subjectClass == null) {
            if (debug.errorEnabled()) {
                debug.error("SubjectTypesResource :: READ by " + principalName +
                        "Requested subject short name not found: " + resourceId);
            }
            return new NotFoundException().asPromise();
        }

        final JsonValue json = jsonify(subjectClass, resourceId,
                LogicalSubject.class.isAssignableFrom(subjectClass));

        final ResourceResponse resource = newResourceResponse(resourceId,
                String.valueOf(System.currentTimeMillis()), json);

        return newResultPromise(resource);
    }

    @Inject public  SubjectTypesResource(@Named("frRest") Debug debug, EntitlementRegistry entitlementRegistry);

}