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

[WFLY-3978] - PicketLink EAP 6.4 Issues #6951

Merged
merged 3 commits into from
Nov 21, 2014
Merged

Conversation

pedroigor
Copy link
Contributor

Improving usability, removing unnecessary services and reload state.

@wildfly-ci
Copy link

Linux with security manager Build 460 is now running using a merge of 56646ec

@wildfly-ci
Copy link

Windows Build 574 is now running using a merge of 56646ec

@wildfly-ci
Copy link

Linux Build 5471 is now running using a merge of 56646ec

@wildfly-ci
Copy link

Linux with security manager Build 460 outcome was SUCCESS using a merge of 56646ec
Summary: Tests passed: 798, ignored: 245 Build time: 0:06:29

@wildfly-ci
Copy link

Windows Build 574 outcome was SUCCESS using a merge of 56646ec
Summary: Tests passed: 3001, ignored: 238, muted: 1 Build time: 0:51:05

@wildfly-ci
Copy link

Linux Build 5471 outcome was SUCCESS using a merge of 56646ec
Summary: Tests passed: 3002, ignored: 238 Build time: 0:52:59


@Override
protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Object handback) throws OperationFailedException {

Copy link
Contributor

Choose a reason for hiding this comment

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

Should you not unset the configuration here or reset it to the configuration resulting from the current model (following rollback, i.e. the same as before the operation failed)?

@kabir kabir added the fixme label Nov 19, 2014
@kabir
Copy link
Contributor

kabir commented Nov 19, 2014

My comments regarding rollback and why this is now necessary, is that in most cases before these were installed by services. The service verification handlers would have taken care of uninstalling the services, and so undoing the config changes, on rollback. Now that needs to happen manually.

@wildfly-ci
Copy link

Windows Build 619 is now running using a merge of c4db92f

@wildfly-ci
Copy link

Linux Build 5510 is now running using a merge of c4db92f

@wildfly-ci
Copy link

Linux with security manager Build 497 is now running using a merge of c4db92f

@wildfly-ci
Copy link

Linux with security manager Build 497 outcome was SUCCESS using a merge of c4db92f
Summary: Tests passed: 798, ignored: 245 Build time: 0:07:00

@pedroigor
Copy link
Contributor Author

I've updated the handlers and resources with the rollback/revert code.

@wildfly-ci
Copy link

Windows Build 619 outcome was SUCCESS using a merge of 858f955
Summary: Tests passed: 3007, ignored: 241 Build time: 0:51:38

@wildfly-ci
Copy link

Linux Build 5510 outcome was SUCCESS using a merge of 858f955
Summary: Tests passed: 3007, ignored: 241 Build time: 0:53:29

@wildfly-ci
Copy link

Linux Build 5511 is now running using a merge of 858f955

@wildfly-ci
Copy link

Windows Build 620 is now running using a merge of 858f955

@wildfly-ci
Copy link

Linux with security manager Build 498 is now running using a merge of 858f955

@wildfly-ci
Copy link

Linux with security manager Build 498 outcome was SUCCESS using a merge of 858f955
Summary: Tests passed: 798, ignored: 245 Build time: 0:06:22

@wildfly-ci
Copy link

Windows Build 620 outcome was SUCCESS using a merge of 858f955
Summary: Tests passed: 3007, ignored: 241 Build time: 0:51:27

@wildfly-ci
Copy link

Linux Build 5511 outcome was SUCCESS using a merge of 858f955
Summary: Tests passed: 3007, ignored: 241 Build time: 0:54:05

protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Object handback) throws OperationFailedException {
ModelNode restored = context.readResource(PathAddress.EMPTY_ADDRESS).getModel().clone();

restored.get(attributeName).set(valueToRestore);
Copy link
Contributor

Choose a reason for hiding this comment

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

updateConfiguration seems to use the operation's address for the alias, which is contained by the write-attribute operation used in applyUpdateToRuntime(). Here you are passing in a 'restored' which has no address field so it seems the functionality will be different?

}

private void updateConfiguration(OperationContext context, ModelNode operation) throws OperationFailedException {
PathAddress pathAddress = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick, when reading the operation address the standard constant to use is OP_ADDR.

@kabir
Copy link
Contributor

kabir commented Nov 20, 2014

I might have missed it but I don't see the add handlers handling the rollback case:
HandlerAddHandler
HandlerParameterAddHandler
IdentityProviderAddHandler
KeyStoreProviderAddHandler
ServiceProviderAddHandler

@kabir
Copy link
Contributor

kabir commented Nov 20, 2014

For the add handler case, and what you have correctly done for the remove handler case the 'model' parameter passed in to rollbackRuntime()/recoverServices() is the original model before any changes were made. So the remove handlers look ok, and the add handler rollback can use the same mechanism.


if (serviceController != null) {
IdentityProviderService service = serviceController.getValue();
ModelNode identityProviderNode = context.readResource(EMPTY_ADDRESS, false).getModel();
Copy link
Contributor

Choose a reason for hiding this comment

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

In the rollback case I don't think this is the actual rolled back model. Normally for a write attribute handler we only deal with the one attribute and use the value passed in, but since you seem to be using a few other attributes from the model, I don't think that will work when doing a rollback. So something like:

   final ModelNode identityProviderNode;
   if (!rollback) {
          identityProviderNode = context.readResource(EMPTY_ADDRESS, false).getModel();
   } else {
          Resource rc = ctx.getOriginalRootResource().navigate(pathAddress);
          identityProviderNode = rc.getModel();
   }

@wildfly-ci
Copy link

Linux with security manager Build 503 is now running using a merge of 2c1ad0b

@wildfly-ci
Copy link

Linux Build 5516 is now running using a merge of 2c1ad0b

@wildfly-ci
Copy link

Windows Build 625 is now running using a merge of 2c1ad0b

@wildfly-ci
Copy link

Linux with security manager Build 503 outcome was SUCCESS using a merge of 2c1ad0b
Summary: Tests passed: 798, ignored: 245 Build time: 0:07:02

PathAddress pathAddress = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR));
ModelNode restored = context.readResource(PathAddress.EMPTY_ADDRESS).getModel().clone();

restored.get(attributeName).set(valueToRestore);
Copy link
Contributor

Choose a reason for hiding this comment

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

restored is no longer used

@wildfly-ci
Copy link

Windows Build 625 outcome was SUCCESS using a merge of dfb3bd6
Summary: Tests passed: 3007, ignored: 241 Build time: 0:51:15

@wildfly-ci
Copy link

Linux Build 5516 outcome was SUCCESS using a merge of dfb3bd6
Summary: Tests passed: 3006, ignored: 241, muted: 1 Build time: 0:53:34

@wildfly-ci
Copy link

Linux with security manager Build 505 is now running using a merge of dfb3bd6

@wildfly-ci
Copy link

Windows Build 627 is now running using a merge of dfb3bd6

@wildfly-ci
Copy link

Linux Build 5518 is now running using a merge of dfb3bd6

@wildfly-ci
Copy link

Linux with security manager Build 505 outcome was SUCCESS using a merge of dfb3bd6
Summary: Tests passed: 798, ignored: 245 Build time: 0:06:42

@wildfly-ci
Copy link

Windows Build 627 outcome was SUCCESS using a merge of dfb3bd6
Summary: Tests passed: 3007, ignored: 241 Build time: 0:52:20

@wildfly-ci
Copy link

Linux Build 5518 outcome was SUCCESS using a merge of dfb3bd6
Summary: Tests passed: 3007, ignored: 241 Build time: 0:53:28

kabir added a commit that referenced this pull request Nov 21, 2014
[WFLY-3978] - PicketLink EAP 6.4 Issues
@kabir kabir merged commit cf19a6d into wildfly:master Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants