@Subscribe @AllowConcurrentEvents public void inspectForNexus(final ConfigurationChangeEvent event) { if (event.getChanges().isEmpty()) { return; } StringBuilder msg = new StringBuilder(); msg.append("Nexus server configuration was changed: "); // keep list unique, one component might be reported multiple times final HashSet<String> changes = new HashSet<String>(); for (Configurable changed : event.getChanges()) { changes.add(changed.getName()); } msg.append(changes.toString()); if (event.getUserId() != null) { msg.append(", change was made by [" + event.getUserId() + "]"); } getFeedRecorder().addSystemEvent(FeedRecorder.SYSTEM_CONFIG_ACTION, msg.toString()); } }
@Subscribe @AllowConcurrentEvents public void inspect(final RepositoryEventLocalStatusChanged revt) { StringBuilder sb = new StringBuilder("The repository '"); sb.append(revt.getRepository().getName()); sb.append("' (ID='").append(revt.getRepository().getId()).append("') was put "); LocalStatus newStatus = revt.getNewLocalStatus(); if (LocalStatus.IN_SERVICE.equals(newStatus)) { sb.append("IN SERVICE."); } else if (LocalStatus.OUT_OF_SERVICE.equals(newStatus)) { sb.append("OUT OF SERVICE."); } else { sb.append(revt.getRepository().getLocalStatus().toString()).append("."); } sb.append(" The previous state was "); if (LocalStatus.IN_SERVICE.equals(revt.getOldLocalStatus())) { sb.append("IN SERVICE."); } else if (LocalStatus.OUT_OF_SERVICE.equals(revt.getOldLocalStatus())) { sb.append("OUT OF SERVICE."); } else { sb.append(revt.getOldLocalStatus().toString()).append("."); } getFeedRecorder().addSystemEvent(FeedRecorder.SYSTEM_REPO_LSTATUS_CHANGES_ACTION, sb.toString()); }
getFeedRecorder().addSystemEvent(FeedRecorder.SYSTEM_CONFIG_ACTION, sb.toString());
getFeedRecorder().addSystemEvent(FeedRecorder.SYSTEM_REPO_PSTATUS_CHANGES_ACTION, sb.toString());
protected void inspect(Event<?> evt) { if (evt instanceof NexusStartedEvent) { getFeedRecorder().addSystemEvent( FeedRecorder.SYSTEM_BOOT_ACTION, "Started Nexus (version " + getApplicationStatusSource().getSystemStatus().getVersion() + " " + getApplicationStatusSource().getSystemStatus().getEditionShort() + ")"); } else if (evt instanceof NexusStoppedEvent) { getFeedRecorder().addSystemEvent( FeedRecorder.SYSTEM_BOOT_ACTION, "Stopping Nexus (version " + getApplicationStatusSource().getSystemStatus().getVersion() + " " + getApplicationStatusSource().getSystemStatus().getEditionShort() + ")"); getFeedRecorder().shutdown(); } }