class ZMSImpl implements Authorizer, KeyStore, ZMSHandler {

    public Template getTemplate(ResourceContext ctx, String templateName) {

        final String caller = ctx.getApiName();

        logPrincipal(ctx);

        validateRequest(ctx.request(), caller);
        validate(templateName, TYPE_SIMPLE_NAME, caller);

        // for consistent handling of all requests, we're going to convert
        // all incoming object values into lower case (e.g. domain, role,
        // policy, service, etc name)

        templateName = templateName.toLowerCase();
        Template template = serverSolutionTemplates.get(templateName);
        if (template == null) {
            throw ZMSUtils.notFoundError("getTemplate: Template not found: '" + templateName + "'", caller);
        }

        List<Role> roles = template.getRoles();
        if (roles != null && !roles.isEmpty()) {
            for (Role role : roles) {
                List<RoleMember> roleMembers = role.getRoleMembers();
                if (roleMembers != null) {
                    role.setMembers(ZMSUtils.convertRoleMembersToMembers(roleMembers));
                }
            }
        }

        return template;
    }

    public  ZMSImpl();

}