/** * Gets the repository. * * @return the repository */ public Repository getRepository() { return getEventSender(); }
protected RepositoryConfigurationUpdatedEvent getRepositoryConfigurationUpdatedEvent() { RepositoryConfigurationUpdatedEvent event = new RepositoryConfigurationUpdatedEvent( this ); event.setLocalUrlChanged( this.localUrlChanged ); event.setMadeSearchable( this.madeSearchable ); event.setLocalStatusChanged( localStatusChanged ); return event; }
/** * Returns the group repository instance being reconfigured. * * @return */ public GroupRepository getGroupRepository() { return (GroupRepository) getEventSender(); }
@Override public void inspect( Event<?> evt ) { if ( !accepts( evt ) ) { return; } if ( evt instanceof RepositoryRegistryEventAdd ) { poolManager.createPool( ( (RepositoryRegistryEventAdd) evt ).getRepository() ); } else if ( evt instanceof RepositoryRegistryEventRemove ) { poolManager.removePool( ( (RepositoryRegistryEventRemove) evt ).getRepository() ); } // else if ( evt instanceof NexusStoppedEvent ) // { // poolManager.shutdown(); // } } }
protected void inspect(final Event<?> evt) { Repository repository = null; if (evt instanceof RepositoryRegistryRepositoryEvent) { repository = ((RepositoryRegistryRepositoryEvent) evt).getRepository(); } else if (evt instanceof RepositoryConfigurationUpdatedEvent) { repository = ((RepositoryConfigurationUpdatedEvent) evt).getRepository(); } try { // check registry for existence, wont be able to do much // if doesn't exist yet repoRegistry.getRepositoryWithFacet(repository.getId(), MavenRepository.class); inspectForIndexerManager(evt, repository); } catch (NoSuchRepositoryException e) { log.debug("Attempted to handle repository that isn't yet in registry"); } }
public String format( VetoFormatterRequest request ) { StringBuilder sb = new StringBuilder(); if ( request != null && request.getEvent() != null && request.getEvent().isVetoed() ) { sb.append( "Event " + request.getEvent().toString() + " has been vetoed by one or more components." ); if ( request.isDetailed() ) { sb.append( StringDigester.LINE_SEPERATOR ); for ( Veto veto : request.getEvent().getVetos() ) { sb.append( "vetoer: " + veto.getVetoer().toString() ); sb.append( "cause:" ); sb.append( StringDigester.LINE_SEPERATOR ); sb.append( ExceptionUtils.getFullStackTrace( veto.getReason() ) ); sb.append( StringDigester.LINE_SEPERATOR ); } } } return sb.toString(); } }
private boolean isCollectionItem(RepositoryItemEvent itemEvent) { return StorageCollectionItem.class.isAssignableFrom(itemEvent.getItem().getClass()); }
protected void inspect(final Event<?> evt) { final UpdateSiteProxyRepository updateSite = ((RepositoryEvent) evt).getRepository().adaptToFacet(UpdateSiteProxyRepository.class); if (updateSite != null && (evt instanceof RepositoryEventExpireNotFoundCaches || ((RepositoryConfigurationUpdatedEvent) evt).isRemoteUrlChanged())) { final ScheduledTask<?> mirrorTask = UpdateSiteMirrorTask.submit(scheduler, updateSite, false); log.debug("Submitted " + mirrorTask.getName()); } } }
@Subscribe @AllowConcurrentEvents public void on(final RepositoryRegistryEventAdd evt) { final Repository repository = evt.getRepository(); // check do we need to handle it at all if (isArchetypeCatalogSubject(repository)) { manageArchetypeCatalog(repository); } }
@Override public void inspect( Event<?> evt ) { eventInspector.inspect( evt ); } }
public ProxyRepository getRepository() { return (ProxyRepository) super.getRepository(); } }
@Override public boolean accepts( Event<?> evt ) { return eventInspector.accepts( evt ); }
@Override public ProxyRepository getRepository() { return (ProxyRepository) super.getRepository(); }
public TargetRegistry getTargetRegistry() { return getEventSender(); }
public RepositoryRegistry getRepositoryRegistry() { return getEventSender(); }
public void putVeto( Object vetoer, Throwable reason ) { vetos.add( new Veto( vetoer, reason ) ); }
@Override protected RepositoryConfigurationUpdatedEvent getRepositoryConfigurationUpdatedEvent() { RepositoryConfigurationUpdatedEvent event = super.getRepositoryConfigurationUpdatedEvent(); event.setRemoteUrlChanged( this.remoteUrlChanged ); return event; }
@Override protected RepositoryConfigurationUpdatedEvent getRepositoryConfigurationUpdatedEvent() { RepositoryConfigurationUpdatedEvent event = super.getRepositoryConfigurationUpdatedEvent(); event.setDownloadRemoteIndexEnabled( this.downloadRemoteIndexEnabled ); return event; }
public void run() { try { ei.inspect( evt ); } catch ( Exception e ) { logger.warn( "EventInspector implementation={} had problem accepting an event={}", ei.getClass().getName(), evt.getClass(), e); } } }
@Override public String toString() { return getClass().getSimpleName() + "{" + "repositoryId=" + getRepository().getId() + '}'; } }