On 7/24/2014 1:42 PM, Marek Posolda wrote:
Right now what I am doing for export/import is creating session just
for
retrieving ExportProvider or ImportProvider and then particular
ExportProvider or ImportProvider is starting it's own
session/transaction lifecycles whenever it needs them -
https://github.com/keycloak/keycloak/blob/master/export-import/export-imp...
. It's kind of a hack IMO...
KeycloakSessionFactory now has:
<T extends Provider> ProviderFactory<T> getProviderFactory(Class<T>
clazz);
<T extends Provider> ProviderFactory<T> getProviderFactory(Class<T>
clazz, String id);
So you could use them instead of creating a session. Maybe there
should be a separate FactoryFinder interface? If you want to pull those
methods into a FactoryFinder interface I guess that could be done.
Honestly, I don't understand why we need all these component layers for
export/import. Seems a bit over-engineered in that regards, IMO, and
now you want to add even more component layers to manage something that
should be pretty straightforward.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com