public static ClientType clientTypeOf(String role) {
        if (role == null) {
            return ClientType.GUEST;
        }

        try {
            return ClientType.valueOf(role);
        } catch (IllegalArgumentException ex) {
            return ClientType.GUEST;
        }
    }