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

implementation of WFLY-2510 #89

Merged
merged 9 commits into from Sep 2, 2014
Merged

implementation of WFLY-2510 #89

merged 9 commits into from Sep 2, 2014

Conversation

claudio4j
Copy link
Contributor

Add CLI command to display information about current connection.

@wildfly-ci
Copy link

Can one of the admins verify this patch?

@ctomc
Copy link
Contributor

ctomc commented Aug 13, 2014

this is ok to test

@wildfly-ci
Copy link

Build 184 is now running using a merge of b60f867

@wildfly-ci
Copy link

Build 184 outcome was SUCCESS using a merge of b60f867
Summary: Tests passed: 2552, ignored: 57 Build time: 0:15:39

@bstansberry
Copy link
Contributor

@darranl @aloubyansky please approve

*
* @author Claudio Miranda
*/
public class ConnectionInfoHandler implements CommandHandler {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to extend CommandHandlerWithHelp and write a simple txt file with the description of the command or implement --help/-h argument otherwise.

@wildfly-ci
Copy link

Build 201 is now running using a merge of 18e143f

@claudio4j
Copy link
Contributor Author

Hi, take a look, thanks.

@wildfly-ci
Copy link

Build 201 outcome was FAILURE using a merge of 18e143f
Summary: Tests passed: 944, ignored: 6; exit code 1 (new) Build time: 0:01:43

Build problems:

Process exited with code 1

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project wildfly-cli: Compilation failure
Step Build & test (Maven) failed

@claudio4j
Copy link
Contributor Author

Ah, had some issues with git merge and commit, sorry.

@wildfly-ci
Copy link

Build 202 is now running using a merge of 8e7181d

@wildfly-ci
Copy link

Build 202 outcome was SUCCESS using a merge of 8e7181d
Summary: Tests passed: 2561, ignored: 57 Build time: 0:15:43

import java.security.cert.X509Certificate;
import java.util.Date;

public class ConnectionInfoBean {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good. I meant to keep the class public but the constructor and the setters could have the default access modifier, so they are not visible outside the package.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, if you don't mind, let's introduce a ConnectionInfo interface (which will expose only the get-methods) and simply add a method to CommandContext, e.g. ConnectionInfo getConnectionInfo(). Thanks!

@claudio4j
Copy link
Contributor Author

Hi, take a look now. Thanks.

@wildfly-ci
Copy link

Build 204 is now running using a merge of 244b7e6


public ConnectionInfo getConnectionInfo() {
return connInfoBean;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this looks better now. The final thing though... :) Sorry, I missed it before. There is a method disconnectController() in this class. This method could be called by a user or if the cli receives a connection closed notification. Anyway, to keep the connection info consistent it has to be reset in this method too.
Thanks a lot!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@wildfly-ci
Copy link

Build 204 outcome was SUCCESS using a merge of 244b7e6
Summary: Tests passed: 2561, ignored: 57 Build time: 0:15:46

@wildfly-ci
Copy link

Build 205 is now running using a merge of abb24a7

@@ -837,6 +843,8 @@ public void connectController(String controller) throws CommandLineException {
do {
try {
CallbackHandler cbh = new AuthenticationCallbackHandler(username, password);
connInfoBean = new ConnectionInfoBean();
connInfoBean.setDisableLocalAuth(disableLocalAuth);
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the connection actually fails? I think in that case you should reset the just initialized connection info in the catches below.

@wildfly-ci
Copy link

Build 205 outcome was SUCCESS using a merge of abb24a7
Summary: Tests passed: 2562, ignored: 57 Build time: 0:15:40

@@ -0,0 +1,56 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat, Inc., and individual contributors
Copy link
Contributor

Choose a reason for hiding this comment

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

It is now 2014 - all new classes should reflect this in the copyright header.

@wildfly-ci
Copy link

Build 227 is now running using a merge of e217c59

@wildfly-ci
Copy link

Build 229 is now running using a merge of d529421

@wildfly-ci
Copy link

Build 227 outcome was SUCCESS using a merge of d529421
Summary: Tests passed: 2541, ignored: 56 Build time: 0:16:04

@wildfly-ci
Copy link

Build 229 outcome was SUCCESS using a merge of d529421
Summary: Tests passed: 2541, ignored: 56 Build time: 0:16:09

@darranl
Copy link
Contributor

darranl commented Aug 20, 2014

Sorry if you wouldn't mind I would suggest instead of authenticated as it may be better to say 'granted role' and 'granted roles'.

@wildfly-ci
Copy link

Build 237 is now running using a merge of c8f7959

@claudio4j
Copy link
Contributor Author

I also added the message when there is no role associated when using rbac

[standalone@localhost:9993 /] connection-info
Username paty, has no role associated.

@wildfly-ci
Copy link

Build 237 outcome was SUCCESS using a merge of c8f7959
Summary: Tests passed: 2541, ignored: 56 Build time: 0:15:31

@claudio4j
Copy link
Contributor Author

Hi @darranl, I think all remaining issues are fixed.

@bstansberry
Copy link
Contributor

@darranl @aloubyansky since there's been a fair bit of back and forth on this one, please give it a final +1 so I know all issues are addressed and can merge it.

@bstansberry
Copy link
Contributor

Claudio, thanks so much!

Before merging, I need to get an answer to a question:

We require that all contributions be made under the terms of the MIT License, http://www.opensource.org/licenses/mit-license.php. Do you agree to the these terms?

@aloubyansky
Copy link
Contributor

Yes and thanks a lot from me!

@claudio4j
Copy link
Contributor Author

On Thu, Aug 28, 2014 at 8:53 AM, Brian Stansberry notifications@github.com
wrote:

We require that all contributions be made under the terms of the MIT
License, http://www.opensource.org/licenses/mit-license.php. Do you agree
to the these terms?

Yes.

Claudio Miranda

claudio@claudius.com.br
http://www.claudius.com.br

bstansberry added a commit that referenced this pull request Sep 2, 2014
implementation of WFLY-2510
@bstansberry bstansberry merged commit 859755d into wildfly:master Sep 2, 2014
@bstansberry
Copy link
Contributor

Thanks!

iweiss pushed a commit to iweiss/wildfly-core that referenced this pull request Jun 6, 2016
[JBEAP-2490][WFCORE-1240] Call the non-deprecated variant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants