<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Balz<br>
    <br>
    I have refactored now the security library and updated Yanel to use
    the most recent version.<br>
    <br>
    One can now configure the group implementation by seeting inside the
    realm configuration for example:<br>
    <br>
      <ac-identities
    class="org.wyona.security.impl.IdentityManagerFactoryImpl"
    xmlns:yarep=<a class="moz-txt-link-rfc2396E" href="http://www.wyona.org/yarep/1.0.0">"http://www.wyona.org/yarep/1.0.0"</a>><br>
       
<yarep:repository-config>config/ac-identities-repository.xml</yarep:repository-config><br>
        <yarep:group-implementation
    class="org.wyona.security.impl.yarep.YarepGroupImplV2"/><br>
      </ac-identities><br>
    <br>
    instead <br>
    <br>
<ac-identities>config/ac-identities-repository.xml</ac-identities><br>
    <br>
    which of course still works<br>
    <br>
    (see for example src/realms/from-scratch-realm-template/realm.xml)<br>
    <br>
    The group implementation<br>
    <br>
    org.wyona.security.impl.yarep.YarepGroupImplV2<br>
    <br>
    is just not finished yet, but you should be able to get an idea from
    it and help you get started with your own<br>
    implementation if necessary.<br>
    <br>
    Please let me know if you have any questions.<br>
    <br>
    Thanks<br>
    <br>
    Michael<br>
    <br>
    Am 27.04.12 09:36, schrieb basZero:
    <blockquote
cite="mid:CAOXzDSG14frykPZ6A_5kBTO_7+ZsxVEVHif-VNQi+Gyoa+4xQg@mail.gmail.com"
      type="cite">
      <div class="gmail_extra">Hi Michael,</div>
      <div class="gmail_extra"><br>
      </div>
      <div class="gmail_extra">sounds like a plan.</div>
      <div class="gmail_extra">First I will try to find a very simple
        workaround (e.g. by not storing the member ids anymore in the
        group XML), as I think that most functionality is not needing
        that, am I wrong? I think it is enough just to have the group
        definitions in group XML and have the group assignments in the
        user XML only. </div>
      <div class="gmail_extra"><br>
      </div>
      <div class="gmail_extra">But to be clear: the above description is
        not the final solution :)</div>
      <div class="gmail_extra"><br>
      </div>
      <div class="gmail_extra">Yes we can work together on this.</div>
      <div class="gmail_extra"><br>
      </div>
      <div class="gmail_extra">Please also have a look at the pending
        pull requests which I posted 5 months ago, would be cool to have
        them finally in so that I can remove all custom Yanel classes
        again...</div>
      <div class="gmail_extra"><br>
      </div>
      <div class="gmail_extra">Cheers</div>
      <div class="gmail_extra">Balz<br>
        <br>
        <div title="signature"> </div>
        <div class="gmail_quote">On Fri, Apr 27, 2012 at 9:25 AM,
          Michael Wechner <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:michael.wechner@wyona.com" target="_blank">michael.wechner@wyona.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Hi Balz<br>
              <br>
              Am 26.04.12 17:32, schrieb basZero:
              <div>
                <div class="h5">
                  <blockquote type="cite">Hi,
                    <div><br>
                    </div>
                    <div>I have noticed very poor performance (over 5
                      seconds) when using</div>
                    <div>group = YarepGroupManager.getGroup(groupid)</div>
                    <div><br>
                    </div>
                    <div>and above all </div>
                    <div>group.addMember(userObject) (this call is very
                      slow!)</div>
                    <div><br>
                    </div>
                    <div>when having thousands of users.</div>
                    <div><br>
                    </div>
                    <div>1) YarepGroupManager.getGroup(groupid)</div>
                    <div><br>
                    </div>
                    <div>When looking at the code of getGroup(), it
                      loops over ALL users and</div>
                    <div>verifies whether the user really exists and
                      only adds it when it exists.</div>
                    <div><br>
                    </div>
                    <div>From a performane point of view, I don't want
                      the Yanel to verify the existance of 10'000 XMLs.</div>
                    <div>Is there a way to speed this up? I would prefer
                      the usage of JAXB (just converting XML to Java or
                      the other way round). Then, if you really need
                      verification of some items, you can loop over all
                      items and do your logic.</div>
                    <div><br>
                    </div>
                    <div>2) group.addMember(userObject)</div>
                    <div>on my local laptop, this method took 5 seconds
                      alone with 1000 users.</div>
                    <div><br>
                    </div>
                    <div>the code mainly does:</div>
                    <div>- first add the group to the user XML (which
                      should be quick, did not measure it yet)</div>
                    <div>- secondly the user id gets added to the group
                      XML: here also createConfiguration() gets called
                      which loops over all items, I think this is just
                      too slow when not using a marshalling engine like
                      JAXB.</div>
                    <div><br>
                    </div>
                    <div>What is your experience?</div>
                  </blockquote>
                  <br>
                </div>
              </div>
              I have the same experience, whereas it depends on how you
              use these classes. Also these were not built<br>
              for performance, but for functionality. Whereas this shall
              be no excuse, but just an explanation.<br>
              <br>
              I completely agree that we need to improve this with the
              intention that these implementations should scale<br>
              for millions of users and groups.<br>
              <blockquote type="cite">
                <div> What can I do?</div>
              </blockquote>
              <br>
              Do your own implementation of the group manager and
              configure it inside your realm.xml configuration, e.g.<br>
              <br>
              <ac-identities
              class="com.zwischengas.wyona.security.impl.IdentityManagerFactoryImpl"
              xmlns:zg=<a moz-do-not-send="true"
                href="http://www.zwischengas.com/wyona/security1.0.0"
                target="_blank">"http://www.zwischengas.com/wyona/security1.0.0"</a>><br>
              ...<br>
              <br>
              whereas in order to save time you might want to derive all
              the classes from Yarep which work and just overwrite<br>
              the implementations which don't scale well.<br>
              <br>
              Even better, you create a "pull branch" such that you and
              I can work together and I will be happy to help you on
              this,<br>
              because I also need such an implementation shortly.<br>
              <br>
              We could call it org/wyona/security/impl/yarep2<br>
              <br>
              or whatever<br>
              <br>
              WDYT?<br>
              <br>
              Thanks<br>
              <br>
              Michael<br>
              <blockquote type="cite">
                <div><br>
                </div>
                <div>Cheers</div>
                <div> Balz</div>
                <div title="signature"> </div>
                <br>
                <fieldset></fieldset>
                <br>
              </blockquote>
              <br>
            </div>
            <br>
            --<br>
            Yanel-development mailing list <a moz-do-not-send="true"
              href="mailto:Yanel-development@wyona.com">Yanel-development@wyona.com</a><br>
            <a moz-do-not-send="true"
              href="http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development"
              target="_blank">http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>