1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
String param2;
List options = null;
String param = args[0].toString();
if(args.length>1)
{
param2=args[1];
}
else
{
param2=null;
}
param= param.substring(param.indexOf('-') + 1);
options = new ArrayList(Arrays.asList(param.split("")));
System.out.println(options);
if(args.length>1)
{
if(param2!=null)
{
if(options.contains("s"))
{
if(options.contains("v") && options.contains("l"))
{
System.out.println("Status d'une instance en verbose et dans le log file");
}
else if(options.contains("v"))
{
System.out.println("Status d'une instance en verbose");
}
else if(options.contains("l"))
{
System.out.println("Status d'une instance dans le log file");
}
else
{
System.out.println("Status de l'instance en normal");
}
}
}
else
{
System.out.println("param2 est null");
}
System.exit(0);
}
if(options!=null && options.contains("a"))
{
if(options.contains("l"))
{
if(options.contains("v"))
{
System.out.println("LoadAll dans le logfile et en verbose");
}
else
{
System.out.println("LoadAll dans le logfile");
}
}
else if(options.contains("v"))
{
if(options.contains("l"))
{
System.out.println("Loadall en Verbose dans le logfile");
}
else
{
System.out.println("LoadAll en verbose");
}
}
else
{
System.out.println("LoadAll en normal");
throw new Exception("Incohérent !!!!");
}
}
else if(options!=null && options.contains("h"))
{
help();
}
else if(options!=null && options.contains("u"))
{
if(options.contains("v"))
{
if(options.contains("l"))
{
System.out.println("On écris le stop du programme en verbose dans les logs");
}
else
{
System.out.println("On affiche le stop en verbose à l'écran");
}
}
else
{
System.out.println("On stop pas en verbose");
}
}
else if(options!=null && options.contains("v") && options.contains("h"))
{
System.out.println("Combinaison incompatible");
}
else if(options!=null && options.contains("s"))
{
if(options.contains("d"))
{
if(options.contains("v"))
{
if(options.contains("l"))
{
System.out.println("Status showdown en verbose et dans un fichier de log");
}
else
{
System.out.println("Status showdown en verbose");
}
}
else if(options.contains("l"))
{
if(options.contains("v"))
{
System.out.println("Status showdown en verbose et dans un fichier de log");
}
else
{
System.out.println("Status showdown log file");
}
}
else
{
System.out.println("Status showdown");
}
}
else
{
if(options.contains("v"))
{
if(options.contains("l"))
{
System.out.println("Status en verbose, de toutes les instances");
}
else
{
System.out.println("Status en verbose de toutes les instances");
}
}
else if(options.contains("l"))
{
System.out.println("Status en log file de toutes les instance");
}
else
{
System.out.println("Status");
}
}
}
}
catch(IOException e)
{
System.out.println("Erreur : "+e);
System.out.println("Connexion closed...");
}
catch(Exception ed)
{
System.out.println("Database name not specified");
System.exit(0);
}
finally
{
try
{
connexion.close();
System.out.println("Connexion closed...");
}
catch(IOException e)
{
System.out.println("Erreur : "+e);
System.out.println("Connexion closed...");
}
}
} |
Partager