@@ -901,4 +901,74 @@ public void close() {
901
901
}
902
902
903
903
904
+ /**
905
+ * Restart Jenkins without waiting for any existing build to complete
906
+ *
907
+ * @param crumbFlag
908
+ * <code>true</code> to add <b>crumbIssuer</b> <code>false</code>
909
+ * otherwise.
910
+ * @throws IOException
911
+ * in case of an error.
912
+ */
913
+ public void restart (Boolean crumbFlag ) throws IOException {
914
+ try {
915
+ client .post ("/restart" , crumbFlag );
916
+ } catch (org .apache .http .client .ClientProtocolException e ) {
917
+ LOGGER .error ("restart()" , e );
918
+ }
919
+ }
920
+
921
+ /**
922
+ * safeRestart: Puts Jenkins into the quiet mode, wait for existing builds
923
+ * to be completed, and then restart Jenkins
924
+ *
925
+ * @param crumbFlag
926
+ * <code>true</code> to add <b>crumbIssuer</b> <code>false</code>
927
+ * otherwise.
928
+ * @throws IOException
929
+ * in case of an error.
930
+ */
931
+ public void safeRestart (Boolean crumbFlag ) throws IOException {
932
+ try {
933
+ client .post ("/safeRestart" , crumbFlag );
934
+ } catch (org .apache .http .client .ClientProtocolException e ) {
935
+ LOGGER .error ("safeRestart()" , e );
936
+ }
937
+ }
938
+
939
+ /**
940
+ * Shutdown Jenkins without waiting for any existing build to complete
941
+ *
942
+ * @param crumbFlag
943
+ * <code>true</code> to add <b>crumbIssuer</b> <code>false</code>
944
+ * otherwise.
945
+ * @throws IOException
946
+ * in case of an error.
947
+ */
948
+ //
949
+ public void exit (Boolean crumbFlag ) throws IOException {
950
+ try {
951
+ client .post ("/exit" , crumbFlag );
952
+ } catch (org .apache .http .client .ClientProtocolException e ) {
953
+ LOGGER .error ("exit()" , e );
954
+ }
955
+ }
956
+
957
+ /**
958
+ * safeExit: Puts Jenkins into the quiet mode, wait for existing builds to
959
+ * be completed, and then shut down Jenkins
960
+ *
961
+ * @param crumbFlag
962
+ * <code>true</code> to add <b>crumbIssuer</b> <code>false</code>
963
+ * otherwise.
964
+ * @throws IOException
965
+ * in case of an error.
966
+ */
967
+ public void safeExit (Boolean crumbFlag ) throws IOException {
968
+ try {
969
+ client .post ("/safeExit" , crumbFlag );
970
+ } catch (org .apache .http .client .ClientProtocolException e ) {
971
+ LOGGER .error ("safeExit()" , e );
972
+ }
973
+ }
904
974
}
0 commit comments