Package org.neo4j.webadmin.domain

Examples of org.neo4j.webadmin.domain.LifecycleRepresentation


    @Produces( MediaType.APPLICATION_JSON )
    @Path( STATUS_PATH )
    public synchronized Response status()
    {

        LifecycleRepresentation status = new LifecycleRepresentation(
                serverStatus, LifecycleRepresentation.PerformedAction.NONE );
        String entity = JsonRenderers.DEFAULT.render( status );

        return addHeaders(
                Response.ok( entity, JsonRenderers.DEFAULT.getMediaType() ) ).build();
View Full Code Here


    @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;
View Full Code Here

    @POST
    @Produces( MediaType.APPLICATION_JSON )
    @Path( STOP_PATH )
    public synchronized Response stop()
    {
        LifecycleRepresentation status;

        if ( DatabaseLocator.databaseIsRunning() )
        {
            try
            {
                WebServerFactory.getDefaultWebServer().stopServer();
            }
            catch ( NullPointerException e )
            {
                // REST server was not running
            }
            DatabaseLocator.shutdownAndBlockGraphDatabase();
            status = new LifecycleRepresentation(
                    LifecycleRepresentation.Status.STOPPED,
                    LifecycleRepresentation.PerformedAction.STOPPED );
        }
        else
        {
            status = new LifecycleRepresentation(
                    LifecycleRepresentation.Status.STOPPED,
                    LifecycleRepresentation.PerformedAction.NONE );
        }

        serverStatus = LifecycleRepresentation.Status.STOPPED;
View Full Code Here

        int restPort = WebServerFactory.getDefaultWebServer().getPort();

        WebServerFactory.getDefaultWebServer().startServer( restPort );
        ConsoleSessions.destroyAllSessions();

        LifecycleRepresentation status = new LifecycleRepresentation(
                LifecycleRepresentation.Status.RUNNING,
                LifecycleRepresentation.PerformedAction.RESTARTED );
        String entity = JsonRenderers.DEFAULT.render( status );

        serverStatus = LifecycleRepresentation.Status.RUNNING;
View Full Code Here

TOP

Related Classes of org.neo4j.webadmin.domain.LifecycleRepresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.