Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add convenient method to add user to Realm #1488

Merged
merged 5 commits into from
Apr 20, 2017
Merged

Add convenient method to add user to Realm #1488

merged 5 commits into from
Apr 20, 2017

Conversation

olamy
Copy link
Member

@olamy olamy commented Apr 20, 2017

fix #1481

olamy added 4 commits April 20, 2017 15:03
Add a new base class UserStore

Signed-off-by: olivier lamy <olamy@webtide.com>
…ation to use

Signed-off-by: olivier lamy <olamy@webtide.com>
Signed-off-by: olivier lamy <olamy@webtide.com>
_propertyUserStore = null;
if (_userStore != null)
_userStore.stop();
_userStore = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to remember whether the _userStore was explicitly set or we autocreated it: only if we autocreated it should we null it out, otherwise a stop/restart of the context won't work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. fixed!

propertyUserStore.setHotReload(hotReload);
propertyUserStore.setConfigPath(_configFile);
propertyUserStore.start();
this._userStore = propertyUserStore;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Teeny quibble: you can get rid of the this., as the underscore on the field name is definitive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha grhh usually checkstyle says "this is mandatory" :-)

Signed-off-by: olivier lamy <olamy@webtide.com>
@janbartel janbartel merged commit 193c427 into jetty:jetty-9.4.x Apr 20, 2017
@olamy olamy deleted the feature/1481 branch April 20, 2017 07:10
@jglick
Copy link
Contributor

jglick commented Sep 26, 2017

81b2a6a forced changes in jenkinsci/jenkins-test-harness#63, which in turn do not work with Jetty 9.2.x; i.e., there is no apparent idiom which works in either version. Was there no way to retain backward compatibility here? Something like

@Deprecated
public void update(String userName, Credential credential, String[] roleArray) {
    if (_userStore == null) {
        _userStore = new UserStore();
    }
    userStore.addUser(userName, credentials, roleArray);
}
@Deprecated
public void remove(String userName) {
    _userStore.removeUser(userName);
}

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add convenient method to add user to Realm
3 participants