darshan.util
Class MysqlBackup

java.lang.Object
  extended by darshan.util.MysqlBackup

public class MysqlBackup
extends java.lang.Object


Field Summary
 boolean checkConstraint
          permette di abilitare/disabilitare il controllo dell'integrità referenziale durante la fase di creazione, nel caso sia disabilitata è possibile inserire tabelle che hanno riferimenti in qualsiasi ordine.
 
Constructor Summary
MysqlBackup(java.lang.String host, java.lang.String port, java.lang.String user, java.lang.String password, java.lang.String db)
           
 
Method Summary
 boolean all_to_zip(java.lang.String nomefile)
           
 boolean data_to_file(java.lang.String nomefile)
           
 java.lang.String data_to_string()
           
 boolean installed()
          boolean installed() verifica se è possibile avviare mysqldump,
La verifica viene effettuata avviando "mysqldump --help" e cercando la stringa "mysqldump al suo interno"
 boolean routine_to_file(java.lang.String nomefile)
           
 java.lang.String routine_to_string()
          Wrapper di getRoutine()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkConstraint

public boolean checkConstraint
permette di abilitare/disabilitare il controllo dell'integrità referenziale durante la fase di creazione, nel caso sia disabilitata è possibile inserire tabelle che hanno riferimenti in qualsiasi ordine.

Constructor Detail

MysqlBackup

public MysqlBackup(java.lang.String host,
                   java.lang.String port,
                   java.lang.String user,
                   java.lang.String password,
                   java.lang.String db)
Method Detail

installed

public boolean installed()
boolean installed() verifica se è possibile avviare mysqldump,
La verifica viene effettuata avviando "mysqldump --help" e cercando la stringa "mysqldump al suo interno"

Returns:
true se il comando è disponibile, false altrimenti

data_to_string

public java.lang.String data_to_string()
                                throws java.lang.Exception
Throws:
java.lang.Exception - Wrapper di getData LA FUNZIONE NON È OTTIMIZZATA E ALLOCA MOLTA RAM
SERVE SOLO PER FARE TEST

routine_to_string

public java.lang.String routine_to_string()
                                   throws java.lang.Exception
Wrapper di getRoutine()

Throws:
java.lang.Exception

data_to_file

public boolean data_to_file(java.lang.String nomefile)
Parameters:
nomefile -
Returns:
true se va bene, false altrimenti Scrive i dati su un file, funzione ottimizzata per allocare meno ram

routine_to_file

public boolean routine_to_file(java.lang.String nomefile)
Parameters:
nomefile -
Returns:
true se va bene, false altrimenti Scrive i dati su un file

all_to_zip

public boolean all_to_zip(java.lang.String nomefile)
Parameters:
nomefile -
Returns:
true se va bene, false altrimenti genera un file zip con all'interno due files:
data.sql con i dati
routine.sql con la struttura e le procedure