<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 3, 2016 at 6:53 AM, Stan Silvert <span dir="ltr"><<a href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Keycloak server is currently configured via a keycloak-server.json<br>
file. We are converting this to configuration through<br>
standalone.xml/domain.xml.<br>
<br>
To automatically upgrade, I need to read keycloak-server.json and write<br>
back to standalone.xml. I can easily add the operations to do this at<br>
parse time. The parser has this method:<br>
<br>
@Override<br>
public void readElement(final XMLExtendedStreamReader reader, final<br>
List<ModelNode> list) throws XMLStreamException<br></blockquote><div><br></div><div>Reading an external resource from the subsystem parsing doesn't feel right to me. Is the goal to move away from the keycloak-server.json to using the management model?</div><div><br></div><div>If that is the goal then a better solution might be to have some sort of migration operation that would read the file and create the subsystem model. Then after that the keycloak-server.json is ignored and the *.xml file will be used.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So one way to do this is to parse keycloak-server.json at this time and<br>
add operations to the list.<br>
<br>
That puts everything into the management model. But nothing will be<br>
written to standalone.xml unless someone manually does a write operation<br>
from CLI.<br></blockquote><div><br></div><div>A write will be triggered if you make a change to the management model.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So my question is, what is the best way to accomplish this? Is there a<br>
good, safe way to manually trigger a flush to standalone.xml at this<br>
point or at some later point during startup?<br></blockquote><div><br></div><div>Not really an answer, but I hope there is not a way to trigger a write :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Stan<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">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><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>James R. Perkins</div><div>JBoss by Red Hat</div></div></div></div></div>
</div></div>