public static boolean isNexusRunning() throws IOException { return ( STATUS_STARTED.equals( getNexusStatus().getData().getState() ) ); }
public static boolean isNexusStopped() throws IOException { return ( STATUS_STOPPED.equals( getNexusStatus().getData().getState() ) ); }
public boolean isNexusStarted() throws NexusClientException, NexusConnectionException { Object tempObj = this.getClientHelper().get( STATE_SERVICE, (String) null ); // StatusResourceResponse.getData ->StatusResource // type check the object so we can have a meaninful error if needed this.checkType( tempObj, StatusResourceResponse.class ); // everything should be smooth sailing from here. return ( (StatusResourceResponse) tempObj ).getData().getState().endsWith( "STARTED" ); }
@Override public NexusStatus getStatus() { try { final StatusResource response = serviceResource( "status" ) .get( StatusResourceResponse.class ) .getData(); return new NexusStatus( response.getAppName(), response.getFormattedAppName(), response.getVersion(), response.getApiVersion(), response.getEditionLong(), response.getEditionShort(), response.getState(), response.getInitializedAt(), response.getStartedAt(), response.getLastConfigChange(), -1, response.isFirstStart(), response.isInstanceUpgraded(), response.isConfigurationUpgraded(), response.getBaseUrl() ); } catch ( UniformInterfaceException e ) { throw convert( e ); } catch ( ClientHandlerException e ) { throw convert( e ); } }