class UserOptionsService {

    public void persistOptionChange(Map<UserOptions, String> optsMap) {
        SaveOptionsAction action = new SaveOptionsAction(optsMap);

        dispatcher.execute(action, new AsyncCallback<SaveOptionsResult>() {
            @Override
            public void onFailure(Throwable caught) {
                eventBus.fireEvent(new NotificationEvent(
                        NotificationEvent.Severity.Warning,
                        "Could not save user options"));
            }

            @Override
            public void onSuccess(SaveOptionsResult result) {
                eventBus.fireEvent(new NotificationEvent(
                        NotificationEvent.Severity.Warning,
                        messages.savedOptions()));
            }
        });
    }

    @Inject public  UserOptionsService(WebTransMessages messages, EventBus eventBus,
            CachingDispatchAsync dispatcher, UserConfigHolder configHolder);

}