Package org.neo4j.webadmin.backup

Examples of org.neo4j.webadmin.backup.BackupJobDescription


        return data;
    }

    public static BackupJobDescription deserialize( Map<String, Object> data )
    {
        BackupJobDescription desc = new BackupJobDescription();

        if ( data.containsKey( ID_KEY ) )
        {
            try
            {
                try
                {
                    desc.setId( (Integer) data.get( ID_KEY ) );
                }
                catch ( ClassCastException e )
                {
                    desc.setId( Integer.valueOf( (String) data.get( ID_KEY ) ) );
                }
            }
            catch ( Exception e )
            {
                desc.setId( null );
            }
        }
        else
        {
            desc.setId( null );
        }

        desc.setName( (String) data.get( NAME_KEY ) );
        desc.setCronExpression( (String) data.get( CRON_EXPRESSION_KEY ) );
        desc.setPath( (String) data.get( BACKUP_PATH_KEY ) );
        desc.setAutoFoundation( (Boolean) data.get( AUTO_FOUNDATION_KEY ) );

        return desc;
    }
View Full Code Here


    public Response triggerBackupFoundation( @PathParam( "id" ) Integer id )
    {
        try
        {

            BackupJobDescription job = BackupManager.INSTANCE.getJobDescription( id );
            if ( job != null )
            {
                BackupPerformer.doBackupFoundation( new File( job.getPath() ) );
                BackupManager.INSTANCE.getLog().logSuccess( new Date(), job );
            }
            return addHeaders( Response.ok() ).build();

        }
View Full Code Here

    @Consumes( MediaType.APPLICATION_JSON )
    public Response setBackupJob( String json )
    {
        try
        {
            BackupJobDescription jobDesc = BackupJobDescriptionRepresentation.deserialize( jsonToMap( json ) );

            BackupManager.INSTANCE.getConfig().setJobDescription( jobDesc );
            BackupManager.INSTANCE.restart();

            return addHeaders( Response.ok() ).build();
View Full Code Here

TOP

Related Classes of org.neo4j.webadmin.backup.BackupJobDescription

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.