- if (publishLocalRepo) {
- Hashtable<String, Object> properties = new Hashtable<>();
- // properties.put(LEGACY_JCR_REPOSITORY_ALIAS, name);
- properties.put(NodeConstants.CN, name);
- if (name.equals(NodeConstants.NODE))
- properties.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
- LocalRepository localRepository = new LocalRepository(adminSession.getRepository(), capability);
- bc.registerService(Repository.class, localRepository, properties);
- if (log.isDebugEnabled())
- log.debug("Published data model " + name);
- }
+ return publishLocalRepo;
+ }
+
+ private void publishLocalRepo(String dataModelName, Repository repository) {
+ Hashtable<String, Object> properties = new Hashtable<>();
+ // properties.put(LEGACY_JCR_REPOSITORY_ALIAS, name);
+ properties.put(NodeConstants.CN, dataModelName);
+ if (dataModelName.equals(NodeConstants.NODE))
+ properties.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
+ LocalRepository localRepository = new LocalRepository(repository, dataModelName);
+ bc.registerService(Repository.class, localRepository, properties);
+ if (log.isDebugEnabled())
+ log.debug("Published data model " + dataModelName);