<div dir="ltr">I have a PR that builds on Brian&#39;s work for the web migrate op: <a href="https://github.com/wildfly/wildfly/pull/7931">https://github.com/wildfly/wildfly/pull/7931</a><div><br></div><div>Output is:</div><div><br></div><div>Standard EAP config (no warnings or errors):</div><div><br></div><div><div>[standalone@localhost:9999 /] /subsystem=web:migrate</div><div>{</div><div>    &quot;outcome&quot; =&gt; &quot;success&quot;,</div><div>    &quot;result&quot; =&gt; {&quot;migration-warnings&quot; =&gt; []}</div><div>}</div></div><div><br></div><div>Success with a warning (in this case due to an invalid protocol attribute on a connector):</div><div><br></div><div><div>[standalone@localhost:9999 /] /subsystem=web:migrate</div><div>{</div><div>    &quot;outcome&quot; =&gt; &quot;success&quot;,</div><div>    &quot;result&quot; =&gt; {&quot;migration-warnings&quot; =&gt; [&quot;WFLYWEB0002: Could not migrate resource {</div><div>    \&quot;protocol\&quot; =&gt; \&quot;INVALID\&quot;,</div><div>    \&quot;scheme\&quot; =&gt; \&quot;http\&quot;,</div><div>    \&quot;socket-binding\&quot; =&gt; \&quot;ajp\&quot;,</div><div>    \&quot;enable-lookups\&quot; =&gt; undefined,</div><div>    \&quot;proxy-binding\&quot; =&gt; undefined,</div><div>    \&quot;proxy-name\&quot; =&gt; undefined,</div><div>    \&quot;proxy-port\&quot; =&gt; undefined,</div><div>    \&quot;redirect-binding\&quot; =&gt; undefined,</div><div>    \&quot;redirect-port\&quot; =&gt; undefined,</div><div>    \&quot;secure\&quot; =&gt; undefined,</div><div>    \&quot;max-post-size\&quot; =&gt; undefined,</div><div>    \&quot;max-save-post-size\&quot; =&gt; undefined,</div><div>    \&quot;enabled\&quot; =&gt; undefined,</div><div>    \&quot;executor\&quot; =&gt; undefined,</div><div>    \&quot;max-connections\&quot; =&gt; undefined,</div><div>    \&quot;virtual-server\&quot; =&gt; undefined,</div><div>    \&quot;name\&quot; =&gt; \&quot;ajp\&quot;,</div><div>    \&quot;operation\&quot; =&gt; \&quot;add\&quot;,</div><div>    \&quot;address\&quot; =&gt; [</div><div>        (\&quot;subsystem\&quot; =&gt; \&quot;web\&quot;),</div><div>        (\&quot;connector\&quot; =&gt; \&quot;ajp\&quot;)</div><div>    ]</div><div>}&quot;]}</div><div>}</div></div><div><br></div><div>Failed OP:</div><div><div><br></div><div>[standalone@localhost:9999 /] /subsystem=web:migrate</div><div>{</div><div>    &quot;outcome&quot; =&gt; &quot;failed&quot;,</div><div>    &quot;result&quot; =&gt; {</div><div>        &quot;migration-warnings&quot; =&gt; [],</div><div>        &quot;migration-error&quot; =&gt; {</div><div>            &quot;operation&quot; =&gt; {</div><div>                &quot;operation&quot; =&gt; &quot;add&quot;,</div><div>                &quot;address&quot; =&gt; [</div><div>                    (&quot;subsystem&quot; =&gt; &quot;undertow&quot;),</div><div>                    (&quot;server&quot; =&gt; &quot;default-server&quot;),</div><div>                    (&quot;ajp-listener&quot; =&gt; &quot;ajp&quot;)</div><div>                ],</div><div>                &quot;socket-binding&quot; =&gt; &quot;ajp&quot;,</div><div>                &quot;secure&quot; =&gt; undefined,</div><div>                &quot;redirect-socket&quot; =&gt; undefined,</div><div>                &quot;enabled&quot; =&gt; undefined,</div><div>                &quot;resolve-peer-address&quot; =&gt; undefined,</div><div>                &quot;max-post-size&quot; =&gt; undefined,</div><div>                &quot;max-connections&quot; =&gt; &quot;sadfadsfasdgasdfg&quot;,</div><div>                &quot;operation-headers&quot; =&gt; {</div><div>                    &quot;caller-type&quot; =&gt; &quot;user&quot;,</div><div>                    &quot;access-mechanism&quot; =&gt; &quot;NATIVE&quot;</div><div>                },</div><div>                &quot;worker&quot; =&gt; undefined,</div><div>                &quot;buffer-pool&quot; =&gt; undefined,</div><div>                &quot;disallowed-methods&quot; =&gt; undefined,</div><div>                &quot;max-header-size&quot; =&gt; undefined,</div><div>                &quot;buffer-pipelined-data&quot; =&gt; undefined,</div><div>                &quot;max-parameters&quot; =&gt; undefined,</div><div>                &quot;max-headers&quot; =&gt; undefined,</div><div>                &quot;max-cookies&quot; =&gt; undefined,</div><div>                &quot;allow-encoded-slash&quot; =&gt; undefined,</div><div>                &quot;decode-url&quot; =&gt; undefined,</div><div>                &quot;url-charset&quot; =&gt; undefined,</div><div>                &quot;always-set-keep-alive&quot; =&gt; undefined,</div><div>                &quot;max-buffered-request-size&quot; =&gt; undefined,</div><div>                &quot;record-request-start-time&quot; =&gt; undefined,</div><div>                &quot;allow-equals-in-cookie-value&quot; =&gt; undefined,</div><div>                &quot;no-request-timeout&quot; =&gt; undefined,</div><div>                &quot;request-parse-timeout&quot; =&gt; undefined,</div><div>                &quot;tcp-backlog&quot; =&gt; undefined,</div><div>                &quot;receive-buffer&quot; =&gt; undefined,</div><div>                &quot;send-buffer&quot; =&gt; undefined,</div><div>                &quot;tcp-keep-alive&quot; =&gt; undefined,</div><div>                &quot;read-timeout&quot; =&gt; undefined,</div><div>                &quot;write-timeout&quot; =&gt; undefined</div><div>            },</div><div>            &quot;result&quot; =&gt; {</div><div>                &quot;outcome&quot; =&gt; &quot;failed&quot;,</div><div>                &quot;failure-description&quot; =&gt; &quot;WFLYCTL0097: Wrong type for max-connections. Expected [INT] but was STRING&quot;,</div><div>                &quot;rolled-back&quot; =&gt; true</div><div>            }</div><div>        }</div><div>    },</div><div>    &quot;rolled-back&quot; =&gt; true</div><div>}</div></div><div><br></div><div>Stuart</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 14 Aug 2015 at 11:03 Brian Stansberry &lt;<a href="mailto:brian.stansberry@redhat.com">brian.stansberry@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 8/13/15 10:03 AM, Brian Stansberry wrote:<br>
&gt; On 8/13/15 3:11 AM, Stuart Douglas wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Thu, 13 Aug 2015 at 16:27 Ladislav Thon &lt;<a href="mailto:lthon@redhat.com" target="_blank">lthon@redhat.com</a><br>
&gt;&gt; &lt;mailto:<a href="mailto:lthon@redhat.com" target="_blank">lthon@redhat.com</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;       &gt; The approach I took was to add the warnings to the describe-migration<br>
&gt;&gt;       &gt; op, and when running the migrate op make the describe-migration<br>
&gt;&gt;       &gt; operation the first step in the composite, so the output looks like<br>
&gt;&gt;       &gt; this: <a href="http://pastebin.com/B01KNAHX" rel="noreferrer" target="_blank">http://pastebin.com/B01KNAHX</a><br>
&gt;&gt;<br>
&gt;&gt;      The fact that it&#39;s a composite operation makes the output a bit cryptic<br>
&gt;&gt;      (step-X?), but otherwise I think it&#39;s actually good.<br>
&gt;&gt;<br>
&gt;&gt;      I guess that only handling the warnings in :describe-migration makes the<br>
&gt;&gt;      implementation easier (not sure?) and printing :describe-migration as a<br>
&gt;&gt;      part of :migrate makes sense too, precisely because it shows the steps<br>
&gt;&gt;      that are performed.<br>
&gt;&gt;<br>
&gt;&gt;      So my only objection would be those cryptic &quot;step-X&quot; names, but I guess<br>
&gt;&gt;      that we can live with that (if all :migrate operations took the same<br>
&gt;&gt;      approach; inconsistency wouldn&#39;t really help here).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; That is because this is implemented as a composite operation, AFAIK<br>
&gt;&gt; there is lots of special handing for composite ops, so I don&#39;t think we<br>
&gt;&gt; want to be implementing our own one with different output just for this<br>
&gt;&gt; case.<br>
&gt;&gt;<br>
&gt;&gt; I could be wrong though, this is not really my area, Brian will know more.<br>
&gt;&gt;<br>
&gt;<br>
&gt; In the success case, I don&#39;t see the point of outputting &quot;step-2&quot; =&gt;<br>
&gt; {&quot;outcome&quot; =&gt; &quot;success&quot;}, &quot;step-3&quot; =&gt; {&quot;outcome&quot; =&gt; &quot;success&quot;}, etc.<br>
&gt;<br>
&gt; In the failure case though, having an intelligible failure-description<br>
&gt; is important. And the composite op handler may be getting in your way there<br>
&gt;<br>
&gt; Instead of writing more text, I&#39;ll write some code to illustrate some<br>
&gt; thoughts and post back later.<br>
&gt;<br>
<br>
Here&#39;s what I was thinking.<br>
<br>
[1] is a change to break out the step registration stuff<br>
CompositeOperationHandler does into a utility method, with a couple<br>
other variants added that are better suited for use by other OSHs.<br>
<br>
Basically, it lets you pass in a Map of ops and a holder map of response<br>
nodes, and it will add the steps and populate the response node map.<br>
(You can optionally pre-populate the response node map. There&#39;s also a<br>
variant that uses lists instead of maps in case that&#39;s more convenient.)<br>
<br>
Using that, the response nodes for the added ops don&#39;t have to directly<br>
appear in the overall operation response. Instead the migrate op handler<br>
can hold a ref to them and in its ResultHandler use them to format an<br>
understandable response.<br>
<br>
The top two commits in [2] are an example tweak to the current<br>
WebMigrationOp in master to illustrate use of this.<br>
<br>
[1] <a href="https://github.com/wildfly/wildfly-core/pull/956" rel="noreferrer" target="_blank">https://github.com/wildfly/wildfly-core/pull/956</a><br>
<br>
[2] <a href="https://github.com/bstansberry/wildfly/tree/help-migrate-multistep" rel="noreferrer" target="_blank">https://github.com/bstansberry/wildfly/tree/help-migrate-multistep</a><br>
<br>
&gt;&gt; Stuart<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;      LT<br>
&gt;&gt;      _______________________________________________<br>
&gt;&gt;      wildfly-dev mailing list<br>
&gt;&gt;      <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>&gt;<br>
&gt;&gt;      <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; wildfly-dev mailing list<br>
&gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
--<br>
Brian Stansberry<br>
Senior Principal Software Engineer<br>
JBoss by Red Hat<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
</blockquote></div>