Omaha #4834 remove catch LocalizationOpFailedException

replace catching LocalizationOpFailedException with
LocalizationException

Change-Id: Ib5ed69539474d798d04363106a5a2aaf47ac6e58

Former-commit-id: c465340cf3d5215c10409354b380ed76bbbca270
This commit is contained in:
Nate Jensen 2015-11-12 13:47:06 -06:00 committed by Gerrit Code Review
parent 260d20c920
commit acc931788c
34 changed files with 391 additions and 365 deletions

View file

@ -34,7 +34,6 @@ import java.util.Vector;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@ -55,7 +54,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -73,6 +71,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* 07 Dec 2010 6531 cjeanbap Refactored class to be an Abstract class.
* 02 Mar 2011 5632 cjeanbap Update Listbox title text
* 06 May 2011 9101 cjeanbap Changed Constructor method signature.
* 12 Nov 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author lvenable
@ -268,7 +268,7 @@ public class FileSelectDlg extends Dialog {
fileList.add(locFile.getFile(false).getName());
}
fileList.select(getIndex());
fileList.addSelectionListener(new SelectionListener() {
fileList.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
selectedIndex = fileList.getSelectionIndex();
@ -287,10 +287,6 @@ public class FileSelectDlg extends Dialog {
associatedTextBox.setText(name);
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
}
});
}
@ -313,6 +309,7 @@ public class FileSelectDlg extends Dialog {
okBtn.setText("OK");
okBtn.setLayoutData(gd);
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
returnObj = true;
shell.dispose();
@ -324,6 +321,7 @@ public class FileSelectDlg extends Dialog {
cancelBtn.setText("Cancel");
cancelBtn.setLayoutData(gd);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
if (isSelected()) {
returnObj = false;
@ -339,6 +337,7 @@ public class FileSelectDlg extends Dialog {
importNewBtn1.setText("Import");
importNewBtn1.setLayoutData(gd);
importNewBtn1.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
FileDialog newFileDlg = new FileDialog(shell, SWT.OPEN
| SWT.SINGLE);
@ -368,10 +367,7 @@ public class FileSelectDlg extends Dialog {
}
setSelectedFile(newFile.getName());
}
} catch (LocalizationOpFailedException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
} catch (IOException e) {
} catch (LocalizationException | IOException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
@ -382,7 +378,7 @@ public class FileSelectDlg extends Dialog {
}
private boolean saveToLocalizationFile(File file, LocalizationFile locFile)
throws IOException, LocalizationOpFailedException {
throws IOException, LocalizationException {
File newFile = locFile.getFile();
InputStream in = new FileInputStream(file);
OutputStream out = new FileOutputStream(newFile);

View file

@ -40,7 +40,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -58,14 +58,16 @@ import com.raytheon.uf.viz.alertviz.config.Source;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 7, 2010 mschenke Initial creation
* Apr 07, 2010 mschenke Initial creation
* Mar 16, 2011 6531 rferrel Start up loads host dependent
* configuration file.
* Aug 28 2012 13528 Xiaochuan Using setNewConfiguration() to
* Aug 28, 2012 13528 Xiaochuan Using setNewConfiguration() to
* re-set configuration data and
* run notifyListeners().
* Apr 07 2015 4346 rferrel Created {@link #retrieveBaseConfiguration()}.
* Apr 07, 2015 4346 rferrel Created {@link #retrieveBaseConfiguration}.
* May 20, 2015 4346 rjpeter Updated to also load from common_static.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author mschenke
@ -262,7 +264,7 @@ public class ConfigurationManager {
/**
* Delete the configuration passed in
*
* @param name
* @param context
*/
public void deleteConfiguration(ConfigContext context) {
if (context.isBaseOrConfiguredLevel() || isDefaultConfig(context)) {
@ -596,9 +598,7 @@ public class ConfigurationManager {
}
serializeToFile(customConfiguration, customFile);
locFile.save();
} catch (SerializationException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
} catch (LocalizationOpFailedException e) {
} catch (SerializationException | LocalizationException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}

View file

@ -49,7 +49,7 @@ import com.raytheon.uf.common.archive.config.ArchiveConfigManager;
import com.raytheon.uf.common.archive.config.ArchiveConstants;
import com.raytheon.uf.common.archive.config.CategoryConfig;
import com.raytheon.uf.common.archive.config.DisplayData;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.util.SizeUtil;
import com.raytheon.uf.viz.archive.data.ArchiveInfo;
import com.raytheon.uf.viz.archive.data.CategoryInfo;
@ -83,6 +83,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Apr 10, 2014 3023 rferrel Added setTotalSelectedSize method.
* Apr 23, 2014 3045 rferrel Changes to prevent race condition while getting labels.
* Aug 26, 2014 3553 rferrel Force redisplay of table after getting all display labels.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -473,7 +474,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
String fileName = ArchiveConstants.selectFileName(type, selectName);
try {
manager.deleteSelection(fileName);
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
MessageDialog.openError(shell, "Case Error",
"Unable to delete file: " + fileName);
}
@ -819,6 +820,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
*
* @param startTimeOffset
*/
@Override
public void setRetentionTimes(long startTimeOffset) {
// do nothing override by sub-classes
}
@ -858,6 +860,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
/**
* Perform updates once all the display data is loaded.
*/
@Override
public void loadedAllDisplayData() {
VizApp.runAsync(new Runnable() {

View file

@ -26,7 +26,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -36,22 +36,21 @@ import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg;
import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg.Mode;
/**
* DeleteAWIPSProcedure
*
* Delete an AWIPS procedure
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 13, 2007 chammack Initial Creation.
* Jul 8, 2008 #1183 chammack Migrate to new localization
* Oct 16, 2012 #1229 rferrel Changes for non-blocking VizLocalizationFileListDlg.
* Jun 02, 2015 #4401 bkowal Updated to use {@link VizLocalizationFileListDlg}.
* Jun 30, 2015 #4401 bkowal Specify the localization type when constructing a
* {@link VizLocalizationFileListDlg}.
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 13, 2007 chammack Initial Creation.
* Jul 8, 2008 #1183 chammack Migrate to new localization
* Oct 16, 2012 #1229 rferrel Changes for non-blocking VizLocalizationFileListDlg.
* Jun 02, 2015 #4401 bkowal Updated to use {@link VizLocalizationFileListDlg}.
* Jun 30, 2015 #4401 bkowal Specify the localization type when constructing a
* {@link VizLocalizationFileListDlg}.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -87,7 +86,7 @@ public class DeleteAWIPSProcedure extends AbstractHandler {
LocalizationFile selectedFile = (LocalizationFile) returnValue;
try {
selectedFile.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(
Priority.PROBLEM,
"Error deleting procedure: "

View file

@ -94,7 +94,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.LocalizationNotificationObserver;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -142,7 +142,7 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
* Aug 24, 2015 4393 njensen Updates for observer changes
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
*
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -1574,7 +1574,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
.isSystemLevel() == false) {
input.getLocalizationFile().save();
}
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(
Priority.PROBLEM,
"Error saving file: "

View file

@ -46,7 +46,6 @@ import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.msgs.ListResponseEntry;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -69,7 +68,7 @@ import com.raytheon.uf.viz.localization.perspective.view.actions.ImportFileActio
* Jul 1, 2011 mschenke Initial creation
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
*
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -120,7 +119,7 @@ public class LocalizationFileDragNDropSource extends ViewerDropAdapter
if (toDelete != null) {
try {
toDelete.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
UFStatus.getHandler().handle(Priority.PROBLEM,
"Error deleting old file", e);
}

View file

@ -35,7 +35,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -57,6 +56,7 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
* Nov 3, 2010 mschenke Initial creation
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -138,7 +138,7 @@ public class CopyToAction extends AbstractToAction {
if (altFile.exists()) {
try {
altFile.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to delete existing " + type.name()
+ " " + level + " file.", e);

View file

@ -89,6 +89,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Dec 05, 2012 #1364 rferrel Replace File.Separator with IPathManager.SEPARATOR
* to work correctly on all platforms.
* Oct 20, 2014 #3418 dlovely Fixed a possible NPE in loadPoint.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -454,7 +455,7 @@ public class PointsDataManager implements ILocalizationFileObserver {
if (!d2dDir.isDirectory()) {
try {
d2dDir.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to create group: " + D2D_POINTS_GROUP);
return points;
@ -960,7 +961,7 @@ public class PointsDataManager implements ILocalizationFileObserver {
put(key, point);
childrenKeyMap.get(newParentKey).add(key);
} else {
Point newGroup = new GroupNode((Point) point);
Point newGroup = new GroupNode(point);
String newGroupKey = newParentKey + IPathManager.SEPARATOR
+ point.getName();
newGroup.setGroup(newGroupKey);
@ -1364,7 +1365,7 @@ public class PointsDataManager implements ILocalizationFileObserver {
deleteKey);
try {
lFile.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
@ -1505,9 +1506,6 @@ public class PointsDataManager implements ILocalizationFileObserver {
* ADDED if file was successfully created.
*
* @param point
* @return returns true if point was successfully added, false otherwise,
* for example when a duplicate point name exists and forceOverwrite
* was false
*/
private void storePoint(Point point) {
LocalizationFile dir = getGroupDir(point);
@ -1522,7 +1520,6 @@ public class PointsDataManager implements ILocalizationFileObserver {
* DELETE if file removal is successful.
*
* @param point
* @return
*/
public void deletePoint(final Point point) {
IPointNode parentNode = getParent(point);
@ -1592,7 +1589,7 @@ public class PointsDataManager implements ILocalizationFileObserver {
if (!lFile.delete()) {
statusHandler.error("Unable to remove file: " + lFile);
}
} catch (LocalizationOpFailedException e1) {
} catch (LocalizationException e1) {
statusHandler.handle(Priority.PROBLEM,
"Error deleting locatization file from server: " + lFile);
}

View file

@ -66,7 +66,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.core.VizApp;
@ -81,15 +81,16 @@ import com.raytheon.uf.viz.spellchecker.jobs.EnhancedSpellCheckJob;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 18, 2014 3453 rblum Initial creation
* Aug 06, 2014 3453 rblum Refreshing all viewers on enable/
* disable of spell checking.
* Aug 18, 2014 3453 rblum Added the spell check dictionary
* to site level localization.
* Oct 01, 2014 3453 rblum Allow MB3 click anywhere in the textbox
* to enable/disable spellcheck.
* Mar 27, 2015 4138 dhladky Guava name change.
* Apr 14, 2015 4362 mapeters Allow external contribution of menu items.
* Jun 18, 2014 3453 rblum Initial creation
* Aug 06, 2014 3453 rblum Refreshing all viewers on enable/
* disable of spell checking.
* Aug 18, 2014 3453 rblum Added the spell check dictionary
* to site level localization.
* Oct 01, 2014 3453 rblum Allow MB3 click anywhere in the textbox
* to enable/disable spellcheck.
* Mar 27, 2015 4138 dhladky Guava name change.
* Apr 14, 2015 4362 mapeters Allow external contribution of menu items.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -387,7 +388,7 @@ public class SpellCheckTextViewer extends TextViewer implements
if (lf != null) {
lf.save();
}
} catch (LocalizationOpFailedException exception) {
} catch (LocalizationException exception) {
statusHandler.error(
"Unable to save dictionary into localization",
exception);

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
@ -62,6 +63,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 28 FEB 2008 938 lvenable Initial creation
* 18 JUN 2008 1119 lvenable Updated dialog to reflect user changes.
* 04 OCT 2012 1229 rferrel Made non-blocking.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -574,13 +576,7 @@ public class WindRoseConfigDlg extends CaveSWTDialog {
try {
updateData();
} catch (ConfigurationException e) {
// TODO Auto-generated catch block
System.err.println(e.getStackTrace());
} catch (LocalizationOpFailedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@ -605,13 +601,7 @@ public class WindRoseConfigDlg extends CaveSWTDialog {
try {
updateData();
} catch (ConfigurationException e) {
// TODO Auto-generated catch block
System.err.println(e.getStackTrace());
} catch (LocalizationOpFailedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@ -692,10 +682,9 @@ public class WindRoseConfigDlg extends CaveSWTDialog {
* @throws IOException
* @throws ConfigurationException
* @throws LocalizationOpFailedException
* @throws LocalizationCommunicationException
*/
private void updateData() throws IOException, ConfigurationException,
LocalizationOpFailedException {
LocalizationException {
windRoseConfigData.setCalmRgb(calmColor.getRGB());
windRoseConfigData.setVariableRgb(variableColor.getRGB());
windRoseConfigData.setVar1Rgb(windSpeed1Color.getRGB());

View file

@ -96,7 +96,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -247,6 +247,7 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
* Sep 28, 2015 4898 rferrel Disable sending of TAF when CAVE not in real time.
* Oct 05, 2015 4855 skorolev Fixed an unhandled event loop exception in createErrorStyleRange.
* Oct 16, 2015 4645 skorolev Added updateWordWrap.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -2430,7 +2431,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
e.printStackTrace();
setMessageStatusError("An IOException occured while saving file "
+ filepath);
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
e.printStackTrace();
setMessageStatusError("A LocalizationOpFailedException occured while saving file "
+ filepath);

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -63,6 +64,8 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.RuleType;
* Aug 07, 2014 3502 bclement changes to StringUtil.split()
* Jun 02, 2015 17533 yteng changes to getRules() to retrieve
* all rules
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author avarani
@ -255,7 +258,7 @@ public class AvnConfiguration {
*/
public void setRules(String site, DataSource source,
ArrayList<MethodData> data) throws ConfigurationException,
IOException, LocalizationOpFailedException {
IOException, LocalizationException {
String filepath = "aviation/config/tafs/" + site + "/"
+ source.getFilename();
IPathManager pm = PathManagerFactory.getPathManager();
@ -355,13 +358,13 @@ public class AvnConfiguration {
HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(
file);
config.setDelimiterParsingDisabled(true);
String[] activeRules = config.getStringArray("rules.active");
if (activeRules == null || activeRules.length == 0) {
if (activeRules == null || activeRules.length == 0) {
throw new ConfigurationException(file.getName()
+ ", no list of active rules");
}
for (String activeRule : activeRules) {
if (activeRule.trim().equals("")) {
continue;

View file

@ -8,6 +8,7 @@ import java.util.Map;
import org.apache.commons.configuration.ConfigurationException;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType;
@ -24,6 +25,7 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType;
* Oct 20, 2010 rferrel Initial creation
* Dec 7, 2010 7621 rferrel Added getTemplateFile.
* Feb 16, 2011 7878 rferrel Modifications to handle ids.cfg.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -60,11 +62,10 @@ public interface ITafSiteConfig {
* @param defaultProduct
* - New default product
* @throws ConfigurationException
* @throws LocalizationCommunicationException
* @throws LocalizationOpFailedException
*/
public void setDefault(String defaultProduct)
throws ConfigurationException, LocalizationOpFailedException;
throws ConfigurationException, LocalizationException;
/**
* @return defaultProduct
@ -107,7 +108,6 @@ public interface ITafSiteConfig {
* @param collectivePil
* - product's collective Pil value
* @throws ConfigurationException
* @throws LocalizationCommunicationException
* @throws LocalizationOpFailedException
*/
public void saveProduct(String newProduct, List<String> siteList,
@ -120,11 +120,10 @@ public interface ITafSiteConfig {
* @param product
* - product name to delete
* @throws ConfigurationException
* @throws LocalizationCommunicationException
* @throws LocalizationOpFailedException
*/
public void deleteProduct(String product) throws ConfigurationException,
LocalizationOpFailedException;
LocalizationException;
/**
* Update a site's start Hour template and save the change.
@ -136,7 +135,6 @@ public interface ITafSiteConfig {
* @param template
* - new template
* @throws ConfigurationException
* @throws LocalizationCommunicationException
* @throws LocalizationOpFailedException
*/
public void saveTafTemplate(String siteId, String startHour, String template)
@ -172,7 +170,6 @@ public interface ITafSiteConfig {
* - new taf site data
* @throws IOException
* @throws ConfigurationException
* @throws LocalizationCommunicationException
* @throws LocalizationOpFailedException
*/
public void setSite(String siteId, TafSiteData site) throws IOException,

View file

@ -47,6 +47,7 @@ import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.dataplugin.text.AfosWmoIdDataContainer;
import com.raytheon.uf.common.dataplugin.text.db.AfosToAwips;
import com.raytheon.uf.common.dataplugin.text.request.GetPartialAfosIdRequest;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -69,6 +70,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 12 Oct 2012 1229 rferrel Convert to CaveSWTDialog subclass
* and make non-blocking.
* 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -328,7 +330,7 @@ public class TafProductConfigDlg extends CaveSWTDialog {
.setMessageText(
"An error occured while attempting to delete a product.",
new RGB(255, 0, 0));
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
msgStatusComp
.setMessageText(
"An error occured while attempting to delete a product.",
@ -513,7 +515,7 @@ public class TafProductConfigDlg extends CaveSWTDialog {
.setMessageText(
"An error occured when attempting to set default product.",
new RGB(255, 0, 0));
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
msgStatusComp
.setMessageText(
"An error occured when attempting to set default product.",
@ -546,8 +548,7 @@ public class TafProductConfigDlg extends CaveSWTDialog {
String description = "TAF Product Configuration Help";
String helpText = "This dialog is used to define TAF/TWEB product (list of\nforecasts).\n\nThee products should be defined AFTER relevant site/route\nconfiguration files have been created.\n\nTo add a new product, enter product label in the \"Products\"\nentry field and press <Enter>. Then enter all TAF ids or\nTWEB routes in the \"Idents\" entry field, press <Enter>\nafter typing one item. Press \"Save\" button to save\nconfiguration file.\n\nTo remove a product, press \"Delede\" below \"Products\" list.\n\nTo remove an ident from the product definition, use\n\"Delete\" button in the \"Idents\" column. You must then save\nthe product. This will NOT delete TAF/TWEB configuration\nfiles, this can only be done from the command line.\n\nThe \"Verify\" button can be used to check for existence and\nproper syntax of all relevant files.";
usageDlg = new HelpUsageDlg(shell, description,
helpText);
usageDlg = new HelpUsageDlg(shell, description, helpText);
usageDlg.open();
} else {
usageDlg.bringToTop();

View file

@ -66,7 +66,8 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType;
* Apr 08, 2011 8856 rferrel Can now make a new station's templates
* May 24, 2011 9060 rferrel Limit downloading of localization files.
* Aug 09, 2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR
* May 19, 2015 17417 yteng Get all sites from product
* May 19, 2015 17417 yteng Get all sites from product
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -452,7 +453,7 @@ public class TafSiteConfigIni implements ITafSiteConfig {
*/
@Override
public void deleteProduct(String product) throws ConfigurationException,
LocalizationOpFailedException {
LocalizationException {
HierarchicalINIConfiguration config = configMaps.get(product);
@ -486,10 +487,8 @@ public class TafSiteConfigIni implements ITafSiteConfig {
File file = lFile.getFile();
if (file != null && file.exists()) {
char[] c = new char[(int) file.length()];
FileReader reader = new FileReader(file);
try {
try (FileReader reader = new FileReader(file)) {
reader.read(c);
reader.close();
} catch (IOException ex) {
throw new ConfigurationException(ex.getMessage());
}

View file

@ -58,6 +58,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
@ -78,6 +79,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 11 OCT 2012 1229 rferrel Changes for non-blocking FindReplaceDlg.
* 15 OCT 2012 1229 rferrel Made dialog non-blocking.
* 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -787,7 +789,7 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
msgStatusComp.setMessageText(
"An error occured while saving file " + fn, new RGB(
255, 0, 0));
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
msgStatusComp.setMessageText(
"An error occured while saving file " + fn, new RGB(
255, 0, 0));

View file

@ -46,7 +46,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -65,9 +64,9 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 14, 2008 879 rbell Initial creation
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 14, 2008 879 rbell Initial creation
* 11Jun2008 #1193 ebabin Updates for toggling lat/lon for sample set.
* Apr 9, 2009 1288 rjpeter Added ISampleSetChangedListener handling.
* Aug 6, 2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
@ -75,6 +74,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Sep 08, 2104 #3592 randerso Changed to use new pm listStaticFiles().
* Reworked inventory to use a map to better handle
* files at multiple localization levels
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author rbell
@ -426,7 +427,7 @@ public class SampleSetManager implements ISampleSetManager,
SampleData.getJAXBManager().marshalToXmlFile(sd,
file.getFile().getPath());
file.save();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Error saving to localization server", e);
} catch (SerializationException e) {

View file

@ -44,7 +44,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -66,7 +65,8 @@ import com.raytheon.viz.gfe.core.IWEGroupManager;
* ------------ ---------- ----------- --------------------------
* Jun 05, 2008 chammack Initial creation
* Sep 30, 2013 2361 njensen Use JAXBManager for XML
* Aug 13, 2015 4749 njensen Implemented dispose()
* Aug 13, 2015 4749 njensen Implemented dispose()
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -365,7 +365,7 @@ public class WEGroupManager implements IWEGroupManager,
file.delete();
inventory.get(context.getLocalizationLevel()).remove(object);
return true;
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Error deleting from localization server", e);
}
@ -386,7 +386,7 @@ public class WEGroupManager implements IWEGroupManager,
try {
jaxb.marshalToXmlFile(objectToSave, file.getFile().getPath());
file.save();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Error saving to localization server", e);
} catch (SerializationException e) {

View file

@ -60,6 +60,7 @@ import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
@ -67,7 +68,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -83,12 +84,13 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket// Engineer Description
* Date Ticket Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 30, 2009 randerso Initial creation
* Oct 30, 2012 1298 rferrel Code cleanup for non-blocking dialog.
* Oct 28, 2015 5054 randerso Place GfeConfigDialog on current monitor if
* parent shell is not visible.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -330,7 +332,7 @@ public class GFEConfigDialog extends CaveJFACEDialog {
private Image nextImage() {
int imageNumber = randomSplash();
String imageName = "SSa" + imageNumber + ".gif";
ImageDescriptor id = Activator.imageDescriptorFromPlugin(
ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(
Activator.PLUGIN_ID, FileUtil.join("images", imageName));
return id.createImage();
}
@ -431,7 +433,7 @@ public class GFEConfigDialog extends CaveJFACEDialog {
try {
lf.save();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Error saving config file selection", e);
}

View file

@ -36,7 +36,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.viz.core.mode.CAVEMode;
@ -49,6 +49,7 @@ import com.raytheon.viz.core.mode.CAVEMode;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11 Feb 2010 4132 ryu Initial creation
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -169,7 +170,7 @@ public class ProductFileUtil {
}
static public void writeFile(String text, LocalizationFile localizationFile)
throws IOException, LocalizationOpFailedException {
throws IOException, LocalizationException {
File file = localizationFile.getFile();
writeFile(text, file);

View file

@ -34,7 +34,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.python.PythonFileFilter;
import com.raytheon.viz.gfe.GFEOperationFailedException;
@ -48,6 +47,7 @@ import com.raytheon.viz.gfe.GFEOperationFailedException;
* ------------ ---------- ----------- --------------------------
* Apr 28, 2009 njensen Initial creation
* Apr 20, 2015 4027 randerso Changes to support GFE formatter auto tests
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -124,8 +124,7 @@ public class TextFileUtil {
}
public static void makeWritableCopy(String source, String fileType,
String dest, boolean deleteFlag) throws IOException,
GFEOperationFailedException {
String dest, boolean deleteFlag) throws GFEOperationFailedException {
LocalizationFile srcLf = getTextFile(source, fileType);
if ((srcLf.getContext().getLocalizationLevel() == LocalizationLevel.BASE)
|| (srcLf.getContext().getLocalizationLevel() == LocalizationLevel.CONFIGURED)
@ -181,7 +180,7 @@ public class TextFileUtil {
}
public static void deleteTextFile(LocalizationFile lf)
throws LocalizationOpFailedException, IOException {
throws LocalizationException, IOException {
if (lf.getContext().getLocalizationLevel()
.equals(LocalizationLevel.USER)
&& lf.getContext().getContextName().equals("GFETEST")) {

View file

@ -47,8 +47,8 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonIncludePathUtil;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
@ -78,6 +78,7 @@ import com.raytheon.viz.gfe.textformatter.CombinationsFileUtil.ComboData.Entry;
* Sep 08, 2014 #3592 randerso Changed to use only list site level files as all
* combo files are saved to the site level
* Oct 07, 2015 #4695 dgilling Code cleanup to remove compile warnings.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -178,8 +179,7 @@ public class CombinationsFileUtil {
}
}
public static void deleteComboData(String id)
throws LocalizationOpFailedException {
public static void deleteComboData(String id) throws LocalizationException {
LocalizationFile lf = idToFile(id);
lf.delete();
}
@ -268,10 +268,11 @@ public class CombinationsFileUtil {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("comboName", comboName);
for (int retryCount = 0; retryCount < MAX_TRIES; retryCount++) {
try (PythonScript python = new PythonScript(scriptPath,
try (PythonScript python = new PythonScript(
scriptPath,
PyUtil.buildJepIncludePath(
GfePyIncludeUtil.getCombinationsIncludePath(),
GfePyIncludeUtil.getCommonPythonIncludePath()),
PythonIncludePathUtil.getCommonPythonIncludePath()),
CombinationsFileUtil.class.getClassLoader())) {
Object com = python.execute("getCombinations", map);
combos = (List<List<String>>) com;

View file

@ -50,7 +50,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.site.SiteMap;
@ -84,7 +84,8 @@ import com.raytheon.viz.ui.statusline.StatusStore;
* 28Nov2012 1353 rferrel Sort the list of filter names for dialog display.
* 10Apr2014 15769 ryu Modified default config and GUI items to match A1.
* Default config changed to hard coding instead of reading
* from config file.
* from config file.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
* </pre>
*
* @author lvenable
@ -106,8 +107,8 @@ public final class GhgConfigData {
/**
* The VTEC Action Names
*/
public static final String[] vtecActionNames = { "CAN", "CON",
"EXA", "EXB", "EXP", "EXT", "NEW", "UPG"};
public static final String[] vtecActionNames = { "CAN", "CON", "EXA",
"EXB", "EXP", "EXT", "NEW", "UPG" };
/**
* The VTEC Afos Product (PIL) Names
@ -340,6 +341,7 @@ public final class GhgConfigData {
// Fonts are system resources. We have to dispose of them
// properly.
display.addListener(SWT.Dispose, new Listener() {
@Override
public void handleEvent(Event e) {
Font font = fontMap.get(e.display);
font.dispose();
@ -387,11 +389,11 @@ public final class GhgConfigData {
*/
private void init() {
loadDefault();
defaultFilter = currentFilter.clone();
defaultAlerts = currentAlerts.clone();
defaultColumns = new ArrayList<DataEnum>(visibleColumns);
// Get the VTECTable
initializePython();
}
@ -769,10 +771,7 @@ public final class GhgConfigData {
StatusStore.updateStatus(StatusConstants.SUBCATEGORY_GHG,
"Saved configuration", StatusMessage.Importance.REGULAR);
} catch (JAXBException e) {
statusHandler.handle(Priority.PROBLEM,
"Error saving GHG Monitor configuration", e);
} catch (LocalizationOpFailedException e) {
} catch (JAXBException | LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Error saving GHG Monitor configuration", e);
}
@ -798,14 +797,11 @@ public final class GhgConfigData {
GhgAlertsConfigData alerts = new GhgAlertsConfigData();
alerts.setLocal(true);
alerts.setTest(true);
alerts.addAlert(new GhgAlertData(true, true, 30,
AlertsEnum.AlertLvl1));
alerts.addAlert(new GhgAlertData(true, true, 10,
AlertsEnum.AlertLvl2));
alerts.addAlert(new GhgAlertData(true, true, 0,
AlertsEnum.ExpiredAlert));
alerts.setActions(new String[] { "NEW", "CON", "COR", "EXT",
"EXA", "EXB" });
alerts.addAlert(new GhgAlertData(true, true, 30, AlertsEnum.AlertLvl1));
alerts.addAlert(new GhgAlertData(true, true, 10, AlertsEnum.AlertLvl2));
alerts.addAlert(new GhgAlertData(true, true, 0, AlertsEnum.ExpiredAlert));
alerts.setActions(new String[] { "NEW", "CON", "COR", "EXT", "EXA",
"EXB" });
alerts.setPhenSigs(new String[] {});
alerts.setPils(new String[] {});
currentAlerts = alerts;
@ -844,16 +840,16 @@ public final class GhgConfigData {
visibleColumns = new ArrayList<DataEnum>(DataEnum.values().length);
// The initial columns visible. These need to match the ones set up by
// GhgMonitorDlg.
visibleColumns.addAll(Arrays.asList(DataEnum.ACTION, DataEnum.ETN,
DataEnum.PHEN_SIG, DataEnum.START, DataEnum.END,
DataEnum.PURGE, DataEnum.ISSUE_TIME, DataEnum.PIL,
DataEnum.WFO));
visibleColumns.addAll(Arrays
.asList(DataEnum.ACTION, DataEnum.ETN, DataEnum.PHEN_SIG,
DataEnum.START, DataEnum.END, DataEnum.PURGE,
DataEnum.ISSUE_TIME, DataEnum.PIL, DataEnum.WFO));
sortColumn = DataEnum.PURGE;
descending = false;
identifyTestEvents = true;
//loadFrom(DEFAULT_PATH, true);
// loadFrom(DEFAULT_PATH, true);
}
public void load(boolean reportMissing) {

View file

@ -35,21 +35,22 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.viz.core.mode.CAVEMode;
/**
* TODO Add Description
* Constants for the text workstation
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 11, 2009 mschenke Initial creation
* Nov 11, 2009 mschenke Initial creation
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -158,7 +159,7 @@ public class TextWorkstationConstants {
super.save();
try {
file.save();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Error saving text workstation preferences", e);
}

View file

@ -38,7 +38,7 @@ import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -53,13 +53,12 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 17, 2009 mnash Initial creation
* ======================================
* AWIPS2 DR Work
* 07/25/2012 953 jkorman Modified file "search" to return LocalizationFile
* instead of File so references are deleted in all locations.
* 09/20/2012 1196 rferrel Setup fileName now in return value for
* use with close callback.
* Sep 17, 2009 mnash Initial creation
* 07/25/2012 953 jkorman Modified file "search" to return LocalizationFile
* instead of File so references are deleted in all locations.
* 09/20/2012 1196 rferrel Setup fileName now in return value for
* use with close callback.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -189,6 +188,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog {
// loads the
loadButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
// Set the filename to be returned through getFileName()
if (lists.getSelectionCount() > 0) {
@ -203,6 +203,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog {
// delete the file from the display list and from the file system
deleteButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
int num = lists.getSelectionIndex();
LocalizationFile f = fileList.get(num);
@ -213,7 +214,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog {
.getFile().getPath());
statusHandler.handle(Priority.PROBLEM, msg);
}
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
String msg = String.format(
"ALARM/ALERT:Failed deleting file %s", f.getFile()
.getPath());
@ -225,6 +226,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog {
// close the display without doing anything else
cancelButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
shell.close();
}
@ -287,6 +289,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog {
// get the file name
saveButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
// Set the filename to be returned through getFileName()
fileName = textBox.getText();
@ -297,12 +300,14 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog {
// close the display without doing anything else
cancelButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
shell.close();
}
});
lists.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
textBox.setText(lists.getSelection()[0]);
}

View file

@ -52,7 +52,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -77,26 +77,18 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* ------------ ---------- ----------- --------------------------
* Sep 18, 2009 mnash Initial creation
* 03/19/2012 D. Friedman Fix determination of "Alarm" entries.
* 12/07/2012 15555 m.gamazaychikov Added methods and constants for
* the implementation of proximity alarm
* 12/07/2012 15555 mgamazay Added methods and constants for
* the implementation of proximity alarm
* 07/24/2014 3423 randerso Ensure ringBell is called on UI thread
* 09/09/2014 3580 mapeters Removed IQueryTransport usage (no longer exists).
* 12/03/2014 ASM #16829 D. Friedman Lazy initialization of alarmAlertBell
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author mnash
* @version 1.0
*/
/**
* @author michaelg
*
*/
/**
* @author michaelg
*
*/
public class AlarmAlertFunctions {
private static final AlarmAlertProduct.ProductType AA = AlarmAlertProduct.ProductType.Alarm_Alert;
@ -133,10 +125,6 @@ public class AlarmAlertFunctions {
private static final double ONE_DEGREE_KM = 111.20;
protected void getGIS() {
}
/**
* Create the string for distance in the dialog
*
@ -153,13 +141,14 @@ public class AlarmAlertFunctions {
* DR15555 - check the text content, if it is not a valid number set
* the text to default 3000 mi
*/
Scanner scn = new Scanner(prod.getAorDistance());
while (scn.hasNext()) {
if (!scn.hasNextInt()) {
prod.setAorDistance(DEFAULT_DISTANCE);
break;
} else {
scn.next();
try (Scanner scn = new Scanner(prod.getAorDistance())) {
while (scn.hasNext()) {
if (!scn.hasNextInt()) {
prod.setAorDistance(DEFAULT_DISTANCE);
break;
} else {
scn.next();
}
}
}
string.append("AOR+" + prod.getAorDistance() + prod.getAorLabel());
@ -169,10 +158,6 @@ public class AlarmAlertFunctions {
return string.toString();
}
protected void print(String textToPrint) {
}
protected static void ringBell(boolean sound) {
getAlarmalertbell().open(sound);
}
@ -522,7 +507,6 @@ public class AlarmAlertFunctions {
double lonE = coords[i].x;
if (coords[i].x < centerLon) {
lonE = coords[i].x - deltaX;
;
} else if (coords[i].x > centerLon) {
lonE = coords[i].x + deltaX;
} else if (coords[i].x == centerLon) {
@ -754,7 +738,7 @@ public class AlarmAlertFunctions {
JAXB.marshal(alarms, file.getFile());
try {
file.save();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.SIGNIFICANT,
e.getLocalizedMessage(), e);
}
@ -804,7 +788,7 @@ public class AlarmAlertFunctions {
lFile.getFile().createNewFile();
try {
lFile.save();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.SIGNIFICANT,
e.getLocalizedMessage(), e);
}
@ -844,7 +828,7 @@ public class AlarmAlertFunctions {
w.close();
try {
lFile.save();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.SIGNIFICANT,
e.getLocalizedMessage(), e);
}
@ -868,7 +852,8 @@ public class AlarmAlertFunctions {
*/
public static AlarmAlertBell getAlarmalertbell() {
if (alarmAlertBell == null) {
// No synchronize because this must be called on the UI thread anyway.
// No synchronize because this must be called on the UI thread
// anyway.
alarmAlertBell = new AlarmAlertBell(new Shell());
}
return alarmAlertBell;

View file

@ -49,8 +49,9 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonIncludePathUtil;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -80,6 +81,8 @@ import com.raytheon.uf.edex.activetable.ActiveTablePyIncludeUtil;
* Added call to nwrwavestcv.csh
* Added support for sending TCVAdvisory files to
* VTEC partners
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author njensen
@ -282,7 +285,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
try {
transmittedFile.save();
transmittedFileSaved = true;
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.error("Failed to save advisory "
+ transmittedFilename);
}
@ -290,7 +293,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
if (transmittedFileSaved) {
try {
pendingFile.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.error("Unable to delete " + pendingFile, e);
}
@ -351,7 +354,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
practiceMode);
try {
advisoryFile.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.error("Unable to delete "
+ advisoryFile, e);
}
@ -378,7 +381,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
.getPath();
String pythonIncludePath = PyUtil.buildJepIncludePath(
ActiveTablePyIncludeUtil.getCommonPythonIncludePath(),
PythonIncludePathUtil.getCommonPythonIncludePath(),
ActiveTablePyIncludeUtil.getCommonGfeIncludePath(),
ActiveTablePyIncludeUtil.getVtecIncludePath(siteId),
ActiveTablePyIncludeUtil.getGfeConfigIncludePath(siteId),

View file

@ -100,6 +100,7 @@ import com.raytheon.uf.common.util.FileUtil;
* Feb 24, 2015 3978 njensen Changed to use abstract InputStream
* Jun 29, 2015 4583 rferrel Log detail error message when archive configuration is invalid.
* Aug 18, 2015 3806 njensen Use SaveableOutputStream to save
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -923,8 +924,7 @@ public class ArchiveConfigManager {
* @param fileName
* @throws LocalizationOpFailedException
*/
public void deleteSelection(String fileName)
throws LocalizationOpFailedException {
public void deleteSelection(String fileName) throws LocalizationException {
LocalizationContext siteContext = pathMgr.getContext(
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
LocalizationFile lFile = pathMgr.getLocalizationFile(siteContext,

View file

@ -46,7 +46,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager;
@ -93,6 +93,8 @@ import com.vividsolutions.jts.io.WKBReader;
* 07/15/13 2184 dhladky Remove all HUC's for storage except ALL
* Nov 18, 2014 3831 dhladky StatusHandler logging. Proper list sizing. Geometry chunk sizing.
* Aug 08, 2015 4722 dhladky Improved Grid support.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author dhladky
@ -163,7 +165,7 @@ public class FFMPTemplates {
.getHandler(FFMPTemplates.class);
private final IPathManager pathManager;
/**
* Single constructor
*
@ -197,10 +199,8 @@ public class FFMPTemplates {
/**
* EDEX constructor
*
* @param awipsShare
* DIR
* @param shareDir
* @param cwa
* @param primaryCWA
* @param mode
*/
public FFMPTemplates(DomainXML primaryCWA, MODE mode) {
this.pathManager = PathManagerFactory.getPathManager();
@ -222,7 +222,7 @@ public class FFMPTemplates {
public String getMode() {
return mode;
}
};
}
/**
* localization and such
@ -362,11 +362,12 @@ public class FFMPTemplates {
*/
private LinkedHashMap<String, FFMPVirtualGageBasinMetaData> readVGBFile(
String name, String cwa, String dataKey) {
HashMap<String, FFMPVirtualGageBasinMetaData> protoMap = readVGBDomainMap(
dataKey, cwa);
String[] list = readVGBDomainList(dataKey, cwa);
LinkedHashMap<String, FFMPVirtualGageBasinMetaData> map = new LinkedHashMap<String, FFMPVirtualGageBasinMetaData>(list.length, 1.0f);
LinkedHashMap<String, FFMPVirtualGageBasinMetaData> map = new LinkedHashMap<>(
list.length, 1.0f);
// construct ordered map
for (String lid : list) {
@ -416,13 +417,17 @@ public class FFMPTemplates {
list = null;
} catch (SerializationException se) {
statusHandler.error("Serialization Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, se);
statusHandler.error("Serialization Exception: Write VGB: cwa: "
+ cwa + " dataKey: " + dataKey, se);
} catch (FileNotFoundException fnfe) {
statusHandler.error("File Not found Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, fnfe);
statusHandler.error("File Not found Exception: Write VGB: cwa: "
+ cwa + " dataKey: " + dataKey, fnfe);
} catch (IOException ioe) {
statusHandler.error("IO Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, ioe);
} catch (LocalizationOpFailedException e) {
statusHandler.error("Localization Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, e);
statusHandler.error("IO Exception: Write VGB: cwa: " + cwa
+ " dataKey: " + dataKey, ioe);
} catch (LocalizationException e) {
statusHandler.error("Localization Exception: Write VGB: cwa: "
+ cwa + " dataKey: " + dataKey, e);
}
}
@ -489,13 +494,19 @@ public class FFMPTemplates {
list = null;
} catch (SerializationException se) {
statusHandler.error("Serialization Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, se);
statusHandler.error(
"Serialization Exception: Write Template: cwa: " + cwa
+ " dataKey:" + dataKey + " huc: " + huc, se);
} catch (FileNotFoundException fnfe) {
statusHandler.error("File Not found Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, fnfe);
statusHandler.error(
"File Not found Exception: Write Template: cwa: " + cwa
+ " dataKey:" + dataKey + " huc: " + huc, fnfe);
} catch (IOException ioe) {
statusHandler.error("IO Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, ioe);
} catch (LocalizationOpFailedException e) {
statusHandler.error("Localization Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, e);
statusHandler.error("IO Exception: Write Template: cwa: " + cwa
+ " dataKey:" + dataKey + " huc: " + huc, ioe);
} catch (LocalizationException e) {
statusHandler.error("Localization Exception: Write Template: cwa: "
+ cwa + " dataKey:" + dataKey + " huc: " + huc, e);
}
}
@ -637,6 +648,10 @@ public class FFMPTemplates {
try {
rpfaf = getAggregatedPfaf(pfaf, dataKey, huc);
} catch (NullPointerException npe) {
// FIXME
npe.printStackTrace();
System.err.println("NPE for pfaf=" + pfaf + ", dataKey=" + dataKey
+ ", huc=" + huc);
}
return rpfaf;
}
@ -644,7 +659,9 @@ public class FFMPTemplates {
/**
* Finds the aggregated pfaf of a given VGB
*
* @param pfaf
* @param lid
* @param dataKey
* @param huc
* @return
*/
public Long findAggregatedVGB(String lid, String dataKey, String huc) {
@ -846,7 +863,8 @@ public class FFMPTemplates {
}
}
} catch (Exception e) {
statusHandler.error("Find Basin by lon lat failed: dataKey: "+dataKey+ " coor:"+coor.toString(), e);
statusHandler.error("Find Basin by lon lat failed: dataKey: "
+ dataKey + " coor:" + coor.toString(), e);
}
return null;
@ -877,7 +895,9 @@ public class FFMPTemplates {
/**
* Finds the center of an aggregation of basins (Roughly)
*
* @param arrayList
* @param pfaf
* @param dataKey
* @param huc
* @return
*/
public Coordinate findAggregationCenter(Long pfaf, String dataKey,
@ -967,9 +987,9 @@ public class FFMPTemplates {
}
/**
* Gets the starting index for searching
* Sets the starting index for searching
*
* @return
* @param hucDepthStart
*/
public void setHucDepthStart(int hucDepthStart) {
this.hucDepthStart = hucDepthStart;
@ -1010,7 +1030,8 @@ public class FFMPTemplates {
}
} catch (Exception e) {
statusHandler.error("Failed to lookup County: dataKey: "+dataKey, e);
statusHandler.error("Failed to lookup County: dataKey: " + dataKey,
e);
}
FFMPCounties counties = new FFMPCounties(countyList);
@ -1021,7 +1042,8 @@ public class FFMPTemplates {
/**
* Finds the parent aggregated pfaf of a given pfaf.
*
* @param pfaf
* @param key
* @param dataKey
* @param huc
* @return
*/
@ -1085,16 +1107,16 @@ public class FFMPTemplates {
Rectangle rect = null;
rect = HRAPCoordinates.getHRAPCoordinates();
rect.setBounds(rect.x * primeSource.getHrapGridFactor(), rect.y
* primeSource.getHrapGridFactor(), rect.width
* primeSource.getHrapGridFactor(), rect.height
* primeSource.getHrapGridFactor());
rect = HRAPCoordinates.getHRAPCoordinates();
rect.setBounds(rect.x * primeSource.getHrapGridFactor(), rect.y
* primeSource.getHrapGridFactor(),
rect.width * primeSource.getHrapGridFactor(), rect.height
* primeSource.getHrapGridFactor());
HRAPSubGrid hrapgrid = new HRAPSubGrid(rect,
primeSource.getHrapGridFactor());
Geometry geo = hrapgrid.getGeometry();
siteExtents = FFMPUtils.getGeometryText(geo);
HRAPSubGrid hrapgrid = new HRAPSubGrid(rect,
primeSource.getHrapGridFactor());
Geometry geo = hrapgrid.getGeometry();
siteExtents = FFMPUtils.getGeometryText(geo);
} else if (primeSource.getDataType().equals(
FFMPSourceConfigurationManager.DATA_TYPE.RADAR.getDataType())) {
@ -1108,7 +1130,8 @@ public class FFMPTemplates {
} else if (primeSource.getDataType().equals(
FFMPSourceConfigurationManager.DATA_TYPE.GRID.getDataType())) {
// extract the Grid Coverage for use in site extents creation
GridCoverage coverage = FFMPUtils.getGridCoverageRecord(primeSource.getDataPath());
GridCoverage coverage = FFMPUtils.getGridCoverageRecord(primeSource
.getDataPath());
siteExtents = FFMPUtils.getGeometryText(coverage.getGeometry());
} else if (primeSource.getDataType().equals(
FFMPSourceConfigurationManager.DATA_TYPE.PDO.getDataType())) {
@ -1127,7 +1150,7 @@ public class FFMPTemplates {
/**
* Sets the extents
*
* @param extents
* @param maxExtent
*/
public void setExtents(double maxExtent) {
this.maxExtent = maxExtent;
@ -1170,7 +1193,9 @@ public class FFMPTemplates {
getMaxExtent(), getSiteExtents(dataKey),
mode.getMode()));
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, "Unable to create FFMP Template for this dataKey: "+dataKey, e);
statusHandler.handle(Priority.PROBLEM,
"Unable to create FFMP Template for this dataKey: "
+ dataKey, e);
}
} else if (huc.equals(FFMPRecord.COUNTY)) {
list = getCountyFips(cwa, dataKey);
@ -1548,7 +1573,9 @@ public class FFMPTemplates {
/**
* Gets the Virtual Gage Basin MetaData
*
* @param pfaf
* @param dataKey
* @param cwa
* @param parentPfaf
* @return
*/
public synchronized ArrayList<FFMPVirtualGageBasinMetaData> getVirtualGageBasinMetaData(
@ -1745,19 +1772,20 @@ public class FFMPTemplates {
SoftReference<Map<Long, Geometry>> rawGeomRef = cwaRawGeometries
.get(compositeKey);
Map<Long, Geometry> pfafGeometries = null;
if (rawGeomRef != null) {
pfafGeometries = rawGeomRef.get();
}
if (results != null && results.length > 0) {
if (pfafGeometries == null) {
pfafGeometries = new HashMap<Long, Geometry>(results.length, 1.0f);
pfafGeometries = new HashMap<Long, Geometry>(results.length,
1.0f);
cwaRawGeometries.put(compositeKey,
new SoftReference<Map<Long, Geometry>>(pfafGeometries));
}
for (int i = 0; i < results.length; i++) {
Object[] row = (Object[]) results[i];
basin = FFMPUtils.getMetaDataBasin(row, mode.getMode());
@ -1772,12 +1800,14 @@ public class FFMPTemplates {
if ((row.length >= (upstreamDepth + 9))
&& (row[upstreamDepth + 9] != null)) {
try {
pfafGeometries.put(basin.getPfaf(), reader
.read((byte[]) row[upstreamDepth + 9])
.buffer(0));
pfafGeometries.put(basin.getPfaf(),
reader.read((byte[]) row[upstreamDepth + 9])
.buffer(0));
} catch (Exception e) {
statusHandler.error("Failure to add rawGeometry in loadBasins: "+siteKey, e);
statusHandler.error(
"Failure to add rawGeometry in loadBasins: "
+ siteKey, e);
}
}
}
@ -1835,7 +1865,8 @@ public class FFMPTemplates {
/**
* Get the basin ID of the county
*
* @param name
* @param dataKey
* @param nameState
* @return
*/
@SuppressWarnings("unchecked")
@ -1995,9 +2026,11 @@ public class FFMPTemplates {
list = SerializationUtil.transformFromThrift(long[].class,
FileUtil.file2bytes(f.getFile(), true));
} catch (SerializationException se) {
statusHandler.error("Serialization Exception: Read Domain: cwa: "+cwa+" dataKey: "+dataKey+" huc: "+huc, se);
statusHandler.error("Serialization Exception: Read Domain: cwa: "
+ cwa + " dataKey: " + dataKey + " huc: " + huc, se);
} catch (IOException e) {
statusHandler.error("IO Exception: Read Domain: cwa: "+cwa+" dataKey: "+dataKey+" huc: "+huc, e);
statusHandler.error("IO Exception: Read Domain: cwa: " + cwa
+ " dataKey: " + dataKey + " huc: " + huc, e);
}
return list;
@ -2023,18 +2056,18 @@ public class FFMPTemplates {
try {
if (huc.equals(FFMPRecord.ALL)) {
map = (HashMap<Long, FFMPBasinMetaData>) SerializationUtil
.transformFromThrift(HashMap.class,
FileUtil.file2bytes(f.getFile(), true));
map = SerializationUtil.transformFromThrift(HashMap.class,
FileUtil.file2bytes(f.getFile(), true));
} else {
map = (HashMap<Long, long[]>) SerializationUtil
.transformFromThrift(HashMap.class,
FileUtil.file2bytes(f.getFile(), true));
map = SerializationUtil.transformFromThrift(HashMap.class,
FileUtil.file2bytes(f.getFile(), true));
}
} catch (SerializationException se) {
statusHandler.error("Serialization Exception: Domain Map: "+dataKey+" cwa:"+cwa+" huc: "+huc, se);
statusHandler.error("Serialization Exception: Domain Map: "
+ dataKey + " cwa:" + cwa + " huc: " + huc, se);
} catch (IOException e) {
statusHandler.error("IO Exception: Domain Map: "+dataKey+" cwa:"+cwa+" huc: "+huc, e);
statusHandler.error("IO Exception: Domain Map: " + dataKey
+ " cwa:" + cwa + " huc: " + huc, e);
}
return map;
@ -2059,13 +2092,14 @@ public class FFMPTemplates {
getAbsoluteFileName(dataKey, FFMPRecord.VIRTUAL, cwa, "map"));
try {
map = (HashMap<String, FFMPVirtualGageBasinMetaData>) SerializationUtil
.transformFromThrift(HashMap.class,
FileUtil.file2bytes(f.getFile(), true));
map = SerializationUtil.transformFromThrift(HashMap.class,
FileUtil.file2bytes(f.getFile(), true));
} catch (SerializationException se) {
statusHandler.error("Serialization Exception: Virtual Basins: "+dataKey+" cwa: "+cwa, se);
statusHandler.error("Serialization Exception: Virtual Basins: "
+ dataKey + " cwa: " + cwa, se);
} catch (IOException e) {
statusHandler.error("IO Exception: Virtual Basins: "+dataKey+" cwa: "+cwa, e);
statusHandler.error("IO Exception: Virtual Basins: " + dataKey
+ " cwa: " + cwa, e);
}
return map;
@ -2091,9 +2125,12 @@ public class FFMPTemplates {
list = SerializationUtil.transformFromThrift(String[].class,
FileUtil.file2bytes(f.getFile(), true));
} catch (SerializationException se) {
statusHandler.error("Serialization Exception: : Read Virtual Domain: cwa: "+cwa+" dataKey: "+dataKey, se);
statusHandler.error(
"Serialization Exception: : Read Virtual Domain: cwa: "
+ cwa + " dataKey: " + dataKey, se);
} catch (IOException e) {
statusHandler.error("IO Exception: : Read Virtual Domain: cwa: "+cwa+" dataKey: "+dataKey, e);
statusHandler.error("IO Exception: : Read Virtual Domain: cwa: "
+ cwa + " dataKey: " + dataKey, e);
}
return list;
@ -2301,7 +2338,7 @@ public class FFMPTemplates {
* Gets a metadata basin contained within the domain listed.
*
* @param dataKey
* @param domainName
* @param domains
* @param pfafs
* @return
*/
@ -2362,10 +2399,14 @@ public class FFMPTemplates {
if (res >= 0.004) {
try {
list = FFMPUtils.getUniqueCountyFips(cwa, getMaxExtent(),
getSiteExtents(dataKey), mode.getMode(), resolution);
list = FFMPUtils
.getUniqueCountyFips(cwa, getMaxExtent(),
getSiteExtents(dataKey), mode.getMode(),
resolution);
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, "Unable to create FFMP Template for this dataKey: "+dataKey, e);
statusHandler.handle(Priority.PROBLEM,
"Unable to create FFMP Template for this dataKey: "
+ dataKey, e);
}
if (list.size() > 0) {

View file

@ -40,6 +40,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -70,6 +71,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
* loading them.
* Apr 25, 2013 1954 bsteffen Undo last commit to avoid invalid geoms.
* Jul 03, 2013 2152 rjpeter Use streams for serialization
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -213,7 +215,7 @@ public class HucLevelGeometriesFactory {
protected synchronized Map<Long, Geometry> generateSimplifiedGeometry(
FFMPTemplates template, String dataKey, String cwa,
Collection<Long> pfafs) throws Exception {
Collection<Long> pfafs) {
Map<Long, Geometry> rawGeometries = template.getRawGeometries(dataKey,
cwa);
Map<Long, Geometry> simplifiedGeometries = new HashMap<Long, Geometry>(
@ -422,8 +424,7 @@ public class HucLevelGeometriesFactory {
}
public synchronized Envelope getEnvelope(FFMPTemplates template,
String dataKey, String cwa, String huc, Long pfafId)
throws Exception {
String dataKey, String cwa, String huc, Long pfafId) {
return getEnvelopes(template, dataKey, cwa, huc).get(pfafId);
}
@ -492,7 +493,7 @@ public class HucLevelGeometriesFactory {
if (deleteFile) {
try {
f.delete();
} catch (LocalizationOpFailedException lope) {
} catch (LocalizationException lope) {
statusHandler.handle(Priority.WARN,
"Can't delete file.");
}

View file

@ -33,7 +33,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManager;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.menus.MenuSerialization;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -50,7 +49,8 @@ import com.raytheon.uf.common.status.UFStatus;
* ------------ ---------- ----------- --------------------------
* Nov 08, 2012 mschenke Initial javadoc creation
* Mar 11, 2014 2858 mpduff javadoc updates
* Oct 15, 2015 4897 bkowal Made {@link #pm} protected.
* Oct 15, 2015 4897 bkowal Made PathManager pm protected.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -118,9 +118,7 @@ public abstract class AbstractMenuUtil {
marshaller.marshal(object, pm.getFile(caveConfigured, path));
file.save();
} catch (JAXBException e) {
statusHandler.error("Unable to process the menu: " + path, e);
} catch (LocalizationOpFailedException e) {
} catch (JAXBException | LocalizationException e) {
statusHandler.error("Unable to process the menu: " + path, e);
}
}

View file

@ -65,7 +65,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.DATA_TYPE;
@ -142,6 +141,8 @@ import com.raytheon.uf.edex.plugin.ffmp.common.FFTIRatioDiff;
* Aug 08, 2015 4722 dhladky Generalized the processing of FFMP data types.
* Sep 09, 2015 4756 dhladky Further generalization of FFG processing.
* Sep 21, 2015 4756 dhladky Allow ARCHIVE types to not be purged out.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author dhladky
@ -157,8 +158,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
/**
* Public constructor for FFMPGenerator
*
* @param name
* @param compositeProductType
* @param executor
*/
public FFMPGenerator(Executor executor) {
@ -397,7 +397,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements
DomainXML domain = runner.getPrimaryDomain();
try {
tmp.add(new FFMPURIFilter(getSiteString(runner) + ":"
+ getGuidanceComparedString(runner) + ":" + domain.getCwa()));
+ getGuidanceComparedString(runner) + ":"
+ domain.getCwa()));
statusHandler.handle(Priority.INFO, "Created FFMP Filter.."
+ " primary Domain: " + domain.getCwa());
@ -560,7 +561,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
/**
* Set list of CWA's
*
* @param cwas
* @param domains
*/
public void setDomains(ArrayList<DomainXML> domains) {
this.domains = domains;
@ -619,7 +620,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
// process all of the dataKeys for this source
for (String dataKey : dataHash.keySet()) {
ArrayList<String> sites = new ArrayList<String>();
// is it a mosaic?
@ -695,12 +696,13 @@ public class FFMPGenerator extends CompositeProductGenerator implements
// Go over all of the sites, if mosaic source, can be many.
for (String siteKey : sites) {
// No dataKey hash?, dataKey comes from primary source (siteKey)
// No dataKey hash?, dataKey comes from primary source
// (siteKey)
if (dataKey == null) {
dataKey = siteKey;
}
FFMPRecord ffmpRec = new FFMPRecord();
ffmpRec.setSourceName(ffmpProduct.getSourceName());
ffmpRec.setDataKey(dataKey);
@ -709,7 +711,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
FFMPProcessor ffmp = new FFMPProcessor(config, generator,
ffmpRec, template);
ffmpRec = ffmp.processFFMP(ffmpProduct);
if (ffmpRec != null) {
persistRecord(ffmpRec);
@ -812,7 +814,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements
/**
*
* @param domain
* @return
*/
public void createUnifiedGeometries(DomainXML domain) {
ArrayList<String> hucsToGen = new ArrayList<String>();
@ -895,7 +896,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements
}
/**
* Gets the string buffer for the Guidance sources you wish to compare in FFMP
* Gets the string buffer for the Guidance sources you wish to compare in
* FFMP
*
* @param run
* @return
@ -918,7 +920,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
}
break;
}
// TODO: Implement other types when available
// TODO: Implement other types when available
}
return buf.toString();
}
@ -970,14 +972,10 @@ public class FFMPGenerator extends CompositeProductGenerator implements
statusHandler.handle(Priority.INFO, "Wrote FFMP source Bin File: "
+ sourceList.getSourceId());
} catch (SerializationException se) {
se.printStackTrace();
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (LocalizationOpFailedException e) {
e.printStackTrace();
} catch (Exception e) {
statusHandler.error(
"Error writing FFMP source bin file for source "
+ sourceList.getSourceId(), e);
}
}
@ -1056,8 +1054,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements
}
/**
* Do pull strategy on FFG data, currently works with
* Gridded FFG sources only. (There are only gridded sources so far)
* Do pull strategy on FFG data, currently works with Gridded FFG sources
* only. (There are only gridded sources so far)
*
* @param filter
* @return
@ -1117,7 +1115,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements
uriComps[3], uriComps[7], plugin));
}
} catch (Exception e) {
statusHandler.error("Problem with extracting guidance source URI's. source: "+guidSource, e);
statusHandler.error(
"Problem with extracting guidance source URI's. source: "
+ guidSource, e);
}
}
}
@ -1146,10 +1146,10 @@ public class FFMPGenerator extends CompositeProductGenerator implements
filter.getSources().put(matchKey, dataUri);
}
} catch (Exception e) {
statusHandler.handle(
Priority.ERROR,
"Unable to locate new FFG file. "
+ dataUri, e);
statusHandler
.handle(Priority.ERROR,
"Unable to locate new FFG file. "
+ dataUri, e);
}
}
}
@ -1162,7 +1162,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements
/**
* get the FFMP data container for this source
*
* @param sourceName
* @param siteSourceKey
* @param backDate
*
* @return
*/
@ -1293,8 +1294,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements
*/
if (source.getGuidanceType().equals(
GUIDANCE_TYPE.ARCHIVE.getGuidanceType())) {
/** ARCHIVE types have the refTime of when it was loaded.
* This will have it look back 1 day previous to the reftime
/**
* ARCHIVE types have the refTime of when it was loaded.
* This will have it look back 1 day previous to the reftime
* and purge anything older than that.
*/
backDate = new Date(
@ -1435,9 +1437,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements
* load existing container
*
* @param sourceSiteDataKey
* @param hucs
* @param siteKey
* @param wfo
* @param backDate
* @return
*/
public FFMPDataContainer loadFFMPDataContainer(String sourceSiteDataKey,
@ -1549,8 +1551,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
/**
* The actual work gets done here
*/
public void write() throws Exception {
public void write() {
try {
FFMPAggregateRecord aggRecord = null;
@ -1702,7 +1703,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements
/**
* Write your FFTI Data files
*
* @param sourceList
* @param ffti
* @param fftiName
*/
public void writeFFTIFile(FFTIData ffti, String fftiName) {
@ -1721,21 +1723,15 @@ public class FFMPGenerator extends CompositeProductGenerator implements
statusHandler.handle(Priority.DEBUG, "Wrote FFMP FFTI file: "
+ fftiName);
} catch (SerializationException se) {
se.printStackTrace();
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (LocalizationOpFailedException e) {
e.printStackTrace();
} catch (Exception e) {
statusHandler.error("Error writing FFTI file " + fftiName, e);
}
}
/**
* Read out your FFTI Files
*
* @param sourceId
* @param fftiName
* @return
*/
public FFTIData readFFTIData(String fftiName) {
@ -2066,7 +2062,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements
* surge being sent to pypies.
*
* @param record
* @return
*/
private synchronized void persistRecord(FFMPRecord record) {

View file

@ -34,7 +34,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.plugin.nwsauth.xml.NwsRoleData;
import com.raytheon.uf.common.plugin.nwsauth.xml.PermissionXML;
import com.raytheon.uf.common.plugin.nwsauth.xml.RoleXML;
@ -59,6 +59,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* Jan 17, 2013 1412 djohnson Check files for having been modified each time data is requested,
* in case they were written by another member of the cluster.
* Mar 12, 2013 1646 mpduff Format the output.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -104,9 +105,6 @@ class FileManager {
return instance;
}
/**
* {@inheritDoc}
*/
public void save(String application) {
NwsRoleData roleData = roleDataMap.get(application);
LocalizationFile lf = roleFileMap.get(application);
@ -123,10 +121,7 @@ class FileManager {
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(roleData, locFile.getFile());
locFile.save();
} catch (JAXBException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
} catch (LocalizationOpFailedException e) {
} catch (JAXBException | LocalizationException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}

View file

@ -76,7 +76,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.registry.constants.ActionTypes;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
import com.raytheon.uf.common.registry.constants.DeletionScope;
@ -174,6 +174,8 @@ import com.raytheon.uf.edex.security.SecurityConfiguration;
* 5/11/2015 4448 bphillip Separated EBXML Registry from Data Delivery
* 5/29/2015 4448 bphillip Added default user to registry on startup
* 10/20/2015 4992 dhladky Improve error handling.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author bphillip
@ -204,19 +206,18 @@ public class RegistryFederationManager implements IRegistryFederationManager,
/** The mode that EDEX was started in */
public static final boolean centralRegistry;
/** registry user property **/
public static final String EDEX_SECURITY_AUTH_USER = "edex.security.auth.user";
/** registry user password **/
public static final String EDEX_SECURITY_AUTH_PASSWORD = "edex.security.auth.password";
/** Local (client) level adminstrator user **/
public static final String REGISTRY_LOCAL_ADMIN = "RegistryLocalAdministrator";
/** Registry adminstrator (central) **/
public static final String REGISTRY_ADMIN = "RegistryAdministrator";
static {
try {
@ -341,7 +342,7 @@ public class RegistryFederationManager implements IRegistryFederationManager,
"Unable to locate federation configuration file: "
+ FEDERATION_CONFIG_FILE);
} else {
federationProperties = (FederationProperties) jaxbManager
federationProperties = jaxbManager
.unmarshalFromXmlFile(
FederationProperties.class,
federationPropertiesFile);
@ -391,6 +392,7 @@ public class RegistryFederationManager implements IRegistryFederationManager,
}
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
txTemplate.execute(new TransactionCallbackWithoutResult() {
@ -415,14 +417,17 @@ public class RegistryFederationManager implements IRegistryFederationManager,
* The registry super user initially gets the default
* password which *must* be changed immediately
*/
statusHandler
.info(REGISTRY_ADMIN+" Not present in Central Registry! Adding user: "+REGISTRY_ADMIN);
statusHandler.info(REGISTRY_ADMIN
+ " Not present in Central Registry! Adding user: "
+ REGISTRY_ADMIN);
registryUsers.addUser(RegistryUtil.registryUser,
"password", REGISTRY_ADMIN);
} else {
statusHandler
.info(REGISTRY_ADMIN+ " present in Central Registry: "+REGISTRY_ADMIN);
.info(REGISTRY_ADMIN
+ " present in Central Registry: "
+ REGISTRY_ADMIN);
}
} else if (!centralRegistry) {
@ -450,8 +455,8 @@ public class RegistryFederationManager implements IRegistryFederationManager,
}
}
} catch (MsgRegistryException e) {
throw new EbxmlRegistryException(
"Error Checking registry user! ", e);
throw new EbxmlRegistryException("Error Checking registry user! ",
e);
}
initialized.set(true);
@ -648,12 +653,13 @@ public class RegistryFederationManager implements IRegistryFederationManager,
}
@Override
@Transactional
@GET
@Path("updateRegistryEvents/{registryId}/{time}")
public void updateRegistryEvents(@PathParam("registryId")
String registryId, @PathParam("time")
String time) {
public void updateRegistryEvents(
@PathParam("registryId") String registryId,
@PathParam("time") String time) {
for (ReplicationEvent event : replicationEventDao
.getEventsBeforeTime(time)) {
event.addReplicatedTo(registryId);
@ -664,17 +670,17 @@ public class RegistryFederationManager implements IRegistryFederationManager,
/**
* Synchronizes this registry's data with the registry at the specified URL
*
* @param remoteRegistryUrl
* The URL of the registry to sync with
* @param registryId
* @throws EbxmlRegistryException
* If the thread executor fails to shut down properly
* @throws MsgRegistryException
*/
@Override
@Transactional
@GET
@Path("synchronizeWithRegistry/{registryId}")
public void synchronizeWithRegistry(@PathParam("registryId")
String registryId) throws Exception {
public void synchronizeWithRegistry(
@PathParam("registryId") String registryId) throws Exception {
if (SYNC_IN_PROGRESS.compareAndSet(false, true)) {
try {
@ -833,6 +839,7 @@ public class RegistryFederationManager implements IRegistryFederationManager,
}
}
@Override
@GET
@Path("isFederated")
@Transactional
@ -840,18 +847,21 @@ public class RegistryFederationManager implements IRegistryFederationManager,
return System.getProperty("ebxml.registry.federation.enabled");
}
@Override
@GET
@Path("clusterId")
public String clusterId() {
return RegistryIdUtil.getId();
}
@Override
@GET
@Path("siteId")
public String siteId() {
return EDEXUtil.getEdexSite();
}
@Override
@GET
@Path("getObjectTypesReplicated")
public String getObjectTypesReplicated() {
@ -859,6 +869,7 @@ public class RegistryFederationManager implements IRegistryFederationManager,
.toArray());
}
@Override
@GET
@Path("getFederationMembers")
@Transactional
@ -878,6 +889,7 @@ public class RegistryFederationManager implements IRegistryFederationManager,
return builder.toString();
}
@Override
@GET
@Path("getReplicatingTo")
@Transactional
@ -886,6 +898,7 @@ public class RegistryFederationManager implements IRegistryFederationManager,
.getRegistryReplicationServers().toArray());
}
@Override
@GET
@Path("getReplicatingFrom")
@Transactional
@ -910,11 +923,12 @@ public class RegistryFederationManager implements IRegistryFederationManager,
return RegistryQueryUtil.formatArrayString(registrySet.toArray());
}
@Override
@GET
@Path("subscribeToRegistry/{registryId}")
@Transactional
public void subscribeToRegistry(@PathParam("registryId")
String registryId) throws Exception {
public void subscribeToRegistry(@PathParam("registryId") String registryId)
throws Exception {
statusHandler.info("Establishing replication with [" + registryId
+ "]...");
RegistryType remoteRegistry = getRegistry(registryId);
@ -923,11 +937,12 @@ public class RegistryFederationManager implements IRegistryFederationManager,
statusHandler.info("Established replication with [" + registryId + "]");
}
@Override
@GET
@Path("unsubscribeFromRegistry/{registryId}")
@Transactional
public void unsubscribeFromRegistry(@PathParam("registryId")
String registryId) throws Exception {
public void unsubscribeFromRegistry(
@PathParam("registryId") String registryId) throws Exception {
statusHandler.info("Disconnecting replication with [" + registryId
+ "]...");
RegistryType remoteRegistry = getRegistry(registryId);
@ -937,21 +952,23 @@ public class RegistryFederationManager implements IRegistryFederationManager,
.info("Disconnected replication with [" + registryId + "]");
}
@Override
@GET
@Path("addReplicationServer/{registryId}")
@Transactional
public void addReplicationServer(@PathParam("registryId")
String registryId) throws Exception {
public void addReplicationServer(@PathParam("registryId") String registryId)
throws Exception {
getRegistry(registryId);
servers.addReplicationServer(registryId);
saveNotificationServers();
}
@Override
@GET
@Path("removeReplicationServer/{registryId}")
@Transactional
public void removeReplicationServer(@PathParam("registryId")
String registryId) throws Exception {
public void removeReplicationServer(
@PathParam("registryId") String registryId) throws Exception {
getRegistry(registryId);
servers.removeReplicationServer(registryId);
saveNotificationServers();
@ -988,12 +1005,10 @@ public class RegistryFederationManager implements IRegistryFederationManager,
try {
jaxbManager.marshalToXmlFile(servers, file.getAbsolutePath());
lf.save();
} catch (SerializationException e) {
statusHandler.error("Unable to update replication server file!", e);
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.ERROR, e.getLocalizedMessage(), e);
}
}