diff --git a/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/Preferences.java b/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/Preferences.java index f5fb9093bd..f78d1d1093 100644 --- a/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/Preferences.java +++ b/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/Preferences.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 European Spallation Source ERIC. + * Copyright (C) 2024 European Spallation Source ERIC. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,7 +22,8 @@ import org.phoebus.framework.preferences.Preference; /** - * Preferences for save-and-restore client. + * Preferences for save-and-restore. HTTP connection preferences managed in sub-package class + * {@link org.phoebus.applications.saveandrestore.client.Preferences} */ public class Preferences { @@ -50,27 +51,8 @@ public class Preferences { @Preference public static String default_snapshot_name_date_format; - /** - * Where to find the service... - */ - @Preference(name = "jmasar.service.url") - public static String jmasarServiceUrl; - - /** - * Timeout to read response from service. This may need to be increased from default 5000 ms - * if client is handling snapshots with very large number of PVs. - */ - @Preference(name = "httpClient.readTimeout") - public static int httpClientReadTimeout; - - /** - * Timeout for client connection to service. - */ - @Preference(name = "httpClient.connectTimeout") - public static int httpClientConnectTimeout; static { AnnotatedPreferences.initialize(Preferences.class, "/save_and_restore_preferences.properties"); - AnnotatedPreferences.initialize(Preferences.class, "/save_and_restore_client_preferences.properties"); } } diff --git a/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/Preferences.java b/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/Preferences.java new file mode 100644 index 0000000000..f58892f47f --- /dev/null +++ b/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/Preferences.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 European Spallation Source ERIC. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.phoebus.applications.saveandrestore.client; + +import org.phoebus.framework.preferences.AnnotatedPreferences; +import org.phoebus.framework.preferences.Preference; + +/** + * HTTP preferences for save-and-restore client. + */ +public class Preferences { + + /** + * Where to find the service... + */ + @Preference(name = "jmasar.service.url") + public static String jmasarServiceUrl; + + /** + * Timeout to read response from service. This may need to be increased from default 5000 ms + * if client is handling snapshots with very large number of PVs. + */ + @Preference(name = "httpClient.readTimeout") + public static int httpClientReadTimeout; + + /** + * Timeout for client connection to service. + */ + @Preference(name = "httpClient.connectTimeout") + public static int httpClientConnectTimeout; + + static { + AnnotatedPreferences.initialize(Preferences.class, "/save_and_restore_client_preferences.properties"); + } +} diff --git a/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/SaveAndRestoreJerseyClient.java b/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/SaveAndRestoreJerseyClient.java index 87a0a6ba80..91b2860bcc 100644 --- a/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/SaveAndRestoreJerseyClient.java +++ b/app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/SaveAndRestoreJerseyClient.java @@ -27,7 +27,6 @@ import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; import org.phoebus.applications.saveandrestore.Messages; -import org.phoebus.applications.saveandrestore.Preferences; import org.phoebus.applications.saveandrestore.SaveAndRestoreClientException; import org.phoebus.applications.saveandrestore.model.*; import org.phoebus.applications.saveandrestore.model.search.Filter;