public String getVersion() { final SystemStatus status = applicationStatusSource.getSystemStatus(); return status.getVersion(); }
public void deleteRepository( String id ) throws NoSuchRepositoryException, IOException, ConfigurationException, AccessDeniedException { deleteRepository( id, false ); }
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(); } }
protected synchronized String getUserAgentPlatformInfo() { // TODO: this is a workaround, see NXCM-363 SystemStatus status = applicationStatusSource.getSystemStatus(); if ( platformEditionShort == null || !platformEditionShort.equals( status.getEditionShort() ) || userAgentPlatformInfo == null ) { platformEditionShort = status.getEditionShort(); userAgentPlatformInfo = new StringBuilder( "Nexus/" ).append( status.getVersion() ).append( " (" ).append( status.getEditionShort() ).append( "; " ).append( System.getProperty( "os.name" ) ).append( "; " ).append( System.getProperty( "os.version" ) ).append( "; " ).append( System.getProperty( "os.arch" ) ).append( "; " ).append( System.getProperty( "java.version" ) ).append( ")" ).toString(); } return userAgentPlatformInfo; }
@Override public String asDiagnosticsFormat() { StringBuilder sb = new StringBuilder(); sb.append( "Nexus Version: " ); sb.append( applicationStatus.getSystemStatus().getVersion() ); sb.append( LINE_SEPERATOR ); sb.append( "Nexus Edition: " ); sb.append( applicationStatus.getSystemStatus().getEditionLong() ); sb.append( LINE_SEPERATOR ); return sb.toString(); }
/** * Builds the "author" field from Nexus version. */ protected String getNexusAuthor() { return "Nexus " + getApplicationStatusSource().getSystemStatus().getVersion(); }
private SyndFeedImpl createFeed() { SyndFeedImpl feed = new SyndFeedImpl(); feed.setTitle(getTitle()); feed.setDescription(getDescription()); feed.setAuthor("Nexus " + getApplicationStatusSource().getSystemStatus().getVersion()); feed.setPublishedDate(new Date()); return feed; }
protected boolean isNexusStarted() { return getApplicationStatusSource().getSystemStatus().isNexusStarted(); } }
/** * @return the full name of this Nexus to use in logs including App name, version and long edition if defined */ @VisibleForTesting protected final String getNexusNameForLogs(){ final StringBuilder msg = new StringBuilder(); msg.append(getSystemStatus().getAppName()); msg.append( " " ).append( getSystemStatus().getVersion() ); return msg.toString(); }
public SystemStatus getSystemStatus() { return applicationStatusSource.getSystemStatus(); }
public StorageItem dereferenceLinkItem( StorageLinkItem item ) throws NoSuchResourceStoreException, ItemNotFoundException, AccessDeniedException, IllegalOperationException, StorageException { return getRootRouter().dereferenceLink( item ); }
public boolean setState( SystemState state ) { Lock lock = getLock().writeLock(); lock.lock(); try { getSystemStatusInternal().setState( state ); return true; } finally { lock.unlock(); } }
@Override protected ResourceStore getResourceStore( final Request request ) throws NoSuchRepositoryException, ResourceException { return getNexus().getRootRouter(); } }
/** * Public constructor. */ public AbstractApplicationStatusSource() { this.systemStatus = new SystemStatus(); this.lock = new ReentrantReadWriteLock(); }
public void start() throws StartingException { try { startService(); } catch ( Exception e ) { throw new StartingException( "Could not start Nexus!", e ); } }
public void stop() throws StoppingException { try { stopService(); } catch ( Exception e ) { throw new StoppingException( "Could not stop Nexus!", e ); } }
protected String getSenderId() { SystemStatus status = applicationStatusSource.getSystemStatus(); if ( platformEditionShort == null || !platformEditionShort.equals( status.getEditionShort() ) || userAgentPlatformInfo == null ) { // make it "remember" to be able to detect license changes later platformEditionShort = status.getEditionShort(); userAgentPlatformInfo = new StringBuilder( "Nexus/" ).append( status.getVersion() ).append( " (" ) .append( status.getEditionShort() ).append( "; " ).append( System.getProperty( "os.name" ) ) .append( "; " ).append( System.getProperty( "os.version" ) ).append( "; " ) .append( System.getProperty( "os.arch" ) ).append( "; " ) .append( System.getProperty( "java.version" ) ).append( ") " ).toString(); } return userAgentPlatformInfo; }
@Inject public VelocityRenderer(final Velocity velocity, final ApplicationStatusSource applicationStatusSource, final GlobalRestApiSettings globalRestApiSettings) { this.velocity = checkNotNull(velocity); this.applicationVersion = checkNotNull(applicationStatusSource).getSystemStatus().getVersion(); this.globalRestApiSettings = checkNotNull(globalRestApiSettings); }
@Inject public NexusContentServlet(final RepositoryRouter repositoryRouter, final Renderer renderer, final GlobalRestApiSettings globalRestApiSettings, final ApplicationStatusSource applicationStatusSource) { this.repositoryRouter = checkNotNull(repositoryRouter); this.renderer = checkNotNull(renderer); this.globalRestApiSettings = checkNotNull(globalRestApiSettings); this.serverString = "Nexus/" + checkNotNull(applicationStatusSource).getSystemStatus().getVersion(); logger.debug("bufferSize={}, dereferenceLinks={}", BUFFER_SIZE, DEREFERENCE_LINKS); }