@POST
@Produces( MediaType.APPLICATION_JSON )
@Path( START_PATH )
public synchronized Response start()
{
LifecycleRepresentation status;
if ( !DatabaseLocator.databaseIsRunning() )
{
DatabaseLocator.unblockGraphDatabase();
int restPort = WebServerFactory.getDefaultWebServer().getPort();
WebServerFactory.getDefaultWebServer().startServer( restPort );
ConsoleSessions.destroyAllSessions();
status = new LifecycleRepresentation(
LifecycleRepresentation.Status.RUNNING,
LifecycleRepresentation.PerformedAction.STARTED );
}
else
{
status = new LifecycleRepresentation(
LifecycleRepresentation.Status.RUNNING,
LifecycleRepresentation.PerformedAction.NONE );
}
serverStatus = LifecycleRepresentation.Status.RUNNING;