<div dir="ltr"><div>Longer term we have started looking at a provisioning system that should (hopefully) handle the problem of making management model changes on upgrade.</div><div><br></div><div>I don&#39;t really understand why you need this functionality anyway, as you will already have to issue management ops to actually add the new subsystem to the server. Whatever is responsible for this could already read the json file and issue the appropriate management operations.<br></div><div><br></div>Stuart<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 4, 2016 at 9:22 PM, Stan Silvert <span dir="ltr">&lt;<a href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span class="">
    <div>On 8/3/2016 3:58 PM, James Perkins
      wrote:<br>
    </div>
    <blockquote type="cite">
      <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">&lt;<a href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>&gt;</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&lt;ModelNode&gt; list) throws XMLStreamException<br>
            </blockquote>
            <div><br>
            </div>
            <div>Reading an external resource from the subsystem parsing
              doesn&#39;t feel right to me. Is the goal to move away from
              the keycloak-server.json to using the management model?</div>
          </div>
        </div>
      </div>
    </blockquote></span>
    Yes, that&#39;s the goal.  I&#39;d like it to happen automatically when the
    server is upgraded to a new version of the Keycloak subsystem.  So
    we need to read keyclaok-server.json and write to
    standalone.xml/domain.xml.<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <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>
      </div>
    </blockquote></span>
    That&#39;s exactly what I am trying to accomplish.  I can create the
    subsystem model easily.  But a write to standalone.xml doesn&#39;t
    happen during server startup.<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <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>
      </div>
    </blockquote></span>
    This could be done without harm as long as it is managed properly. 
    <br>
    <br>
    If there is no way to do it then I&#39;ll have to make it a separate
    operation that the administrator has to run using offline CLI. 
    That&#39;s far from ideal as I would rather it happen automatically as
    part of the upgrade.<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <br>
              Stan<br>
              ______________________________<wbr>_________________<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/<wbr>mailman/listinfo/wildfly-dev</a><br>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div 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>
    </blockquote>
    <br>
  </span></div>

<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/wildfly-dev</a><br></blockquote></div><br></div>