Package org.sonatype.nexus.configuration

Examples of org.sonatype.nexus.configuration.ConfigurationChangeEvent


    environmentBuilder().startService();

    environmentBuilder().buildEnvironment(this);

    eventBus().post(new ConfigurationChangeEvent(applicationConfiguration, null, null));

    eventBus().post(new NexusStartedEvent(null));
  }
View Full Code Here


      securitySystem.getAnonymousUsername();
      nexusConfiguration.createInternals();
      nexusScheduler.initializeTasks();

      // notify about start other components participating in configuration framework
      eventBus.post(new ConfigurationChangeEvent(nexusConfiguration, null, null));

      applicationStatusSource.getSystemStatus().setLastConfigChange(new Date());
      applicationStatusSource.getSystemStatus().setFirstStart(nexusConfiguration.isConfigurationDefaulted());
      applicationStatusSource.getSystemStatus().setInstanceUpgraded(nexusConfiguration.isInstanceUpgraded());
      applicationStatusSource.getSystemStatus().setConfigurationUpgraded(nexusConfiguration.isConfigurationUpgraded());
View Full Code Here

    if (!prepare.isVetoed()) {
      logApplyConfiguration(prepare.getChanges());

      eventBus.post(new ConfigurationCommitEvent(this));

      eventBus.post(new ConfigurationChangeEvent(this, prepare.getChanges(), getCurrentUserId()));

      return true;
    }
    else {
      log.info(vetoFormatter.format(new VetoFormatterRequest(prepare, log.isDebugEnabled())));
View Full Code Here

      MavenGroupRepository mgr =
          getRepositoryRegistry().getRepositoryWithFacet("test", MavenGroupRepository.class);
      mgr.setMergeMetadata(false);
      ((AbstractMavenGroupRepository)mgr).commitChanges();
      // mgr.getCurrentCoreConfiguration().commitChanges();
      eventBus().post(new ConfigurationChangeEvent(getApplicationConfiguration(), null, null));

      StorageItem item =
          getRootRouter().retrieveItem(new ResourceStoreRequest("/groups/test" + spoofedPath, false));
      // it should be a file and unmodified to repo1 originated file
      checkForFileAndMatchContents(item, md1File);
View Full Code Here

    try {
      Metadata md1, md2;

      // get metadata from a gidr router with merging on (default is on), merge should happen
      eventBus().post(new ConfigurationChangeEvent(getApplicationConfiguration(), null, null));

      StorageItem item =
          getRootRouter().retrieveItem(new ResourceStoreRequest("/groups/test" + spoofedPath, false));
      // save it
      saveItemToFile((StorageFileItem) item, md1File);
      // some content check
      md1 = readMetadata(md1File);
      assertEquals(3, md1.getVersioning().getVersions().size());
      assertEquals("20030303030303", md1.getVersioning().getLastUpdated());

      // get metadata directly from repo1, no aggregation, no spoofing
      StorageItem item1 =
          getRepositoryRegistry().getRepository("repo1").retrieveItem(
              new ResourceStoreRequest(spoofedPath, false));
      // it should be a file and unmodified
      checkForFileAndMatchContents(item1);
      // save it
      saveItemToFile((StorageFileItem) item1, md1File);
      // some content check
      md1 = readMetadata(md1File);
      assertEquals("1.0", md1.getVersioning().getRelease());
      assertEquals(1, md1.getVersioning().getVersions().size());
      assertEquals("20010101010101", md1.getVersioning().getLastUpdated());

      // get metadata directly from repo2, no aggregation, no spoofing
      StorageItem item2 =
          getRepositoryRegistry().getRepository("repo2").retrieveItem(
              new ResourceStoreRequest(spoofedPath, false));
      // it should be a file and unmodified
      checkForFileAndMatchContents(item2);
      // save it
      saveItemToFile((StorageFileItem) item2, md2File);
      // some content check
      md2 = readMetadata(md2File);
      assertEquals("1.1", md2.getVersioning().getRelease());
      assertEquals(1, md2.getVersioning().getVersions().size());
      assertEquals("20020202020202", md2.getVersioning().getLastUpdated());

      // get metadata from a gidr router but switch merging off (default is on), spoofing should happen, and the
      // highest ranked repo in group (repo1) should provide the file
      MavenGroupRepository mgr =
          getRepositoryRegistry().getRepositoryWithFacet("test", MavenGroupRepository.class);
      mgr.setMergeMetadata(false);
      ((AbstractMavenGroupRepository)mgr).commitChanges();
      // mgr.getCurrentCoreConfiguration().commitChanges();
      eventBus().post(new ConfigurationChangeEvent(getApplicationConfiguration(), null, null));

      item = getRootRouter().retrieveItem(new ResourceStoreRequest("/groups/test" + spoofedPath, false));
      // it should be a file and unmodified
      checkForFileAndMatchContents(item, md1File);
    }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.configuration.ConfigurationChangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.