You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Davide Giannella (JIRA)" <ji...@apache.org> on 2016/11/14 11:35:01 UTC

[jira] [Closed] (OAK-4849) Refactor the MigrationCliArguments from implicit to explicit

     [ https://issues.apache.org/jira/browse/OAK-4849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davide Giannella closed OAK-4849.
---------------------------------

Bulk close for 1.5.13

> Refactor the MigrationCliArguments from implicit to explicit
> ------------------------------------------------------------
>
>                 Key: OAK-4849
>                 URL: https://issues.apache.org/jira/browse/OAK-4849
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: upgrade
>            Reporter: Tomek Rękawek
>             Fix For: 1.6, 1.5.13
>
>
> The MigrationCliArguments class creates a deep structure of helper classes in its constructor. As a result simply creating the MigrationCliArguments leads to repository creation (sic!), as one of the nested classes needs to do this in order to check if the repository uses embedded nodestore.
> All of this automatic object creations should be replaced with explicit actions, like:
> {code}
> OptionSet parsed = OptionParserFactory.create().parse(args);
> MigrationCliArguments cliArgs = new MigrationCliArguments(parsed);
> MigrationOptions options = new MigrationOptions(cliArguments);
> options.logOptions(); // optionally log the diagnostic info
> StoreArguments stores = new StoreArguments(options, cliArgs.getArguments());
> stores.logOptions(); // optionally log the diagnostic info
> // following method initializes (and closes) a repository in order to find out whether
> // an embedded store is being used
> boolean isSrcEmbedded = stores.srcUsesEmbeddedDatastore();
> DatastoreArguments datastores = new DatastoreArguments(options, stores, isSrcEmbedded);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)