<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 8/4/2016 8:22 PM, Stuart Douglas
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAAoo=c7rhPWJ3GHmthLrh2JqQVDahbKPzkVJAjvna-ATPQ2xWw@mail.gmail.com"
      type="cite">
      <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'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>
    </blockquote>
    The subsystem already exists, but we are adding lots of attributes
    and resources to it.  I can add the management operations at parse
    time, but the new attributes and resources will not be persisted to
    standalone.xml. <br>
    <blockquote
cite="mid:CAAoo=c7rhPWJ3GHmthLrh2JqQVDahbKPzkVJAjvna-ATPQ2xWw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <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 moz-do-not-send="true"
              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
                            moz-do-not-send="true"
                            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'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's the goal.  I'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's exactly what I am trying to accomplish.  I
              can create the subsystem model easily.  But a write to
              standalone.xml doesn'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'll have to make it a
              separate operation that the administrator has to run using
              offline CLI.  That'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 moz-do-not-send="true"
                            href="mailto:wildfly-dev@lists.jboss.org"
                            target="_blank">wildfly-dev@lists.jboss.org</a><br>
                          <a moz-do-not-send="true"
                            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 moz-do-not-send="true"
              href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
            <a moz-do-not-send="true"
              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>
    </blockquote>
    <br>
  </body>
</html>