Issue #2020 - Implement Shared Subscriptions Cave-side.
Change-Id: I96e156043ec34e7ec98c2d8c3aafb6916c31e7cf Former-commit-id: 1e00c7f935cf22ac5064060069164af6044f2150
This commit is contained in:
parent
9533bb686d
commit
192ce891d0
82 changed files with 2176 additions and 846 deletions
|
@ -30,7 +30,8 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.uf.common.datadelivery.bandwidth;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.datadelivery.retrieval;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.units;bundle-version="1.0.0"
|
||||
com.raytheon.uf.common.units;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.site;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.uf.viz.datadelivery;uses:="org.eclipse.ui.plugin,org.osgi.framework",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
class="com.raytheon.uf.viz.datadelivery.handlers.VizSubscriptionHandler">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.UserSubscriptionHandler" />
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.SiteSubscriptionHandler" />
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<bean
|
||||
|
@ -20,7 +20,7 @@
|
|||
class="com.raytheon.uf.viz.datadelivery.handlers.VizPendingSubscriptionHandler">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.PendingUserSubscriptionHandler" />
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.PendingSiteSubscriptionHandler" />
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<bean
|
||||
|
|
|
@ -114,6 +114,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Dec 12, 2012 1391 bgonzale Added job for dataset retrieval.
|
||||
* Jan 08, 2012 1436 bgonzale Fixed area text box display update check.
|
||||
* Jan 14, 2012 1437 bgonzale Clear filters when creating a new configuration.
|
||||
* May 15, 2013 1040 mpduff Put DataDeliveryGUIUtils.markNotBusyInUIThread in finally block.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1073,11 +1074,15 @@ public class DataBrowserDlg extends CaveSWTDialog implements IDataTableUpdate,
|
|||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if (!dataTableComp.isDisposed()) {
|
||||
dataTableComp.updateTable(matchingDataSets);
|
||||
updateTableEntriesLabel();
|
||||
}
|
||||
DataDeliveryGUIUtils.markNotBusyInUIThread(jobParent);
|
||||
} finally {
|
||||
DataDeliveryGUIUtils
|
||||
.markNotBusyInUIThread(jobParent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 27, 2012 702 jpiatt Initial creation.
|
||||
* May 15, 2013 1040 mpduff Fixed button width.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -148,8 +149,6 @@ public class DurationComp extends Composite {
|
|||
}
|
||||
});
|
||||
|
||||
int buttonWidth = 85;
|
||||
GridData btnData = new GridData(buttonWidth, SWT.DEFAULT);
|
||||
int textWidth = 100;
|
||||
GridData textData = new GridData(textWidth, SWT.DEFAULT);
|
||||
|
||||
|
@ -171,17 +170,19 @@ public class DurationComp extends Composite {
|
|||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
if (!DataDeliveryGUIUtils.validateDate(false, startText.getText())) {
|
||||
DataDeliveryUtils.showMessage(getShell(), SWT.ERROR, "Invalid Date/Time",
|
||||
"Invalid Starting Date/Time entered.\n\n" + "Please use the Select Date button\n"
|
||||
if (!DataDeliveryGUIUtils.validateDate(false,
|
||||
startText.getText())) {
|
||||
DataDeliveryUtils.showMessage(getShell(), SWT.ERROR,
|
||||
"Invalid Date/Time",
|
||||
"Invalid Starting Date/Time entered.\n\n"
|
||||
+ "Please use the Select Date button\n"
|
||||
+ "to select the date/time.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
startDateBtn = new Button(periodComp, SWT.PUSH);
|
||||
startDateBtn.setText("Select Date");
|
||||
startDateBtn.setLayoutData(btnData);
|
||||
startDateBtn.setText(" Select Date ");
|
||||
startDateBtn.setEnabled(false);
|
||||
startDateBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -205,17 +206,17 @@ public class DurationComp extends Composite {
|
|||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
if (!DataDeliveryGUIUtils.validateDate(false, endText.getText())) {
|
||||
DataDeliveryUtils.showMessage(getShell(), SWT.ERROR, "Invalid Date/Time",
|
||||
"Invalid End Date/Time entered.\n\n" + "Please use the Select Date button\n"
|
||||
DataDeliveryUtils.showMessage(getShell(), SWT.ERROR,
|
||||
"Invalid Date/Time",
|
||||
"Invalid End Date/Time entered.\n\n"
|
||||
+ "Please use the Select Date button\n"
|
||||
+ "to select the date/time.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btnData = new GridData(buttonWidth, SWT.DEFAULT);
|
||||
endDateBtn = new Button(periodComp, SWT.PUSH);
|
||||
endDateBtn.setText("Select Date");
|
||||
endDateBtn.setLayoutData(btnData);
|
||||
endDateBtn.setText(" Select Date ");
|
||||
endDateBtn.setEnabled(false);
|
||||
endDateBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -233,10 +234,12 @@ public class DurationComp extends Composite {
|
|||
if (d != null) {
|
||||
startDate = d;
|
||||
try {
|
||||
startText.setText(DataDeliveryGUIUtils.getSubscriptionFormat().format(startDate) + "Z");
|
||||
startText.setText(DataDeliveryGUIUtils.getSubscriptionFormat()
|
||||
.format(startDate) + "Z");
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Invalid date format - format needs to be " +
|
||||
"MM/dd/yyyy HH", e);
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Invalid date format - format needs to be "
|
||||
+ "MM/dd/yyyy HH", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,10 +253,12 @@ public class DurationComp extends Composite {
|
|||
if (d != null) {
|
||||
endDate = d;
|
||||
try {
|
||||
endText.setText(DataDeliveryGUIUtils.getSubscriptionFormat().format(endDate) + "Z");
|
||||
endText.setText(DataDeliveryGUIUtils.getSubscriptionFormat()
|
||||
.format(endDate) + "Z");
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Invalid date format - format needs to be " +
|
||||
"MM/dd/yyyy HH", e);
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Invalid date format - format needs to be "
|
||||
+ "MM/dd/yyyy HH", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -274,7 +279,7 @@ public class DurationComp extends Composite {
|
|||
Object obj = ac.open();
|
||||
|
||||
if ((obj != null) && (obj instanceof Calendar)) {
|
||||
return ((Calendar)obj).getTime();
|
||||
return ((Calendar) obj).getTime();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -283,8 +288,7 @@ public class DurationComp extends Composite {
|
|||
/**
|
||||
* Get the does not expire radio button selection.
|
||||
*
|
||||
* @return boolean
|
||||
* true if checked
|
||||
* @return boolean true if checked
|
||||
*/
|
||||
public boolean isIndefiniteChk() {
|
||||
return indefiniteChk.getSelection();
|
||||
|
@ -369,7 +373,9 @@ public class DurationComp extends Composite {
|
|||
* @param startDate
|
||||
*/
|
||||
public void setStartDate(Date startDate) {
|
||||
startText.setText(DataDeliveryGUIUtils.getSubscriptionFormat().format(startDate) + "Z");
|
||||
startText.setText(DataDeliveryGUIUtils.getSubscriptionFormat().format(
|
||||
startDate)
|
||||
+ "Z");
|
||||
startText.setEnabled(true);
|
||||
startDateBtn.setEnabled(true);
|
||||
this.startDate = startDate;
|
||||
|
@ -381,7 +387,9 @@ public class DurationComp extends Composite {
|
|||
* @param endDate
|
||||
*/
|
||||
public void setEndDate(Date endDate) {
|
||||
endText.setText(DataDeliveryGUIUtils.getSubscriptionFormat().format(endDate) + "Z");
|
||||
endText.setText(DataDeliveryGUIUtils.getSubscriptionFormat().format(
|
||||
endDate)
|
||||
+ "Z");
|
||||
endText.setEnabled(true);
|
||||
endDateBtn.setEnabled(true);
|
||||
this.endDate = endDate;
|
||||
|
@ -389,6 +397,7 @@ public class DurationComp extends Composite {
|
|||
|
||||
/**
|
||||
* Check if dates are valid.
|
||||
*
|
||||
* @return true if dates are valid
|
||||
*/
|
||||
public boolean isValidChk() {
|
||||
|
@ -396,29 +405,33 @@ public class DurationComp extends Composite {
|
|||
boolean dateOrderValid = false;
|
||||
|
||||
if (!isIndefiniteChk()) {
|
||||
boolean validateDur = DataDeliveryGUIUtils.validateDate(false, getStartText());
|
||||
boolean validateDur = DataDeliveryGUIUtils.validateDate(false,
|
||||
getStartText());
|
||||
if (validateDur) {
|
||||
|
||||
validateDur = DataDeliveryGUIUtils.validateDate(false, getEndText());
|
||||
validateDur = DataDeliveryGUIUtils.validateDate(false,
|
||||
getEndText());
|
||||
if (validateDur) {
|
||||
datesValid = true;
|
||||
dateOrderValid = DataDeliveryGUIUtils.checkDateOrder(getStartText(), getEndText(), true);
|
||||
dateOrderValid = DataDeliveryGUIUtils.checkDateOrder(
|
||||
getStartText(), getEndText(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
datesValid = true;
|
||||
dateOrderValid = true;
|
||||
}
|
||||
|
||||
// Display error message
|
||||
if (!datesValid) {
|
||||
DataDeliveryUtils.showMessage(parentComp.getShell(), SWT.ERROR, "Invalid Date/Time",
|
||||
"Invalid Subscription Duration values entered.\n\n" + "Please use the Select Date button\n"
|
||||
DataDeliveryUtils.showMessage(parentComp.getShell(), SWT.ERROR,
|
||||
"Invalid Date/Time",
|
||||
"Invalid Subscription Duration values entered.\n\n"
|
||||
+ "Please use the Select Date button\n"
|
||||
+ "to select the date/time.");
|
||||
}
|
||||
else if (!dateOrderValid) {
|
||||
DataDeliveryUtils.showMessage(parentComp.getShell(), SWT.ERROR, "Invalid Start/End Dates",
|
||||
} else if (!dateOrderValid) {
|
||||
DataDeliveryUtils.showMessage(parentComp.getShell(), SWT.ERROR,
|
||||
"Invalid Start/End Dates",
|
||||
"Invalid Start or Expiration Duration Date entered.\n\n"
|
||||
+ "The expiration date is before the start date.");
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
* Jun 21, 2012 736 djohnson Change OPERATION_STATUS to OperationStatus.
|
||||
* Dec 03, 2012 1269 mpduff Change to take a list of subscriptions for the view mode.
|
||||
* Dec 10, 2012 1300 bgonzale Table filtering by dataset and provider.
|
||||
* May 23, 2012 2020 mpduff Implement method.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -64,13 +65,13 @@ public class SubscriptionViewer extends AbstractViewDlg implements
|
|||
/**
|
||||
* Provider name associated with subscriptions. i.e. NOMADS, NCDC,...
|
||||
*/
|
||||
private String providerName;
|
||||
private final String providerName;
|
||||
|
||||
/**
|
||||
* Dataset name that the subscriptions are associated with. i.e. gfs,
|
||||
* nam,...
|
||||
*/
|
||||
private String datasetName;
|
||||
private final String datasetName;
|
||||
|
||||
/** Table composite */
|
||||
private SubscriptionTableComp tableComp;
|
||||
|
@ -237,4 +238,12 @@ public class SubscriptionViewer extends AbstractViewDlg implements
|
|||
public void activateButtonUpdate(String text) {
|
||||
// Not used.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void updateControls() {
|
||||
// Not used.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
|
|||
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
|
||||
* Jan 02, 2013 1441 djohnson Access GroupDefinitionManager in a static fashion.
|
||||
* Apr 08, 2013 1826 djohnson Remove unused code, delivery options.
|
||||
* May 15, 2013 1040 mpduff OfficeID is now a list so need to add it rather than set it.
|
||||
* </pre>
|
||||
*
|
||||
* @author jpiatt
|
||||
|
@ -276,8 +277,7 @@ public class UserSelectComp extends Composite implements IUpdate, IDisplay,
|
|||
.getSelectedListItems());
|
||||
|
||||
Set<String> differences = Sets.symmetricDifference(
|
||||
selectedSubscriptionNames,
|
||||
initiallySelectedSubscriptions);
|
||||
selectedSubscriptionNames, initiallySelectedSubscriptions);
|
||||
|
||||
Set<Subscription> addedToGroup = new HashSet<Subscription>();
|
||||
Set<Subscription> removedFromGroup = new HashSet<Subscription>();
|
||||
|
@ -335,8 +335,7 @@ public class UserSelectComp extends Composite implements IUpdate, IDisplay,
|
|||
}
|
||||
|
||||
updateGroupDefinitionForSubscriptions(groupName,
|
||||
groupSubscriptionsForUpdate,
|
||||
removedFromGroup);
|
||||
groupSubscriptionsForUpdate, removedFromGroup);
|
||||
|
||||
timer.stop();
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
|
@ -408,19 +407,16 @@ public class UserSelectComp extends Composite implements IUpdate, IDisplay,
|
|||
subscription.setCoverage(cov);
|
||||
}
|
||||
|
||||
subscription.setOfficeID(LocalizationManager.getInstance()
|
||||
subscription.addOfficeID(LocalizationManager.getInstance()
|
||||
.getCurrentSite());
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
final ISubscriptionServiceResult result = DataDeliveryServices
|
||||
.getSubscriptionService().updateWithPendingCheck(
|
||||
new ArrayList<Subscription>(Sets.union(
|
||||
groupSubscriptions,
|
||||
removeFromGroupSubscriptions)),
|
||||
this);
|
||||
removeFromGroupSubscriptions)), this);
|
||||
if (result.hasMessageToDisplay()) {
|
||||
DataDeliveryUtils.showMessage(getShell(), SWT.ICON_INFORMATION,
|
||||
"Edit Group", result.getMessageToDisplay());
|
||||
|
|
|
@ -81,6 +81,7 @@ import com.raytheon.viz.ui.widgets.duallist.DualListConfig;
|
|||
* icon update when loading from a file.
|
||||
* Feb 24, 2013 1620 mpduff Fixed set clean issue when loading configurations. Set clean
|
||||
* needs to be called after the data load job is complete.
|
||||
* May 15, 2013 1040 mpduff Called markNotBusyInUIThread.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -193,13 +194,13 @@ public class FilterExpandBar extends Composite implements IFilterUpdate,
|
|||
|
||||
private void createExpandItems() {
|
||||
if (dataTypes != null && dataTypes.length > 0) {
|
||||
final Shell jobParent = this.getShell();
|
||||
final Shell parentShell = this.getShell();
|
||||
final Job job = new Job("Dataset Discovery...") {
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
MetaDataManager dataManager = MetaDataManager.getInstance();
|
||||
|
||||
DataDeliveryGUIUtils.markBusyInUIThread(jobParent);
|
||||
DataDeliveryGUIUtils.markBusyInUIThread(parentShell);
|
||||
dataManager.rereadMetaData();
|
||||
dataManager.readMetaData(dataTypes[0]);
|
||||
return Status.OK_STATUS;
|
||||
|
@ -209,6 +210,7 @@ public class FilterExpandBar extends Composite implements IFilterUpdate,
|
|||
job.addJobChangeListener(new JobChangeAdapter() {
|
||||
@Override
|
||||
public void done(IJobChangeEvent event) {
|
||||
try {
|
||||
DataTypeFilterElementXML dtfe;
|
||||
HashMap<String, ArrayList<String>> dataFilterMap = new HashMap<String, ArrayList<String>>();
|
||||
|
||||
|
@ -216,7 +218,8 @@ public class FilterExpandBar extends Composite implements IFilterUpdate,
|
|||
for (int i = 0; i < dataTypes.length; i++) {
|
||||
String dataType = dataTypes[i];
|
||||
dtfe = dataTypeFilterXml.getFilterData(dataType);
|
||||
ArrayList<String> filterIDList = dtfe.getFilterIDList();
|
||||
ArrayList<String> filterIDList = dtfe
|
||||
.getFilterIDList();
|
||||
dataFilterMap.put(dataType, filterIDList);
|
||||
}
|
||||
|
||||
|
@ -229,25 +232,28 @@ public class FilterExpandBar extends Composite implements IFilterUpdate,
|
|||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Now we have a list of common filters, lets build
|
||||
// Now we have a list of common filters, lets
|
||||
// build
|
||||
// them
|
||||
for (String filter : filterList) {
|
||||
final FilterElementsXML fex = filterXml
|
||||
.getFilter(filter);
|
||||
String clazz = fex.getClazz();
|
||||
|
||||
// TODO use reflection here to instantiate the
|
||||
// TODO use reflection here to instantiate
|
||||
// the
|
||||
// class
|
||||
if (clazz.equals("FilterComp")) {
|
||||
createFilter(fex);
|
||||
}
|
||||
}
|
||||
notifyListeners(SWT.SetData, new Event());
|
||||
DataDeliveryGUIUtils
|
||||
.markNotBusyInUIThread(jobParent);
|
||||
setClean();
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
DataDeliveryGUIUtils.markNotBusyInUIThread(parentShell);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.util.List;
|
|||
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionDeleteRequest;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingSharedSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingSiteSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingUserSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.PendingSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
@ -44,6 +44,7 @@ import com.raytheon.uf.common.serialization.comm.RequestRouter;
|
|||
* Sep 27, 2012 1187 djohnson Initial creation
|
||||
* Nov 15, 2012 1286 djohnson Use server-keyed routing.
|
||||
* Apr 05, 2013 1841 djohnson Add shared subscription support.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -55,12 +56,12 @@ public class VizPendingSubscriptionHandler extends PendingSubscriptionHandler {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param userSubscriptionHandler
|
||||
* @param siteSubscriptionHandler
|
||||
*/
|
||||
public VizPendingSubscriptionHandler(
|
||||
IPendingUserSubscriptionHandler userSubscriptionHandler,
|
||||
IPendingSiteSubscriptionHandler siteSubscriptionHandler,
|
||||
IPendingSharedSubscriptionHandler sharedSubscriptionHandler) {
|
||||
super(userSubscriptionHandler, sharedSubscriptionHandler);
|
||||
super(siteSubscriptionHandler, sharedSubscriptionHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.util.List;
|
|||
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionDeleteRequest;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISharedSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISiteSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IUserSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.SubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
@ -45,6 +45,7 @@ import com.raytheon.uf.common.serialization.comm.RequestRouter;
|
|||
* Nov 15, 2012 1286 djohnson Use server-keyed routing.
|
||||
* Mar 29, 2013 1841 djohnson Composes a userSubscriptionsHandler.
|
||||
* Apr 05, 2013 1841 djohnson Add shared subscription support.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,13 +57,13 @@ public class VizSubscriptionHandler extends SubscriptionHandler {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param userSubscriptionHandler
|
||||
* @param siteSubscriptionHandler
|
||||
* @param sharedSubscriptionHandler
|
||||
*/
|
||||
public VizSubscriptionHandler(
|
||||
IUserSubscriptionHandler userSubscriptionHandler,
|
||||
ISiteSubscriptionHandler siteSubscriptionHandler,
|
||||
ISharedSubscriptionHandler sharedSubscriptionHandler) {
|
||||
super(userSubscriptionHandler, sharedSubscriptionHandler);
|
||||
super(siteSubscriptionHandler, sharedSubscriptionHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,8 +26,13 @@ import java.util.Set;
|
|||
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseTrackAdapter;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
@ -38,17 +43,28 @@ import org.eclipse.swt.widgets.Layout;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.raytheon.uf.common.auth.user.IUser;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription.SubscriptionPriority;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.DataSetQuery;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||
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.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.viz.core.auth.UserController;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.ActivePeriodComp;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.DurationComp;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.GroupSelectComp;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.PriorityComp;
|
||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.view.ICreateSubscriptionDlgView;
|
||||
import com.raytheon.uf.viz.datadelivery.system.SystemRuleManager;
|
||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryGUIUtils;
|
||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.raytheon.viz.ui.presenter.components.ButtonConf;
|
||||
import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
|
||||
|
||||
|
@ -80,6 +96,7 @@ import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
|
|||
* Jan 04, 2013 1420 mpduff Add latency.
|
||||
* Jan 25, 2013 1528 djohnson Use priority enum instead of raw integers.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Add Shared sites.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -88,6 +105,9 @@ import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
|
|||
*/
|
||||
public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
||||
ICreateSubscriptionDlgView {
|
||||
/** Status Handler */
|
||||
private final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(CreateSubscriptionDlg.class);
|
||||
|
||||
/** The Main Composite */
|
||||
private Composite mainComp;
|
||||
|
@ -146,6 +166,12 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
/** Available cycle times */
|
||||
private Set<Integer> cycleTimes;
|
||||
|
||||
private String[] sharedSites;
|
||||
|
||||
private Label selectedSiteLbl;
|
||||
|
||||
private final Font font;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -155,8 +181,8 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
* true for new subscription, false for edit
|
||||
*/
|
||||
public CreateSubscriptionDlg(Shell parent, boolean create) {
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.INDEPENDENT_SHELL
|
||||
| CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL,
|
||||
CAVE.INDEPENDENT_SHELL | CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
this.create = create;
|
||||
|
||||
if (create) {
|
||||
|
@ -164,6 +190,8 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
} else {
|
||||
setText("Edit Subscription");
|
||||
}
|
||||
|
||||
font = new Font(this.getDisplay(), "Monospace", 9, SWT.NORMAL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -197,6 +225,8 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
priorityComp = new PriorityComp(mainComp, latency, priority);
|
||||
|
||||
this.createCycleGroup();
|
||||
createSiteSelection();
|
||||
|
||||
if (create == false) {
|
||||
createChangeText();
|
||||
}
|
||||
|
@ -266,6 +296,97 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
changeReasonTxt.setLayoutData(new GridData(375, SWT.DEFAULT));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the site selection widgets.
|
||||
*/
|
||||
private void createSiteSelection() {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
GridLayout gl = new GridLayout(2, false);
|
||||
|
||||
final Group group = new Group(mainComp, SWT.NONE);
|
||||
group.setLayout(gl);
|
||||
group.setLayoutData(gd);
|
||||
group.setText(" Shared Sites ");
|
||||
|
||||
gd = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
gl = new GridLayout(2, false);
|
||||
final Composite c = new Composite(group, SWT.NONE);
|
||||
c.setLayout(gl);
|
||||
c.setLayoutData(gd);
|
||||
|
||||
gl = new GridLayout(1, false);
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
final Button btn = new Button(c, SWT.NONE);
|
||||
btn.setLayoutData(new GridData(95, SWT.DEFAULT));
|
||||
btn.setText("Select Sites...");
|
||||
btn.setToolTipText("Select sites for sharing");
|
||||
btn.setEnabled(false);
|
||||
|
||||
final DataDeliveryPermission permission = DataDeliveryPermission.SHARED_SUBSCRIPTION_CREATE;
|
||||
final IUser user = UserController.getUserObject();
|
||||
final String msg = user.uniqueId()
|
||||
+ " is not authorized to create shared subscriptions. "
|
||||
+ StringUtil.NEWLINE + "Permission: " + permission;
|
||||
try {
|
||||
if (DataDeliveryServices.getPermissionsService()
|
||||
.checkPermission(user, msg, permission).isAuthorized()) {
|
||||
btn.setEnabled(true);
|
||||
} else {
|
||||
c.addMouseTrackListener(new MouseTrackAdapter() {
|
||||
|
||||
@Override
|
||||
public void mouseExit(MouseEvent e) {
|
||||
DataDeliveryGUIUtils.hideToolTip();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseHover(MouseEvent e) {
|
||||
handleMouseEvent(e, msg, group.getBounds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEnter(MouseEvent e) {
|
||||
handleMouseEvent(e, msg, group.getBounds());
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (VizException e1) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1);
|
||||
}
|
||||
btn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
SiteSelectionDlg dlg = new SiteSelectionDlg(shell, "OAX",
|
||||
sharedSites);
|
||||
dlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof String[]) {
|
||||
String[] sites = (String[]) returnValue;
|
||||
processSites(sites);
|
||||
}
|
||||
}
|
||||
});
|
||||
dlg.open();
|
||||
}
|
||||
});
|
||||
|
||||
selectedSiteLbl = new Label(group, SWT.BORDER);
|
||||
selectedSiteLbl.setFont(font);
|
||||
selectedSiteLbl.setText("");
|
||||
selectedSiteLbl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
|
||||
false));
|
||||
|
||||
if (!create) {
|
||||
if (subscription != null && subscription.getOfficeIDs().size() > 0) {
|
||||
String[] siteArr = subscription.getOfficeIDs().toArray(
|
||||
new String[subscription.getOfficeIDs().size()]);
|
||||
processSites(siteArr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the bottom buttons
|
||||
*/
|
||||
|
@ -341,6 +462,21 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
shell.pack();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the mouse event and display the tooltip.
|
||||
*
|
||||
* @param e
|
||||
* MouseEvent
|
||||
* @param msg
|
||||
* Message to display
|
||||
* @param bounds
|
||||
* Bounds
|
||||
*/
|
||||
private void handleMouseEvent(MouseEvent e, String msg, Rectangle bounds) {
|
||||
Point pos = shell.toDisplay(bounds.x + e.x + 15, bounds.y + e.y + 15);
|
||||
DataDeliveryGUIUtils.showTooltip(this.shell, pos.x, pos.y, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -349,6 +485,19 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
this.open();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#disposed()
|
||||
*/
|
||||
@Override
|
||||
protected void disposed() {
|
||||
super.disposed();
|
||||
if (font != null && !font.isDisposed()) {
|
||||
font.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -815,4 +964,49 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
public void setCycleTimes(Set<Integer> cycleTimes) {
|
||||
this.cycleTimes = cycleTimes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the site list
|
||||
*
|
||||
* @param sites
|
||||
* list of sites
|
||||
*/
|
||||
private void processSites(String[] sites) {
|
||||
this.sharedSites = sites;
|
||||
StringBuilder toolTipText = new StringBuilder();
|
||||
StringBuilder labelText = new StringBuilder();
|
||||
boolean overflow = false;
|
||||
for (int i = 0; i < sites.length; i++) {
|
||||
toolTipText.append(sites[i]).append(" ");
|
||||
if (i < 8) {
|
||||
labelText.append(sites[i]).append(" ");
|
||||
} else {
|
||||
overflow = true;
|
||||
}
|
||||
}
|
||||
String lt = labelText.toString().trim();
|
||||
if (!lt.isEmpty() && overflow) {
|
||||
lt = lt.concat("...");
|
||||
}
|
||||
|
||||
selectedSiteLbl.setText(lt);
|
||||
selectedSiteLbl.setToolTipText(toolTipText.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String[] getSharedSites() {
|
||||
return this.sharedSites;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setOfficeIds(Set<String> officeIDs) {
|
||||
List<String> list = new ArrayList<String>(officeIDs);
|
||||
this.sharedSites = list.toArray(new String[officeIDs.size()]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,8 +32,8 @@ import org.eclipse.swt.widgets.Layout;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
@ -65,6 +65,8 @@ import com.raytheon.viz.ui.presenter.components.WidgetConf;
|
|||
* Jan 02, 2013 1441 djohnson Access GroupDefinitionManager in a static fashion.
|
||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 14, 2013 1040 mpduff Changed to add office Id rather than setting it.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -74,7 +76,8 @@ import com.raytheon.viz.ui.presenter.components.WidgetConf;
|
|||
public class GroupAddDlg extends CaveSWTDialog {
|
||||
|
||||
/** Status Handler */
|
||||
private final IUFStatusHandler statusHandler = UFStatus.getHandler(GroupAddDlg.class);
|
||||
private final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GroupAddDlg.class);
|
||||
|
||||
/** The Main Composite */
|
||||
private Composite mainComp;
|
||||
|
@ -133,12 +136,15 @@ public class GroupAddDlg extends CaveSWTDialog {
|
|||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialog#preOpened()
|
||||
*/
|
||||
@Override
|
||||
protected void preOpened() {
|
||||
ComboBoxConf groupComboConf = new ComboBoxConf(true, "Select a Group", WidgetConf.DO_NOTHING);
|
||||
ComboBoxConf groupComboConf = new ComboBoxConf(true, "Select a Group",
|
||||
WidgetConf.DO_NOTHING);
|
||||
groupSelectComp.setGroupNameComboConf(groupComboConf);
|
||||
}
|
||||
|
||||
|
@ -220,28 +226,32 @@ public class GroupAddDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private boolean handleOK() {
|
||||
|
||||
//Get Group Definition
|
||||
// Get Group Definition
|
||||
String groupName = groupSelectComp.getGroupName();
|
||||
GroupDefinition groupDefinition = GroupDefinitionManager
|
||||
.getGroup(groupName);
|
||||
|
||||
//Apply group properties to subscription definition
|
||||
// Apply group properties to subscription definition
|
||||
if (groupDefinition != null) {
|
||||
subscription.setGroupName(groupName);
|
||||
|
||||
//Set duration
|
||||
// Set duration
|
||||
if (groupDefinition.getSubscriptionStart() != null) {
|
||||
subscription.setSubscriptionStart(groupDefinition.getSubscriptionStart());
|
||||
subscription.setSubscriptionEnd(groupDefinition.getSubscriptionEnd());
|
||||
subscription.setSubscriptionStart(groupDefinition
|
||||
.getSubscriptionStart());
|
||||
subscription.setSubscriptionEnd(groupDefinition
|
||||
.getSubscriptionEnd());
|
||||
} else {
|
||||
subscription.setSubscriptionStart(null);
|
||||
subscription.setSubscriptionEnd(null);
|
||||
}
|
||||
|
||||
//Set active period
|
||||
// Set active period
|
||||
if (groupDefinition.getActivePeriodStart() != null) {
|
||||
subscription.setActivePeriodStart(groupDefinition.getActivePeriodStart());
|
||||
subscription.setActivePeriodEnd(groupDefinition.getActivePeriodEnd());
|
||||
subscription.setActivePeriodStart(groupDefinition
|
||||
.getActivePeriodStart());
|
||||
subscription.setActivePeriodEnd(groupDefinition
|
||||
.getActivePeriodEnd());
|
||||
} else {
|
||||
subscription.setActivePeriodStart(null);
|
||||
subscription.setActivePeriodEnd(null);
|
||||
|
@ -252,12 +262,13 @@ public class GroupAddDlg extends CaveSWTDialog {
|
|||
|
||||
System.out.println("Fix Me: Need to calculate data set size");
|
||||
subscription.setDataSetSize(999);
|
||||
subscription.setOfficeID(LocalizationManager.getInstance().getCurrentSite());
|
||||
subscription.addOfficeID(LocalizationManager.getInstance()
|
||||
.getCurrentSite());
|
||||
|
||||
// TODO: How to do this better? Will shared subscriptions participate in
|
||||
// groups?
|
||||
if (subscription instanceof UserSubscription) {
|
||||
((UserSubscription) subscription).setOwner(username);
|
||||
if (subscription instanceof SiteSubscription) {
|
||||
((SiteSubscription) subscription).setOwner(username);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -269,8 +280,7 @@ public class GroupAddDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
subscriptionNotificationService.sendCreatedSubscriptionNotification(
|
||||
subscription,
|
||||
username);
|
||||
subscription, username);
|
||||
|
||||
// refresh table
|
||||
callback.handleRefresh();
|
||||
|
@ -279,4 +289,3 @@ public class GroupAddDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ package com.raytheon.uf.viz.datadelivery.subscription;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 15, 2012 687 lvenable Initial creation
|
||||
* May 23, 2013 2020 mpduff Added updateControls method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -37,5 +38,16 @@ package com.raytheon.uf.viz.datadelivery.subscription;
|
|||
*/
|
||||
|
||||
public interface ISubscriptionAction {
|
||||
/**
|
||||
* Update the Activate button's text.
|
||||
*
|
||||
* @param text
|
||||
* The text to display on the button
|
||||
*/
|
||||
public void activateButtonUpdate(String text);
|
||||
|
||||
/**
|
||||
* Update the controls.
|
||||
*/
|
||||
public void updateControls();
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.rmi.RemoteException;
|
|||
|
||||
import com.raytheon.uf.common.auth.user.IUser;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryAuthRequest;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||
import com.raytheon.uf.common.datadelivery.service.BasePrivilegedDataDeliveryService;
|
||||
|
@ -44,6 +44,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Jan 21, 2013 1441 djohnson Use RequestRouter.
|
||||
* Feb 26, 2013 1643 djohnson Extends base class.
|
||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -99,9 +100,9 @@ public class RequestFromServerPermissionsService extends
|
|||
final Subscription subscription) throws VizException {
|
||||
|
||||
// TODO: Can this be done better?
|
||||
if (subscription instanceof UserSubscription) {
|
||||
if (subscription instanceof SiteSubscription) {
|
||||
return checkPermissionToChangeSubscription(user,
|
||||
notAuthorizedMessage, (UserSubscription) subscription);
|
||||
notAuthorizedMessage, (SiteSubscription) subscription);
|
||||
} else {
|
||||
return checkPermissionToChangeSubscription(user,
|
||||
notAuthorizedMessage, (SharedSubscription) subscription);
|
||||
|
@ -111,7 +112,7 @@ public class RequestFromServerPermissionsService extends
|
|||
|
||||
private IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
||||
final IUser user, String notAuthorizedMessage,
|
||||
final UserSubscription subscription) throws VizException {
|
||||
final SiteSubscription subscription) throws VizException {
|
||||
|
||||
final IAuthorizedPermissionResponse r = checkPermissions(user,
|
||||
notAuthorizedMessage,
|
||||
|
|
|
@ -0,0 +1,175 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.datadelivery.subscription;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.site.SiteData;
|
||||
import com.raytheon.uf.common.site.SiteData.SiteDataType;
|
||||
import com.raytheon.uf.common.site.SiteMap;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.widgets.DualListComposite;
|
||||
import com.raytheon.viz.ui.widgets.duallist.DualListConfig;
|
||||
|
||||
/**
|
||||
* Shared site selection dialog.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 29, 2013 1040 mpduff Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SiteSelectionDlg extends CaveSWTDialog {
|
||||
private DualListComposite comp;
|
||||
|
||||
private final String[] sharedSites;
|
||||
|
||||
private final String site;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param parent
|
||||
* Parent Shell
|
||||
* @param site
|
||||
* Home Site
|
||||
* @param sharedSites
|
||||
* list of shared sites
|
||||
*/
|
||||
public SiteSelectionDlg(Shell parent, String site, String[] sharedSites) {
|
||||
super(parent, SWT.APPLICATION_MODAL | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
|
||||
this.setText(site + " Site Selection");
|
||||
this.sharedSites = sharedSites;
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
GridLayout gl = new GridLayout(1, false);
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
Composite mainComp = new Composite(shell, SWT.NONE);
|
||||
mainComp.setLayout(gl);
|
||||
mainComp.setLayoutData(gd);
|
||||
|
||||
gl = new GridLayout(1, false);
|
||||
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
Label label = new Label(mainComp, SWT.NONE);
|
||||
label.setText("Select sites to share with " + site + ":");
|
||||
gl = new GridLayout(1, false);
|
||||
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
|
||||
DualListConfig config = new DualListConfig();
|
||||
config.setAvailableListLabel("Available Sites:");
|
||||
config.setSelectedListLabel("Selected Sites:");
|
||||
config.setShowUpDownBtns(false);
|
||||
config.setListHeight(150);
|
||||
config.setListWidth(70);
|
||||
config.setFullList(getSiteList());
|
||||
config.setSelectedList(Arrays.asList(sharedSites));
|
||||
|
||||
comp = new DualListComposite(mainComp, config);
|
||||
comp.setLayout(gl);
|
||||
comp.setLayoutData(gd);
|
||||
gl = new GridLayout(2, false);
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
Composite buttonComp = new Composite(this.getShell(), SWT.NONE);
|
||||
buttonComp.setLayout(gl);
|
||||
buttonComp.setLayoutData(gd);
|
||||
|
||||
Button okBtn = new Button(buttonComp, SWT.NONE);
|
||||
okBtn.setText("OK");
|
||||
okBtn.setLayoutData(new GridData(75, SWT.DEFAULT));
|
||||
okBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
handleOk();
|
||||
}
|
||||
});
|
||||
|
||||
Button cancelBtn = new Button(buttonComp, SWT.NONE);
|
||||
cancelBtn.setText("Cancel");
|
||||
cancelBtn.setLayoutData(new GridData(75, SWT.DEFAULT));
|
||||
cancelBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of WFO/RFC ids
|
||||
*
|
||||
* @return list of site ids
|
||||
*/
|
||||
private List<String> getSiteList() {
|
||||
SiteMap siteMap = SiteMap.getInstance();
|
||||
List<String> siteList = new ArrayList<String>();
|
||||
|
||||
Map<String, SiteData> siteDataMap = siteMap.getSiteData();
|
||||
|
||||
for (Entry<String, SiteData> entry : siteDataMap.entrySet()) {
|
||||
SiteDataType type = entry.getValue().getType();
|
||||
if (type == SiteDataType.WFO || type == SiteDataType.RFC) {
|
||||
siteList.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the current site
|
||||
siteList.remove(this.site);
|
||||
|
||||
return siteList;
|
||||
}
|
||||
|
||||
/**
|
||||
* OK event handler.
|
||||
*/
|
||||
private void handleOk() {
|
||||
String[] selectedItems = comp.getSelectedItems();
|
||||
setReturnValue(selectedItems);
|
||||
close();
|
||||
}
|
||||
}
|
|
@ -23,6 +23,7 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
|
@ -61,6 +62,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.auth.UserController;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.datadelivery.actions.DataBrowserAction;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.IGroupAction;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.ITableChange;
|
||||
|
@ -116,7 +118,8 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
|||
* remove race condition of GUI thread updating the table after notification.
|
||||
* Jan 22, 2013 1520 mpduff Removed menu accelerators.
|
||||
* Mar 29, 2013 1841 djohnson Subscription implementations now provide a copy method.
|
||||
* May 29, 2013 2000 djohnson Copy subscription now requires editing first to prevent duplicates, and remove duplicate code.
|
||||
* May 09, 2013 2000 djohnson Copy subscription now requires editing first to prevent duplicates, and remove duplicate code.
|
||||
* May 17, 2013 1040 mpduff Change office id to list for shared subscription.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -168,6 +171,10 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
}
|
||||
}
|
||||
|
||||
/** Current site */
|
||||
private final String CURRENT_SITE = LocalizationManager.getInstance()
|
||||
.getCurrentSite();
|
||||
|
||||
/** The activate button */
|
||||
private Button activateBtn;
|
||||
|
||||
|
@ -947,20 +954,27 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
|
||||
SubscriptionManagerRowData rowData = tableComp
|
||||
.getSubscriptionData().getDataRow(i);
|
||||
String office = rowData.getOfficeId();
|
||||
officeDisplayItems.add(office);
|
||||
|
||||
Set<String> office = rowData.getOfficeIds();
|
||||
officeDisplayItems.addAll(office);
|
||||
}
|
||||
}
|
||||
|
||||
officeNames = officeDisplayItems.toArray(new String[officeDisplayItems
|
||||
.size()]);
|
||||
String[] officeAll = new String[officeNames.length + 1];
|
||||
|
||||
officeAll[0] = "ALL";
|
||||
|
||||
System.arraycopy(officeNames, 0, officeAll, 1, officeNames.length);
|
||||
int idx = 0;
|
||||
for (String site : officeAll) {
|
||||
if (site.equalsIgnoreCase(CURRENT_SITE)) {
|
||||
break;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
officeCbo.setItems(officeAll);
|
||||
officeCbo.select(0);
|
||||
officeCbo.select(idx);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1107,4 +1121,13 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
public void tableLock(boolean isLocked) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void updateControls() {
|
||||
loadGroupNames();
|
||||
loadOfficeNames();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,8 +20,10 @@
|
|||
package com.raytheon.uf.viz.datadelivery.subscription;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.ISortTable;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.ITableData;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.SortImages.SortDirection;
|
||||
|
@ -47,13 +49,15 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
* Oct 2, 2012 1103 jpiatt Remove unused methods, update enum, code clean up.
|
||||
* Jan 25, 2012 1528 djohnson Priorities no longer need incrementing for display.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Change Office IDs to set.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SubscriptionManagerRowData implements ITableData<SubscriptionManagerRowData> {
|
||||
public class SubscriptionManagerRowData implements
|
||||
ITableData<SubscriptionManagerRowData> {
|
||||
|
||||
/** Dataset id. */
|
||||
private String dataSetID = null;
|
||||
|
@ -86,13 +90,14 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
private Date activeEnd = null;
|
||||
|
||||
/** Subscription column titles. */
|
||||
private final String[] columns = DataDeliveryUtils.getColumnTitles(TABLE_TYPE.SUBSCRIPTION);
|
||||
private final String[] columns = DataDeliveryUtils
|
||||
.getColumnTitles(TABLE_TYPE.SUBSCRIPTION);
|
||||
|
||||
/** Subscription details. */
|
||||
private String details = null;
|
||||
|
||||
/** Office id. */
|
||||
private String officeId = null;
|
||||
/** Office ids. */
|
||||
private Set<String> officeIds = null;
|
||||
|
||||
/** Size of dataset. */
|
||||
private long dataSetSize = 0;
|
||||
|
@ -334,22 +339,22 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the office identification.
|
||||
* Get the office ids.
|
||||
*
|
||||
* @return the dataSetID
|
||||
* @return the officeIds
|
||||
*/
|
||||
public String getOfficeId() {
|
||||
return officeId;
|
||||
public Set<String> getOfficeIds() {
|
||||
return officeIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the office identification.
|
||||
* Set the office ids.
|
||||
*
|
||||
* @param dataSetID
|
||||
* the dataSetID to set
|
||||
* @param officeIds
|
||||
* the officeIds to set
|
||||
*/
|
||||
public void setOfficeId(String officeId) {
|
||||
this.officeId = officeId;
|
||||
public void setOfficeIds(Set<String> officeIds) {
|
||||
this.officeIds = officeIds;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -397,8 +402,8 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
/**
|
||||
* Set the subscription object.
|
||||
*
|
||||
* @param subscription obj
|
||||
* the subscription to set
|
||||
* @param subscription
|
||||
* obj the subscription to set
|
||||
*/
|
||||
public void setSubscription(Subscription subscription) {
|
||||
this.subscription = subscription;
|
||||
|
@ -406,8 +411,8 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the subscription status. Statuses include active,
|
||||
* inactive, expired, & invalid.
|
||||
* Set the subscription status. Statuses include active, inactive, expired,
|
||||
* & invalid.
|
||||
*
|
||||
* @param status
|
||||
* the status to set
|
||||
|
@ -417,8 +422,8 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the subscription status. Statuses include active,
|
||||
* inactive, expired, & invalid.
|
||||
* Get the subscription status. Statuses include active, inactive, expired,
|
||||
* & invalid.
|
||||
*
|
||||
* @return status
|
||||
*/
|
||||
|
@ -452,14 +457,13 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
this.setActiveEnd(subscription.getActivePeriodEnd());
|
||||
this.setDataSetID(subscription.getDataSetName());
|
||||
this.setDescription(subscription.getDescription());
|
||||
this.setOfficeId(subscription.getOfficeID());
|
||||
this.setOfficeIds(subscription.getOfficeIDs());
|
||||
this.setDataSetSize(subscription.getDataSetSize());
|
||||
this.setGroupName(subscription.getGroupName());
|
||||
|
||||
if (subscription.isFullDataSet()) {
|
||||
this.setFullDataSet(FullDataset.FULL);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.setFullDataSet(FullDataset.SUBSET);
|
||||
}
|
||||
|
||||
|
@ -501,7 +505,7 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
} else if (columnName.equals(columns[++cIndex])) {
|
||||
return columnName;
|
||||
} else if (columnName.equals(columns[++cIndex])) {
|
||||
return officeId;
|
||||
return this.getOfficeIdsAsList();
|
||||
} else if (columnName.equals(columns[++cIndex])) {
|
||||
return fullDataSet.toString();
|
||||
} else if (columnName.equals(columns[++cIndex])) {
|
||||
|
@ -520,20 +524,16 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
// handle empty date cells
|
||||
if ((d1 == null) && (d2 == null)) {
|
||||
return 0;
|
||||
}
|
||||
else if (d1 == null) {
|
||||
} else if (d1 == null) {
|
||||
return 1;
|
||||
}
|
||||
else if (d2 == null) {
|
||||
} else if (d2 == null) {
|
||||
return -1;
|
||||
}
|
||||
if (d1.before(d2)) {
|
||||
return 1;
|
||||
}
|
||||
else if (d1.after(d2)) {
|
||||
} else if (d1.after(d2)) {
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -560,22 +560,21 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
int returnValue = 0;
|
||||
|
||||
if (columnName.equals("Subscription Start")) {
|
||||
returnValue = checkDate(this.getSubscriptionStart(), o.getSubscriptionStart());
|
||||
}
|
||||
else if (columnName.equals("Subscription Expiration")) {
|
||||
returnValue = checkDate(this.getSubscriptionEnd(), o.getSubscriptionEnd());
|
||||
}
|
||||
else if (columnName.equals("Active Period Start")) {
|
||||
returnValue = checkDate(this.getSubscriptionStart(),
|
||||
o.getSubscriptionStart());
|
||||
} else if (columnName.equals("Subscription Expiration")) {
|
||||
returnValue = checkDate(this.getSubscriptionEnd(),
|
||||
o.getSubscriptionEnd());
|
||||
} else if (columnName.equals("Active Period Start")) {
|
||||
returnValue = checkDate(this.getActiveStart(), o.getActiveStart());
|
||||
}
|
||||
else if (columnName.equals("Active Period End")) {
|
||||
} else if (columnName.equals("Active Period End")) {
|
||||
returnValue = checkDate(this.getActiveEnd(), o.getActiveEnd());
|
||||
} else if (columnName.equals("Data Size")) {
|
||||
returnValue = (int) (this.getDataSetSize() - o.getDataSetSize());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (o.getSortValue(columnName) != null) {
|
||||
returnValue = sortValue.toUpperCase().compareTo(o.getSortValue(columnName).toUpperCase());
|
||||
returnValue = sortValue.toUpperCase().compareTo(
|
||||
o.getSortValue(columnName).toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,4 +584,22 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
|
|||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get office ids as comma separated list
|
||||
*
|
||||
* @return String of office ids
|
||||
*/
|
||||
public String getOfficeIdsAsList() {
|
||||
return StringUtil.join(this.officeIds, ',');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get office ids display list, first 3 offices in the list
|
||||
*
|
||||
* @return the display string
|
||||
*/
|
||||
public String getOfficeIdsDisplayList() {
|
||||
return StringUtil.getDisplayList(officeIds, " ", 3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,9 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
* Jan 07, 2013 1437 bgonzale Added sort column direction updates.
|
||||
* Jan 28, 2013 1529 djohnson Disable menu items if no subscriptions are selected.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options, move column value parsing to the columns themselves.
|
||||
* May 29, 2013 2000 djohnson Consolidate and remove duplicate code.
|
||||
* May 09, 2013 2000 djohnson Consolidate and remove duplicate code.
|
||||
* May 15, 2013 1040 mpduff Place markNotBusyInUIThread in a finally block.
|
||||
* May 23, 2013 2020 mpduff Call updateControls();
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -246,11 +248,8 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
|
|||
}
|
||||
|
||||
if (table.getSelectionCount() > 1) {
|
||||
int choice = DataDeliveryUtils
|
||||
.showMessage(
|
||||
this.getShell(),
|
||||
SWT.ERROR | SWT.YES | SWT.NO,
|
||||
"Single Selection Only",
|
||||
int choice = DataDeliveryUtils.showMessage(this.getShell(),
|
||||
SWT.ERROR | SWT.YES | SWT.NO, "Single Selection Only",
|
||||
"Multiple subscriptions are selected.\n"
|
||||
+ "Only the first selected item will be used.\n\n"
|
||||
+ "Continue?");
|
||||
|
@ -457,14 +456,18 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
|
|||
job.addJobChangeListener(new JobChangeAdapter() {
|
||||
@Override
|
||||
public void done(IJobChangeEvent event) {
|
||||
try {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateTable(subList);
|
||||
subActionCallback.updateControls();
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
DataDeliveryGUIUtils.markNotBusyInUIThread(jobShell);
|
||||
}
|
||||
}
|
||||
});
|
||||
job.schedule();
|
||||
}
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.datadelivery.subscription.approve;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.auth.user.IUser;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
|
||||
import com.raytheon.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.ISortTable;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.ITableData;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.approve.SubApprovalTableComp.Action;
|
||||
|
@ -39,6 +42,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
|||
* Sep 17, 2012 1157 mpduff Add null check.
|
||||
* Nov 28, 2012 1286 djohnson Hide details of checking whether a user is a row's subscription's owner.
|
||||
* Dec 20, 2012 1413 bgonzale Implemented compareTo.
|
||||
* May 15, 2013 1040 mpduff Change office id to a set.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,7 +50,8 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SubscriptionApprovalRowData implements ITableData<SubscriptionApprovalRowData> {
|
||||
public class SubscriptionApprovalRowData implements
|
||||
ITableData<SubscriptionApprovalRowData> {
|
||||
/** The subscription object */
|
||||
private InitialPendingSubscription subscription;
|
||||
|
||||
|
@ -63,7 +68,7 @@ public class SubscriptionApprovalRowData implements ITableData<SubscriptionAppro
|
|||
private String description;
|
||||
|
||||
/** The office id of the subscription */
|
||||
private String officeId;
|
||||
private Set<String> officeIds;
|
||||
|
||||
/** Reason for the change to the subscription */
|
||||
private String changeReason;
|
||||
|
@ -155,21 +160,20 @@ public class SubscriptionApprovalRowData implements ITableData<SubscriptionAppro
|
|||
}
|
||||
|
||||
/**
|
||||
* @return the officeId
|
||||
* @return the officeIds
|
||||
*/
|
||||
public String getOfficeId() {
|
||||
return officeId;
|
||||
public Set<String> getOfficeIds() {
|
||||
return officeIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param officeId
|
||||
* the officeId to set
|
||||
* @param officeIds
|
||||
* the officeIds to set
|
||||
*/
|
||||
public void setOfficeId(String officeId) {
|
||||
this.officeId = officeId;
|
||||
public void setOfficeIds(Set<String> officeIds) {
|
||||
this.officeIds = officeIds;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the changeReason
|
||||
*/
|
||||
|
@ -178,7 +182,8 @@ public class SubscriptionApprovalRowData implements ITableData<SubscriptionAppro
|
|||
}
|
||||
|
||||
/**
|
||||
* @param changeReason the changeReason to set
|
||||
* @param changeReason
|
||||
* the changeReason to set
|
||||
*/
|
||||
public void setChangeReason(String changeReason) {
|
||||
this.changeReason = changeReason;
|
||||
|
@ -186,7 +191,7 @@ public class SubscriptionApprovalRowData implements ITableData<SubscriptionAppro
|
|||
|
||||
private void populate() {
|
||||
this.description = subscription.getDescription();
|
||||
this.officeId = subscription.getOfficeID();
|
||||
this.officeIds = subscription.getOfficeIDs();
|
||||
this.owner = subscription.getOwner();
|
||||
this.subName = subscription.getName();
|
||||
this.changeOwner = subscription.getChangeReqId();
|
||||
|
@ -230,8 +235,8 @@ public class SubscriptionApprovalRowData implements ITableData<SubscriptionAppro
|
|||
otherValue = o.getSubName();
|
||||
break;
|
||||
case OFFICE:
|
||||
selfValue = getOfficeId();
|
||||
otherValue = o.getOfficeId();
|
||||
selfValue = StringUtil.join(getOfficeIds(), ',');
|
||||
otherValue = StringUtil.join(o.getOfficeIds(), ',');
|
||||
break;
|
||||
case OWNER:
|
||||
selfValue = getOwner();
|
||||
|
@ -268,7 +273,8 @@ public class SubscriptionApprovalRowData implements ITableData<SubscriptionAppro
|
|||
}
|
||||
|
||||
/**
|
||||
* @param action the action to set
|
||||
* @param action
|
||||
* the action to set
|
||||
*/
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
|
@ -292,4 +298,13 @@ public class SubscriptionApprovalRowData implements ITableData<SubscriptionAppro
|
|||
public boolean isOwner(IUser user) {
|
||||
return getSubscription().getOwner().equals(user.uniqueId().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of office ids as a String
|
||||
*
|
||||
* @return list of ids
|
||||
*/
|
||||
public String getOfficeIdsAsList() {
|
||||
return StringUtil.join(this.officeIds, ',');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,8 +41,10 @@ import com.raytheon.uf.common.auth.user.IUser;
|
|||
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.OpenDapGriddedDataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription.SubscriptionPriority;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
|
||||
|
@ -107,6 +109,7 @@ import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
|
|||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 05, 2013 1841 djohnson Add support for shared subscriptions.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Add shared sites.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -178,6 +181,9 @@ public class CreateSubscriptionDlgPresenter {
|
|||
* @param dataSet
|
||||
* The dataset
|
||||
* @param create
|
||||
* true for create, false for edit
|
||||
* @param guiThreadTaskExecutor
|
||||
* task executor
|
||||
*/
|
||||
public CreateSubscriptionDlgPresenter(ICreateSubscriptionDlgView view,
|
||||
DataSet dataSet, boolean create,
|
||||
|
@ -231,7 +237,6 @@ public class CreateSubscriptionDlgPresenter {
|
|||
}
|
||||
};
|
||||
this.view.setCycleTimes(cycleTimes);
|
||||
this.view.setSubscription(this.subscription);
|
||||
this.view.setPreOpenCallback(callback);
|
||||
this.view.openDlg();
|
||||
}
|
||||
|
@ -253,6 +258,7 @@ public class CreateSubscriptionDlgPresenter {
|
|||
*/
|
||||
public void setSubscriptionData(Subscription sub) {
|
||||
this.subscription = sub;
|
||||
this.view.setSubscription(sub);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -387,6 +393,8 @@ public class CreateSubscriptionDlgPresenter {
|
|||
if (!Strings.isNullOrEmpty(subscription.getGroupName())) {
|
||||
view.setGroupName(subscription.getGroupName());
|
||||
}
|
||||
|
||||
view.setOfficeIds(subscription.getOfficeIDs());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -430,6 +438,18 @@ public class CreateSubscriptionDlgPresenter {
|
|||
if (!validate()) {
|
||||
return false;
|
||||
}
|
||||
String[] sharedSites = view.getSharedSites();
|
||||
if (sharedSites != null && sharedSites.length > 1) {
|
||||
SharedSubscription sharedSub = new SharedSubscription(subscription);
|
||||
sharedSub.setRoute(Network.SBN);
|
||||
Set<String> officeList = Sets.newHashSet(sharedSites);
|
||||
sharedSub.setOfficeIDs(officeList);
|
||||
subscription = sharedSub;
|
||||
} else {
|
||||
Set<String> officeList = Sets.newHashSet();
|
||||
officeList.add(LocalizationManager.getInstance().getCurrentSite());
|
||||
subscription.setOfficeIDs(officeList);
|
||||
}
|
||||
|
||||
// Data are valid, now add info to the subscription object and store
|
||||
subscription.setProvider(dataSet.getProviderName());
|
||||
|
@ -496,9 +516,6 @@ public class CreateSubscriptionDlgPresenter {
|
|||
SubscriptionPriority priority = view.getPriority();
|
||||
subscription.setPriority(priority);
|
||||
|
||||
subscription.setOfficeID(LocalizationManager.getInstance()
|
||||
.getCurrentSite());
|
||||
|
||||
subscription.setName(view.getSubscriptionName());
|
||||
|
||||
subscription.setDescription(view.getSubscriptionDescription());
|
||||
|
@ -549,17 +566,19 @@ public class CreateSubscriptionDlgPresenter {
|
|||
job.addJobChangeListener(new JobChangeAdapter() {
|
||||
@Override
|
||||
public void done(final IJobChangeEvent event) {
|
||||
|
||||
try {
|
||||
final IStatus status = event.getResult();
|
||||
|
||||
final boolean subscriptionCreated = status.isOK();
|
||||
final boolean subscriptionCreated = status
|
||||
.isOK();
|
||||
if (subscriptionCreated) {
|
||||
sendSubscriptionNotification(subscription,
|
||||
username);
|
||||
}
|
||||
|
||||
if (!Strings.isNullOrEmpty(status.getMessage())) {
|
||||
guiThreadTaskExecutor.runAsync(new Runnable() {
|
||||
guiThreadTaskExecutor
|
||||
.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!view.isDisposed()) {
|
||||
|
@ -579,9 +598,11 @@ public class CreateSubscriptionDlgPresenter {
|
|||
}
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
DataDeliveryGUIUtils
|
||||
.markNotBusyInUIThread(jobShell);
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
job.schedule();
|
||||
return false;
|
||||
|
@ -609,8 +630,7 @@ public class CreateSubscriptionDlgPresenter {
|
|||
} else {
|
||||
// Check for pending subscription, can only have one pending change
|
||||
PendingSubscription pendingSub = subscription
|
||||
.pending(LocalizationManager.getInstance()
|
||||
.getCurrentUser());
|
||||
.pending(LocalizationManager.getInstance().getCurrentUser());
|
||||
pendingSub.setChangeReason(view.getChangeReason());
|
||||
|
||||
// Create the registry ids
|
||||
|
|
|
@ -50,9 +50,9 @@ import com.raytheon.uf.common.datadelivery.registry.Ensemble;
|
|||
import com.raytheon.uf.common.datadelivery.registry.GriddedDataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.GriddedDataSetMetaData;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
||||
|
@ -89,6 +89,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
|||
* Jan 28, 2013 1533 djohnson Update the calculated dataset size after loading subset xml.
|
||||
* Mar 21, 2013 1794 djohnson Add option to create a shared subscription, if phase3 code is available.
|
||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -258,7 +259,7 @@ public class GriddedSubsetManagerDlg
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public <T extends UserSubscription> T createSubscription(T sub,
|
||||
public <T extends SiteSubscription> T createSubscription(T sub,
|
||||
Network defaultRoute) {
|
||||
T subscription = super.createSubscription(sub, defaultRoute);
|
||||
if (subscription == null) {
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.datadelivery.subscription.subset;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
|
||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||
|
||||
/**
|
||||
* Placeholder shared subscription handler that will display a notice the
|
||||
* functionality is not available. It should never be invoked unless the
|
||||
* 5-Data_Delivery phase 3 code is available, but provides another layer in case
|
||||
* it somehow is invoked.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 27, 2013 1841 djohnson Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class NotEnabledSubscriptionHandler implements
|
||||
ISharedSubscriptionHandler {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void launchCreateSharedSubscriptionGui(SubsetManagerDlg<?, ?, ?> subsetManagerDlg) {
|
||||
DataDeliveryUtils.showMessage(subsetManagerDlg.getShell(), SWT.OK,
|
||||
"Unavailable option", "Shared subscriptions are not enabled.");
|
||||
}
|
||||
|
||||
}
|
|
@ -56,10 +56,9 @@ import com.raytheon.uf.common.datadelivery.registry.GriddedDataSet;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Levels;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||
import com.raytheon.uf.common.datadelivery.retrieval.util.DataSizeUtils;
|
||||
|
@ -70,7 +69,6 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
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.uf.common.util.ServiceLoaderUtil;
|
||||
import com.raytheon.uf.viz.core.VizAppTaskExecutor;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.datadelivery.common.xml.AreaXML;
|
||||
|
@ -136,6 +134,8 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
|||
* Mar 21, 2013 1794 djohnson Add option to create a shared subscription, if phase3 code is available.
|
||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Implement shared subscriptions.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -151,10 +151,6 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
private final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SubsetManagerDlg.class);
|
||||
|
||||
private final ISharedSubscriptionHandler sharedSubscriptionHandler = ServiceLoaderUtil
|
||||
.load(SubsetManagerDlg.class, ISharedSubscriptionHandler.class,
|
||||
new NotEnabledSubscriptionHandler());
|
||||
|
||||
/** Subset Name text box */
|
||||
private Text nameText;
|
||||
|
||||
|
@ -478,29 +474,15 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
subscribeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (subscription == null) {
|
||||
launchCreateSubscriptionGui(createSubscription(
|
||||
new UserSubscription(), Network.OPSNET));
|
||||
new SiteSubscription(), Network.OPSNET));
|
||||
} else {
|
||||
launchCreateSubscriptionGui(subscription);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (create) {
|
||||
if (DataDeliveryConstants.PHASE3_ENABLED) {
|
||||
btnData = new GridData(buttonWidth, SWT.DEFAULT);
|
||||
Button sharedSubscribeBtn = new Button(bottomComp, SWT.PUSH);
|
||||
sharedSubscribeBtn.setText("Shared...");
|
||||
sharedSubscribeBtn
|
||||
.setToolTipText("Click to create a shared subscription to a subset");
|
||||
sharedSubscribeBtn.setLayoutData(btnData);
|
||||
sharedSubscribeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
sharedSubscriptionHandler
|
||||
.launchCreateSharedSubscriptionGui(SubsetManagerDlg.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
btnData = new GridData(buttonWidth, SWT.DEFAULT);
|
||||
Button queryBtn = new Button(bottomComp, SWT.PUSH);
|
||||
queryBtn.setText("Query");
|
||||
|
@ -525,6 +507,12 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the Create Subscription GUI.
|
||||
*
|
||||
* @param sub
|
||||
* The subscription object
|
||||
*/
|
||||
public void launchCreateSubscriptionGui(Subscription sub) {
|
||||
DataDeliveryGUIUtils.markBusyInUIThread(shell);
|
||||
if (handleOK(sub)) {
|
||||
|
@ -535,17 +523,11 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
}
|
||||
|
||||
/**
|
||||
* OK button action handler
|
||||
*
|
||||
* @param defaultRoute
|
||||
*
|
||||
* @return true if data are valid
|
||||
* Launch the Create Subscription GUI
|
||||
*/
|
||||
private boolean handleOK(Subscription sub) {
|
||||
if (this.validated(true)) {
|
||||
|
||||
if (subDlg != null && !subDlg.isDisposed()) {
|
||||
subDlg.setSubscriptionData(sub);
|
||||
subDlg.bringToTop();
|
||||
} else {
|
||||
subDlg = new CreateSubscriptionDlgPresenter(
|
||||
|
@ -589,23 +571,6 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the shared subscription.
|
||||
*
|
||||
* @param <T>
|
||||
* The subscription object reference type
|
||||
* @param sub
|
||||
* The subscription to populate
|
||||
* @param the
|
||||
* route for the subscription
|
||||
*
|
||||
* @return the populated subscription
|
||||
*/
|
||||
public SharedSubscription createSubscription(SharedSubscription sub,
|
||||
Network defaultRoute) {
|
||||
return setupCommonSubscriptionAttributes(sub, defaultRoute);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the user subscription.
|
||||
*
|
||||
|
@ -618,7 +583,7 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
*
|
||||
* @return the populated subscription
|
||||
*/
|
||||
public <T extends UserSubscription> T createSubscription(T sub,
|
||||
protected <T extends SiteSubscription> T createSubscription(T sub,
|
||||
Network defaultRoute) {
|
||||
|
||||
Preconditions.checkNotNull(sub, "A subscription must be provided.");
|
||||
|
@ -654,7 +619,12 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
|
||||
sub.setRoute(defaultRoute);
|
||||
sub.setName(nameText.getText());
|
||||
sub.setOfficeID(LocalizationManager.getInstance().getCurrentSite());
|
||||
if (subscription == null || subscription.getOfficeIDs() == null) {
|
||||
sub.addOfficeID(LocalizationManager.getInstance().getCurrentSite());
|
||||
} else {
|
||||
sub.setOfficeIDs(subscription.getOfficeIDs());
|
||||
}
|
||||
|
||||
if (!create) {
|
||||
sub.setGroupName(this.subscription.getGroupName());
|
||||
sub.setSubscriptionEnd(this.subscription.getSubscriptionEnd());
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
|
|||
* Jan 04, 2013 1420 mpduff Added getters for latency and priority.
|
||||
* Jan 25, 2013 1528 djohnson Subscription priority is now an enum.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 13, 2013 1040 mpduff Added getSharedSites method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -394,4 +395,19 @@ public interface ICreateSubscriptionDlgView extends IPresenterView {
|
|||
* @param cycleTimes
|
||||
*/
|
||||
void setCycleTimes(Set<Integer> cycleTimes);
|
||||
|
||||
/**
|
||||
* Get the list of shared sites
|
||||
*
|
||||
* @return shared sites
|
||||
*/
|
||||
String[] getSharedSites();
|
||||
|
||||
/**
|
||||
* Set the list of office ids.
|
||||
*
|
||||
* @param officeIDs
|
||||
* list of office ids
|
||||
*/
|
||||
void setOfficeIds(Set<String> officeIDs);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,10 @@ 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.Point;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Spinner;
|
||||
|
@ -60,6 +63,7 @@ import com.raytheon.uf.viz.core.VizApp;
|
|||
* Dec 18, 2012 1439 mpduff Change Regex to match invalid chars.
|
||||
* Jan 04, 2013 1420 mpduff Change default priority to normal priority.
|
||||
* Jan 25, 2013 1528 djohnson Subscription priority has moved up in the world to the Subscription class.
|
||||
* May 17, 2013 1040 mpduff Fixed JavaDoc and added tooltip.
|
||||
* May 20, 2013 2000 djohnson Add methods for managing widget listeners.
|
||||
*
|
||||
* </pre>
|
||||
|
@ -73,6 +77,9 @@ public class DataDeliveryGUIUtils {
|
|||
private final static IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(DataDeliveryGUIUtils.class);
|
||||
|
||||
/** Tooltip */
|
||||
private static Shell tooltip;
|
||||
|
||||
/** Subscription start/end date format */
|
||||
private final static ThreadLocal<SimpleDateFormat> subscriptionFormat = new ThreadLocal<SimpleDateFormat>() {
|
||||
@Override
|
||||
|
@ -279,9 +286,10 @@ public class DataDeliveryGUIUtils {
|
|||
* mouse cursor over it to the wait cursor. To undo this call the
|
||||
* corresponding method markNotBusyInUIThread(Shell).
|
||||
*
|
||||
* @see DataDeliveryGUIUtils.markNotBusyInUIThread(Shell)
|
||||
* @see #DataDeliveryGUIUtils.markNotBusyInUIThread(Shell)
|
||||
*
|
||||
* @param shell
|
||||
* The Shell to mark busy
|
||||
*/
|
||||
public static void markBusyInUIThread(final Shell shell) {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
@ -301,9 +309,13 @@ public class DataDeliveryGUIUtils {
|
|||
* mouse cursor to normal. This call is the followup to
|
||||
* markBusyInUIThread(Shell).
|
||||
*
|
||||
* @see DataDeliveryGUIUtils.markBusyInUIThread(Shell)
|
||||
* This should be placed in a finally block so when exceptions occur this
|
||||
* code is still called.
|
||||
*
|
||||
* @see #DataDeliveryGUIUtils.markBusyInUIThread(Shell)
|
||||
*
|
||||
* @param shell
|
||||
* the Shell used in markBusyInUIThread
|
||||
*/
|
||||
public static void markNotBusyInUIThread(final Shell shell) {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
@ -320,6 +332,11 @@ public class DataDeliveryGUIUtils {
|
|||
/**
|
||||
* Check the user's latency value.
|
||||
*
|
||||
* @param latency
|
||||
* the latency value
|
||||
* @param maxLatency
|
||||
* the max latency value
|
||||
*
|
||||
* @return true if valid
|
||||
*/
|
||||
public static boolean latencyValidChk(int latency, int maxLatency) {
|
||||
|
@ -397,4 +414,49 @@ public class DataDeliveryGUIUtils {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a tooltip display. Caller is responsible for disposing the tooltip by
|
||||
* calling {@link #hideToolTip}.
|
||||
*
|
||||
* @param parent
|
||||
* the parent shell
|
||||
* @param x
|
||||
* the x location
|
||||
* @param y
|
||||
* the y location
|
||||
* @param text
|
||||
* the text
|
||||
*/
|
||||
public static void showTooltip(Shell parent, int x, int y, String text) {
|
||||
if (tooltip != null && !tooltip.isDisposed()) {
|
||||
tooltip.dispose();
|
||||
}
|
||||
tooltip = new Shell(parent, SWT.TOOL | SWT.ON_TOP);
|
||||
tooltip.setLayout(new GridLayout());
|
||||
|
||||
tooltip.setBackground(tooltip.getDisplay().getSystemColor(
|
||||
SWT.COLOR_INFO_BACKGROUND));
|
||||
tooltip.setBackgroundMode(SWT.INHERIT_FORCE);
|
||||
|
||||
Label lbContent = new Label(tooltip, SWT.NONE);
|
||||
lbContent.setText(text);
|
||||
|
||||
Point lbContentSize = lbContent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
|
||||
int width = lbContentSize.x + 10;
|
||||
int height = lbContentSize.y + 10;
|
||||
|
||||
tooltip.setBounds(x, y, width, height);
|
||||
tooltip.setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose the tooltip created by {@link #showTooltip}
|
||||
*/
|
||||
public static void hideToolTip() {
|
||||
if (tooltip != null && !tooltip.isDisposed()) {
|
||||
tooltip.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.Date;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
|
@ -42,6 +43,7 @@ import com.raytheon.uf.common.datadelivery.registry.Time;
|
|||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryAuthRequest;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
import com.raytheon.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerRowData;
|
||||
|
@ -71,6 +73,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Jan 30, 2013 1543 djohnson Use List instead of ArrayList.
|
||||
* Apr 08, 2013 1826 djohnson Add getDisplayData() method to subscription columns.
|
||||
* Apr 10, 2013 1891 djohnson Add getDisplayData() method to pending subscription columns.
|
||||
* May 15, 2013 1040 mpduff Using Set for office Ids.
|
||||
* May 20, 2013 2000 djohnson Add message to inform the user changes were applied.
|
||||
* </pre>
|
||||
*
|
||||
|
@ -252,7 +255,7 @@ public class DataDeliveryUtils {
|
|||
OFFICE_ID("Office ID", null) {
|
||||
@Override
|
||||
public String getDisplayData(SubscriptionManagerRowData rd) {
|
||||
return rd.getOfficeId();
|
||||
return rd.getOfficeIdsDisplayList();
|
||||
}
|
||||
},
|
||||
/** Column Full Dataset */
|
||||
|
@ -420,7 +423,7 @@ public class DataDeliveryUtils {
|
|||
OFFICE("Office Id", null) {
|
||||
@Override
|
||||
public String getDisplayData(SubscriptionApprovalRowData rd) {
|
||||
return rd.getOfficeId();
|
||||
return rd.getOfficeIdsAsList();
|
||||
}
|
||||
},
|
||||
/** Description */
|
||||
|
@ -607,7 +610,7 @@ public class DataDeliveryUtils {
|
|||
* @return The formated details string
|
||||
*/
|
||||
public static String formatDetails(Subscription sub) {
|
||||
final String newline = System.getProperty("line.separator");
|
||||
final String newline = StringUtil.NEWLINE;
|
||||
final String space = " ";
|
||||
final String comma = ", ";
|
||||
|
||||
|
@ -621,24 +624,26 @@ public class DataDeliveryUtils {
|
|||
.append(newline);
|
||||
fmtStr.append("Dataset Size: ").append(sub.getDataSetSize())
|
||||
.append(newline);
|
||||
fmtStr.append("Provider : ").append(sub.getProvider()).append(newline);
|
||||
fmtStr.append("Office ID: ").append(sub.getOfficeID()).append(newline);
|
||||
fmtStr.append("Priority : ")
|
||||
fmtStr.append("Provider: ").append(sub.getProvider()).append(newline);
|
||||
fmtStr.append("Office IDs: ")
|
||||
.append(getFormatedList(sub.getOfficeIDs())).append(newline);
|
||||
fmtStr.append("Priority: ")
|
||||
.append(sub.getPriority().getPriorityValue()).append(newline);
|
||||
fmtStr.append("Network: ").append(sub.getRoute()).append(newline);
|
||||
|
||||
fmtStr.append("Coverage: ").append(newline);
|
||||
final Coverage coverage = sub.getCoverage();
|
||||
if (coverage.getProjection() != null) {
|
||||
fmtStr.append("------ Projection : ")
|
||||
fmtStr.append("------ Projection: ")
|
||||
.append(coverage.getProjection()).append(newline);
|
||||
} else {
|
||||
fmtStr.append("------ Projection : ").append(newline);
|
||||
fmtStr.append("------ Projection: ").append(newline);
|
||||
}
|
||||
final DecimalFormat decimalFormat = format.get();
|
||||
final Coordinate requestLowerRight = coverage.getRequestLowerRight();
|
||||
final Coordinate requestUpperLeft = coverage.getRequestUpperLeft();
|
||||
if (requestLowerRight == null || requestUpperLeft == null) {
|
||||
fmtStr.append("------ Upper Left : ")
|
||||
fmtStr.append("------ Upper Left: ")
|
||||
.append(decimalFormat.format(coverage.getUpperLeft().x))
|
||||
.append(comma)
|
||||
.append((decimalFormat.format(coverage.getUpperLeft().y)))
|
||||
|
@ -649,7 +654,7 @@ public class DataDeliveryUtils {
|
|||
.append(decimalFormat.format(coverage.getLowerRight().y))
|
||||
.append(newline);
|
||||
} else {
|
||||
fmtStr.append("------ Upper Left : ")
|
||||
fmtStr.append("------ Upper Left: ")
|
||||
.append(decimalFormat.format(requestUpperLeft.x))
|
||||
.append(comma)
|
||||
.append(decimalFormat.format(requestUpperLeft.y))
|
||||
|
@ -692,14 +697,14 @@ public class DataDeliveryUtils {
|
|||
.append(newline);
|
||||
fmtStr.append("------ Definition: ").append(p.getDefinition())
|
||||
.append(newline);
|
||||
fmtStr.append("------ Data Type : ").append(p.getDataType())
|
||||
fmtStr.append("------ Data Type: ").append(p.getDataType())
|
||||
.append(newline);
|
||||
|
||||
fmtStr.append("------ Level Type: ").append(newline);
|
||||
for (DataLevelType dlt : p.getLevelType()) {
|
||||
fmtStr.append("------------ Type: ").append(dlt.getType())
|
||||
.append(newline);
|
||||
fmtStr.append("------------ ID : ").append(dlt.getId())
|
||||
fmtStr.append("------------ ID: ").append(dlt.getId())
|
||||
.append(newline);
|
||||
if (dlt.getUnit() != null) {
|
||||
fmtStr.append("------------ Unit: ").append(dlt.getUnit())
|
||||
|
@ -713,6 +718,17 @@ public class DataDeliveryUtils {
|
|||
return fmtStr.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a formatted list.
|
||||
*
|
||||
* @param list
|
||||
* List of items
|
||||
* @return a formatted list as a String
|
||||
*/
|
||||
public static String getFormatedList(Set<String> list) {
|
||||
return StringUtil.getIndentedList(list, " ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an authorization request
|
||||
*
|
||||
|
@ -756,7 +772,8 @@ public class DataDeliveryUtils {
|
|||
final int nextIndex = i + 1;
|
||||
if (nextIndex < size) {
|
||||
int tempMax = cycles.get(nextIndex) - cycles.get(i);
|
||||
maximumTimeBetweenCycles = Math.max(maximumTimeBetweenCycles, tempMax);
|
||||
maximumTimeBetweenCycles = Math.max(maximumTimeBetweenCycles,
|
||||
tempMax);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.ui.widgets;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.raytheon.viz.ui.widgets.duallist.DualList;
|
||||
import com.raytheon.viz.ui.widgets.duallist.DualListConfig;
|
||||
|
||||
/**
|
||||
* Dual list widget composite.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 29, 2013 1040 mpduff Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class DualListComposite extends Composite {
|
||||
|
||||
private DualList dl;
|
||||
|
||||
private final DualListConfig config;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param parent
|
||||
* Parent composite
|
||||
* @param config
|
||||
* Dual list config
|
||||
*/
|
||||
public DualListComposite(Composite parent, DualListConfig config) {
|
||||
super(parent, SWT.NONE);
|
||||
this.config = config;
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
private void init() {
|
||||
GridLayout gl = new GridLayout(3, false);
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
dl = new DualList(this, SWT.NONE, config);
|
||||
dl.setLayout(gl);
|
||||
dl.setLayoutData(gd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the selected items.
|
||||
*
|
||||
* @return String[] of items in the selected list
|
||||
*/
|
||||
public String[] getSelectedItems() {
|
||||
return dl.getSelectedListItems();
|
||||
}
|
||||
}
|
54
deltaScripts/13.5.1/convertSubscriptionSitesToCollection.sh
Normal file
54
deltaScripts/13.5.1/convertSubscriptionSitesToCollection.sh
Normal file
|
@ -0,0 +1,54 @@
|
|||
#!/bin/bash
|
||||
|
||||
SQL_SCRIPT="getSubscriptionSite.sql"
|
||||
|
||||
# ensure that the sql script is present
|
||||
if [ ! -f ${SQL_SCRIPT} ]; then
|
||||
echo "ERROR: the required sql script - ${SQL_SCRIPT} was not found."
|
||||
echo "FATAL: the update has failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "INFO: update started - converting Subscription sites to a collection"
|
||||
|
||||
# run the update
|
||||
OUTPUT=`/awips2/psql/bin/psql -U awips -d metadata -f ${SQL_SCRIPT}`
|
||||
SITE=`echo $OUTPUT | sed 's/.*{\(.*\)}.*/\1/g'`
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "FATAL: the update has failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If we were able to find a subscription with a site, then this update will run.
|
||||
# Otherwise, there are no subscriptions to convert.
|
||||
if test "${SITE#*awips}" != "$SITE"
|
||||
then
|
||||
echo "INFO: there are no subscriptions in the database, not applying update."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SQL_SCRIPT="convertSubscriptionSitesToCollection.sql"
|
||||
|
||||
# ensure that the sql script is present
|
||||
if [ ! -f ${SQL_SCRIPT} ]; then
|
||||
echo "ERROR: the required sql script - ${SQL_SCRIPT} was not found."
|
||||
echo "FATAL: the update has failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Copy the sql file, replacing the SITE token with the actual site
|
||||
cat ${SQL_SCRIPT} | sed "s/@@SITE@@/${SITE}/g" > /tmp/${SQL_SCRIPT}
|
||||
|
||||
# run the update
|
||||
/awips2/psql/bin/psql -U awips -d metadata -f /tmp/${SQL_SCRIPT}
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "FATAL: the update has failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove temporary file
|
||||
rm /tmp/${SQL_SCRIPT}
|
||||
|
||||
echo "INFO: the update has completed successfully!"
|
||||
|
||||
exit 0
|
|
@ -17,34 +17,20 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.datadelivery.subscription.subset;
|
||||
\set ON_ERROR_STOP 1
|
||||
\connect metadata;
|
||||
|
||||
/**
|
||||
* Interface that will be implemented for phase3 datadelivery, but not in the
|
||||
* common baseline.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 27, 2013 1841 djohnson Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
-- Start a transaction
|
||||
BEGIN;
|
||||
|
||||
public interface ISharedSubscriptionHandler {
|
||||
|
||||
/**
|
||||
* Launch the GUI to create a shared subscription.
|
||||
*
|
||||
* @param subsetManagerDlg
|
||||
*/
|
||||
void launchCreateSharedSubscriptionGui(
|
||||
SubsetManagerDlg<?, ?, ?> subsetManagerDlg);
|
||||
-- Remove officeID attribute
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, 'officeID=".*?"', '', 'g');
|
||||
|
||||
}
|
||||
-- Add officeID element
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '(<pendingSiteSubscription.*?>)', E'\\1<officeId>@@SITE@@</officeId>', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '(<initialPendingSiteSubscription.*?>)', E'\\1<officeId>@@SITE@@</officeId>', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '(<siteSubscription.*?>)', E'\\1<officeId>@@SITE@@</officeId>', 'g');
|
||||
|
||||
-- Commit the transaction
|
||||
END;
|
23
deltaScripts/13.5.1/getSubscriptionSite.sql
Normal file
23
deltaScripts/13.5.1/getSubscriptionSite.sql
Normal file
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
\set ON_ERROR_STOP 1
|
||||
\connect metadata;
|
||||
|
||||
select distinct regexp_matches(stringvalue, 'officeID="(.*?)"') from ebxml.value where stringvalue like '%officeID%';
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
SQL_SCRIPT="renameSubscriptionToUserSubscription.sql"
|
||||
SQL_SCRIPT="renameSubscriptionToSiteSubscription.sql"
|
||||
|
||||
# ensure that the sql script is present
|
||||
if [ ! -f ${SQL_SCRIPT} ]; then
|
||||
|
@ -9,7 +9,7 @@ if [ ! -f ${SQL_SCRIPT} ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "INFO: update started - renaming Subscription to UserSubscription"
|
||||
echo "INFO: update started - renaming Subscription to SiteSubscription"
|
||||
|
||||
# run the update
|
||||
/awips2/psql/bin/psql -U awips -d metadata -f ${SQL_SCRIPT}
|
|
@ -23,49 +23,49 @@
|
|||
-- Start a transaction
|
||||
BEGIN;
|
||||
|
||||
-- New classification nodes for UserSubscription
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.UserSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.UserSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'com.raytheon.uf.common.datadelivery.registry.UserSubscription', parent, '/com.raytheon.uf.common.datadelivery.registry.UserSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:UserSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:UserSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'UserSubscription', parent, '/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject/UserSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Subscription';
|
||||
-- New classification nodes for SiteSubscription
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.SiteSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.SiteSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'com.raytheon.uf.common.datadelivery.registry.SiteSubscription', parent, '/com.raytheon.uf.common.datadelivery.registry.SiteSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:SiteSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:SiteSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'SiteSubscription', parent, '/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject/SiteSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Subscription';
|
||||
|
||||
-- Update foreign keys for the taxonomy to UserSubscription
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.UserSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:UserSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Subscription';
|
||||
-- Update foreign keys for the taxonomy to SiteSubscription
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.SiteSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:SiteSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Subscription';
|
||||
|
||||
-- Delete Subscription classification nodes
|
||||
delete from ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Subscription';
|
||||
delete from ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
|
||||
-- Update registry object references from Subscription to UserSubscription
|
||||
update ebxml.registryobjectlist_registryobject set registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.UserSubscription' where registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
update ebxml.registryobject set objecttype = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.UserSubscription' where objecttype ='urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '<subscription ', '<userSubscription ', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '</subscription>', '</userSubscription>', 'g');
|
||||
-- Update registry object references from Subscription to SiteSubscription
|
||||
update ebxml.registryobjectlist_registryobject set registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.SiteSubscription' where registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
update ebxml.registryobject set objecttype = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.SiteSubscription' where objecttype ='urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.Subscription';
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '<subscription ', '<siteSubscription ', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '</subscription>', '</siteSubscription>', 'g');
|
||||
|
||||
-- Update the aggregated events
|
||||
update events.aggregate set grouping = regexp_replace(grouping, 'com\.raytheon\.uf\.common\.datadelivery\.registry\.Subscription', 'com.raytheon.uf.common.datadelivery.registry.UserSubscription', 'g');
|
||||
update events.aggregate set grouping = regexp_replace(grouping, 'com\.raytheon\.uf\.common\.datadelivery\.registry\.Subscription', 'com.raytheon.uf.common.datadelivery.registry.SiteSubscription', 'g');
|
||||
|
||||
-- New classification nodes for InitialPendingUserSubscription
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription', parent, '/com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingUserSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingUserSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'UserSubscription', parent, '/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject/UserSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSubscription';
|
||||
-- New classification nodes for InitialPendingSiteSubscription
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription', parent, '/com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
insert into ebxml.classificationnode(id, lid, objecttype, owner, status, userversionname, versionname, description_key, name_key, code, parent, path) SELECT 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSiteSubscription', 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSiteSubscription', objecttype, owner, status, userversionname, versionname, description_key, name_key, 'SiteSubscription', parent, '/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject/SiteSubscription' FROM ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSubscription';
|
||||
|
||||
-- Update foreign keys for the taxonomy to InitialPendingUserSubscription
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingUserSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSubscription';
|
||||
-- Update foreign keys for the taxonomy to InitialPendingSiteSubscription
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
update ebxml.taxonomyelementtype_classificationnode set classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSiteSubscription' where classificationnode_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSubscription';
|
||||
|
||||
-- Delete InitialPendingSubscription classification nodes
|
||||
delete from ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:InitialPendingSubscription';
|
||||
delete from ebxml.classificationnode where id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
|
||||
-- Update registry object references from InitialPendingSubscription to InitialPendingUserSubscription
|
||||
update ebxml.registryobjectlist_registryobject set registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription' where registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
update ebxml.registryobject set objecttype = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription' where objecttype ='urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '<pendingSubscription ', '<pendingUserSubscription ', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '</pendingSubscription>', '</pendingUserSubscription>', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '<initialPendingSubscription ', '<initialPendingUserSubscription ', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '</initialPendingSubscription>', '</initialPendingUserSubscription>', 'g');
|
||||
-- Update registry object references from InitialPendingSubscription to InitialPendingSiteSubscription
|
||||
update ebxml.registryobjectlist_registryobject set registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription' where registryobject_id = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
update ebxml.registryobject set objecttype = 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription' where objecttype ='urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription';
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '<pendingSubscription ', '<pendingSiteSubscription ', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '</pendingSubscription>', '</pendingSiteSubscription>', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '<initialPendingSubscription ', '<initialPendingSiteSubscription ', 'g');
|
||||
update ebxml.value set stringvalue = regexp_replace(stringvalue, '</initialPendingSubscription>', '</initialPendingSiteSubscription>', 'g');
|
||||
|
||||
-- Update the aggregated events
|
||||
update events.aggregate set grouping = regexp_replace(grouping, 'com\.raytheon\.uf\.common\.datadelivery\.registry\.InitialPendingSubscription', 'com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription', 'g');
|
||||
update events.aggregate set grouping = regexp_replace(grouping, 'com\.raytheon\.uf\.common\.datadelivery\.registry\.InitialPendingSubscription', 'com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription', 'g');
|
||||
|
||||
-- Commit the transaction
|
||||
END;
|
|
@ -23,6 +23,7 @@ package com.raytheon.uf.common.auth.req;
|
|||
import java.rmi.RemoteException;
|
||||
|
||||
import com.raytheon.uf.common.auth.resp.SuccessfulExecution;
|
||||
import com.raytheon.uf.common.auth.resp.UserNotAuthorized;
|
||||
import com.raytheon.uf.common.serialization.ExceptionWrapper;
|
||||
import com.raytheon.uf.common.serialization.comm.response.ServerErrorResponse;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -37,7 +38,8 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 23, 2013 1643 djohnson Initial creation
|
||||
* Jan 23, 2013 1643 djohnson Initial creation.
|
||||
* May 20, 2013 1040 mpduff Add check for UserNotAuthorized.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -70,6 +72,8 @@ public class BasePrivilegedServerService<T extends AbstractPrivilegedRequest>
|
|||
ExceptionWrapper
|
||||
.unwrapThrowable(((ServerErrorResponse) object)
|
||||
.getException()));
|
||||
} else if (object instanceof UserNotAuthorized) {
|
||||
return null;
|
||||
} else {
|
||||
statusHandler
|
||||
.warn(String
|
||||
|
|
|
@ -20,7 +20,7 @@ com.raytheon.uf.common.datadelivery.registry.OpenDapGriddedDataSetMetaData
|
|||
com.raytheon.uf.common.datadelivery.registry.Parameter
|
||||
com.raytheon.uf.common.datadelivery.registry.ParameterLevel
|
||||
com.raytheon.uf.common.datadelivery.registry.PendingSharedSubscription
|
||||
com.raytheon.uf.common.datadelivery.registry.PendingUserSubscription
|
||||
com.raytheon.uf.common.datadelivery.registry.PendingSiteSubscription
|
||||
com.raytheon.uf.common.datadelivery.registry.Projection
|
||||
com.raytheon.uf.common.datadelivery.registry.Provider
|
||||
com.raytheon.uf.common.datadelivery.registry.Time
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* Dec 11, 2012 1403 djohnson No longer a registry object.
|
||||
* Dec 12, 2012 1433 bgonzale Use new Subscription copy ctor.
|
||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -53,7 +54,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
@XmlRootElement(name = "AdhocSubscription")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class AdhocSubscription extends UserSubscription implements
|
||||
public class AdhocSubscription extends SiteSubscription implements
|
||||
ISerializableObject {
|
||||
|
||||
private static final long serialVersionUID = -2200080380095632486L;
|
||||
|
@ -62,7 +63,7 @@ public class AdhocSubscription extends UserSubscription implements
|
|||
setGroupName("Adhoc");
|
||||
}
|
||||
|
||||
public AdhocSubscription(UserSubscription subscription) {
|
||||
public AdhocSubscription(SiteSubscription subscription) {
|
||||
super(subscription);
|
||||
setGroupName("Adhoc");
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 5, 2012 0726 djohnson Initial creation
|
||||
* Dec 11, 2012 1403 djohnson Adhoc subscriptions no longer go to the registry.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -49,8 +50,8 @@ public final class DataDeliveryRegistryObjectTypes {
|
|||
public static final String DATASETMETADATA = RegistryUtil
|
||||
.getObjectType(DataSetMetaData.class);
|
||||
|
||||
public static final String USER_SUBSCRIPTION = RegistryUtil
|
||||
.getObjectType(UserSubscription.class);
|
||||
public static final String SITE_SUBSCRIPTION = RegistryUtil
|
||||
.getObjectType(SiteSubscription.class);
|
||||
|
||||
public static final String SHARED_SUBSCRIPTION = RegistryUtil
|
||||
.getObjectType(SharedSubscription.class);
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Dec 12, 2012 1433 bgonzale Use new Subscription copy ctor.
|
||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 02, 2013 1841 djohnson InitialPendingSubscription is now InitialPendingUserSubscription.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,7 +58,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
Subscription.NAME_SLOT, Subscription.DATA_SET_SLOT,
|
||||
Subscription.OWNER_SLOT,
|
||||
InitialPendingSubscription.CHANGE_REQUEST_ID_SLOT })
|
||||
public class InitialPendingUserSubscription extends UserSubscription implements
|
||||
public class InitialPendingSiteSubscription extends SiteSubscription implements
|
||||
InitialPendingSubscription {
|
||||
private static final long serialVersionUID = 2779084460608459754L;
|
||||
|
||||
|
@ -75,7 +76,7 @@ public class InitialPendingUserSubscription extends UserSubscription implements
|
|||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public InitialPendingUserSubscription() {
|
||||
public InitialPendingSiteSubscription() {
|
||||
//empty
|
||||
}
|
||||
|
||||
|
@ -87,7 +88,7 @@ public class InitialPendingUserSubscription extends UserSubscription implements
|
|||
* @param user
|
||||
* user
|
||||
*/
|
||||
public InitialPendingUserSubscription(UserSubscription subscription, String user) {
|
||||
public InitialPendingSiteSubscription(SiteSubscription subscription, String user) {
|
||||
super(subscription);
|
||||
|
||||
this.setChangeReqId(user);
|
||||
|
@ -134,6 +135,6 @@ public class InitialPendingUserSubscription extends UserSubscription implements
|
|||
*/
|
||||
@Override
|
||||
public Subscription subscription() {
|
||||
return new UserSubscription(this);
|
||||
return new SiteSubscription(this);
|
||||
}
|
||||
}
|
|
@ -53,22 +53,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
@RegistryObject(objectType = InitialPendingUserSubscription.class, value = {
|
||||
@RegistryObject(objectType = InitialPendingSiteSubscription.class, value = {
|
||||
Subscription.PROVIDER_NAME_SLOT, Subscription.NAME_SLOT,
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT,
|
||||
InitialPendingSubscription.CHANGE_REQUEST_ID_SLOT }, associationMappings = { @AssociationMapping(associationType = AssociationTypes.RELATED_TO, keyFields = {
|
||||
Subscription.PROVIDER_NAME_SLOT, Subscription.NAME_SLOT,
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT }, required = false, targetObject = UserSubscription.class) })
|
||||
public class PendingUserSubscription extends InitialPendingUserSubscription
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT }, required = false, targetObject = SiteSubscription.class) })
|
||||
public class PendingSiteSubscription extends InitialPendingSiteSubscription
|
||||
implements PendingSubscription, ISerializableObject {
|
||||
|
||||
private static final long serialVersionUID = 7607153845750089310L;
|
||||
|
||||
public PendingUserSubscription() {
|
||||
public PendingSiteSubscription() {
|
||||
|
||||
}
|
||||
|
||||
public PendingUserSubscription(UserSubscription subscription,
|
||||
public PendingSiteSubscription(SiteSubscription subscription,
|
||||
String currentUser) {
|
||||
super(subscription, currentUser);
|
||||
}
|
|
@ -24,6 +24,8 @@ import java.util.ArrayList;
|
|||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
@ -35,10 +37,12 @@ import javax.xml.bind.annotation.XmlSeeAlso;
|
|||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
|
||||
import com.raytheon.uf.common.registry.annotations.SlotAttribute;
|
||||
import com.raytheon.uf.common.registry.annotations.SlotAttributeConverter;
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.registry.ebxml.slots.SetSlotConverter;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
@ -54,6 +58,8 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 25, 2013 1841 djohnson Extracted from Subscription.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Changed to use Set for office id.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,8 +67,8 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlSeeAlso({ PendingUserSubscription.class, PendingSharedSubscription.class,
|
||||
AdhocSubscription.class, UserSubscription.class,
|
||||
@XmlSeeAlso({ PendingSiteSubscription.class, PendingSharedSubscription.class,
|
||||
AdhocSubscription.class, SiteSubscription.class,
|
||||
SharedSubscription.class })
|
||||
public abstract class RecurringSubscription implements ISerializableObject,
|
||||
Serializable, Subscription {
|
||||
|
@ -84,7 +90,7 @@ public abstract class RecurringSubscription implements ISerializableObject,
|
|||
* @param name
|
||||
* New subscription name
|
||||
*/
|
||||
public RecurringSubscription(RecurringSubscription sub, String name) {
|
||||
public RecurringSubscription(Subscription sub, String name) {
|
||||
this.setActive(sub.isActive());
|
||||
this.setActivePeriodEnd(sub.getActivePeriodEnd());
|
||||
this.setActivePeriodStart(sub.getActivePeriodStart());
|
||||
|
@ -96,7 +102,7 @@ public abstract class RecurringSubscription implements ISerializableObject,
|
|||
this.setGroupName(sub.getGroupName());
|
||||
this.setId(sub.getId());
|
||||
this.setName(name);
|
||||
this.setOfficeID(sub.getOfficeID());
|
||||
this.setOfficeIDs(sub.getOfficeIDs());
|
||||
this.setParameter(sub.getParameter());
|
||||
this.setPriority(sub.getPriority());
|
||||
this.setProvider(sub.getProvider());
|
||||
|
@ -120,7 +126,7 @@ public abstract class RecurringSubscription implements ISerializableObject,
|
|||
* @param sub
|
||||
* Subscription object
|
||||
*/
|
||||
public RecurringSubscription(RecurringSubscription sub) {
|
||||
public RecurringSubscription(Subscription sub) {
|
||||
this(sub, sub.getName());
|
||||
}
|
||||
|
||||
|
@ -143,10 +149,11 @@ public abstract class RecurringSubscription implements ISerializableObject,
|
|||
@SlotAttribute(PROVIDER_NAME_SLOT)
|
||||
private String provider;
|
||||
|
||||
@XmlAttribute
|
||||
@XmlElements({ @XmlElement(name = "officeId") })
|
||||
@DynamicSerializeElement
|
||||
@SlotAttribute
|
||||
private String officeID;
|
||||
@SlotAttributeConverter(SetSlotConverter.class)
|
||||
protected Set<String> officeIDs = Sets.newTreeSet();
|
||||
|
||||
@XmlAttribute
|
||||
@DynamicSerializeElement
|
||||
|
@ -308,24 +315,19 @@ public abstract class RecurringSubscription implements ISerializableObject,
|
|||
}
|
||||
|
||||
/**
|
||||
* Get owner office id.
|
||||
*
|
||||
* @return office id
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getOfficeID() {
|
||||
return officeID;
|
||||
public Set<String> getOfficeIDs() {
|
||||
return officeIDs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set office id.
|
||||
*
|
||||
* @param officeID
|
||||
* the office id
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setOfficeID(String officeID) {
|
||||
this.officeID = officeID;
|
||||
public void setOfficeIDs(Set<String> officeIDs) {
|
||||
this.officeIDs = new TreeSet<String>(officeIDs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 27, 2013 1841 djohnson Initial creation
|
||||
* May 15, 2013 1040 mpduff Added addOfficeId.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -52,7 +53,7 @@ public class SharedSubscription extends RecurringSubscription {
|
|||
|
||||
private static final long serialVersionUID = -7221500266253493273L;
|
||||
|
||||
public static final String SHARED_SUBSCRIPTION_OWNER = "shared";
|
||||
private static final String SHARED_SUBSCRIPTION_OWNER = "shared";
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -64,7 +65,7 @@ public class SharedSubscription extends RecurringSubscription {
|
|||
/**
|
||||
* @param sharedSubscription
|
||||
*/
|
||||
public SharedSubscription(SharedSubscription sub) {
|
||||
public SharedSubscription(Subscription sub) {
|
||||
super(sub);
|
||||
}
|
||||
|
||||
|
@ -114,4 +115,14 @@ public class SharedSubscription extends RecurringSubscription {
|
|||
public PendingSubscription pending(String currentUser) {
|
||||
return new PendingSharedSubscription(this, currentUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void addOfficeID(String officeId) {
|
||||
if (!officeIDs.contains(officeId)) {
|
||||
this.officeIDs.add(officeId);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -56,6 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Jan 25, 2013 1528 djohnson Subscription priority is now an enum.
|
||||
* Feb 20, 2013 1543 djohnson Route is now a slot.
|
||||
* Mar 29, 2013 1841 djohnson Renamed to UserSubscription.
|
||||
* May 15, 2013 1040 mpduff Added addOfficeId.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -68,13 +70,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
@RegistryObject({ Subscription.PROVIDER_NAME_SLOT, Subscription.NAME_SLOT,
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT })
|
||||
@DynamicSerialize
|
||||
public class UserSubscription extends RecurringSubscription {
|
||||
public class SiteSubscription extends RecurringSubscription {
|
||||
private static final long serialVersionUID = -6422673887457060034L;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public UserSubscription() {
|
||||
public SiteSubscription() {
|
||||
|
||||
}
|
||||
|
||||
|
@ -86,7 +88,7 @@ public class UserSubscription extends RecurringSubscription {
|
|||
* @param name
|
||||
* New subscription name
|
||||
*/
|
||||
public UserSubscription(UserSubscription sub, String name) {
|
||||
public SiteSubscription(SiteSubscription sub, String name) {
|
||||
this(sub);
|
||||
this.setName(name);
|
||||
this.setId(RegistryUtil.getRegistryObjectKey(this));
|
||||
|
@ -98,7 +100,7 @@ public class UserSubscription extends RecurringSubscription {
|
|||
* @param sub
|
||||
* Subscription object
|
||||
*/
|
||||
public UserSubscription(UserSubscription sub) {
|
||||
public SiteSubscription(SiteSubscription sub) {
|
||||
super(sub);
|
||||
this.setOwner(sub.getOwner());
|
||||
}
|
||||
|
@ -133,7 +135,7 @@ public class UserSubscription extends RecurringSubscription {
|
|||
*/
|
||||
@Override
|
||||
public Subscription copy() {
|
||||
return new UserSubscription(this);
|
||||
return new SiteSubscription(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -141,7 +143,7 @@ public class UserSubscription extends RecurringSubscription {
|
|||
*/
|
||||
@Override
|
||||
public Subscription copy(String newName) {
|
||||
return new UserSubscription(this, newName);
|
||||
return new SiteSubscription(this, newName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,7 +151,7 @@ public class UserSubscription extends RecurringSubscription {
|
|||
*/
|
||||
@Override
|
||||
public InitialPendingSubscription initialPending(String currentUser) {
|
||||
return new InitialPendingUserSubscription(this, currentUser);
|
||||
return new InitialPendingSiteSubscription(this, currentUser);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -157,6 +159,16 @@ public class UserSubscription extends RecurringSubscription {
|
|||
*/
|
||||
@Override
|
||||
public PendingSubscription pending(String currentUser) {
|
||||
return new PendingUserSubscription(this, currentUser);
|
||||
return new PendingSiteSubscription(this, currentUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void addOfficeID(String officeId) {
|
||||
if (!officeIDs.contains(officeId)) {
|
||||
this.officeIDs.add(officeId);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ package com.raytheon.uf.common.datadelivery.registry;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
@ -36,6 +37,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 25, 2013 1841 djohnson Extracted from UserSubscription.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Changed officeId to a set.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -180,19 +182,19 @@ public interface Subscription {
|
|||
String getOwner();
|
||||
|
||||
/**
|
||||
* Get owner office id.
|
||||
* Get office ids.
|
||||
*
|
||||
* @return office id
|
||||
* @return office id list
|
||||
*/
|
||||
String getOfficeID();
|
||||
Set<String> getOfficeIDs();
|
||||
|
||||
/**
|
||||
* Set office id.
|
||||
* Set office ids.
|
||||
*
|
||||
* @param officeID
|
||||
* the office id
|
||||
* @param officeIDs
|
||||
* the office ids
|
||||
*/
|
||||
void setOfficeID(String officeID);
|
||||
void setOfficeIDs(Set<String> officeIDs);
|
||||
|
||||
/**
|
||||
* Get subscription priority for fulfillment.
|
||||
|
@ -591,4 +593,12 @@ public interface Subscription {
|
|||
* @return
|
||||
*/
|
||||
PendingSubscription pending(String currentUser);
|
||||
|
||||
/**
|
||||
* Add an office Id to the list.
|
||||
*
|
||||
* @param officeId
|
||||
* Office Id to add
|
||||
*/
|
||||
void addOfficeID(String officeId);
|
||||
}
|
|
@ -22,7 +22,8 @@ package com.raytheon.uf.common.datadelivery.registry.ebxml;
|
|||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
||||
/**
|
||||
|
@ -39,6 +40,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* Jun 21, 2012 736 djohnson Add thrift serialization annotations.
|
||||
* Aug 02, 2012 955 djohnson Add generics and results retrieval to registry queries.
|
||||
* Sep 24, 2012 1157 mpduff Extends InitialPendingUserSubscriptionQuery.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -47,22 +49,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class PendingUserSubscriptionQuery extends
|
||||
SubscriptionFilterableQuery<InitialPendingUserSubscription> {
|
||||
public class PendingSiteSubscriptionQuery extends
|
||||
SubscriptionFilterableQuery<InitialPendingSiteSubscription> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class<InitialPendingUserSubscription> getResultType() {
|
||||
return InitialPendingUserSubscription.class;
|
||||
public Class<InitialPendingSiteSubscription> getResultType() {
|
||||
return InitialPendingSiteSubscription.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class<InitialPendingUserSubscription> getObjectType() {
|
||||
return InitialPendingUserSubscription.class;
|
||||
public Class<InitialPendingSiteSubscription> getObjectType() {
|
||||
return InitialPendingSiteSubscription.class;
|
||||
}
|
||||
}
|
|
@ -22,12 +22,12 @@ package com.raytheon.uf.common.datadelivery.registry.ebxml;
|
|||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
||||
/**
|
||||
* Implementation of {@link SubscriptionFilterableQuery} to retrieve
|
||||
* {@link UserSubscription}s.
|
||||
* {@link SiteSubscription}s.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -39,6 +39,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* Jul 23, 2012 702 jpiatt Added setters for groupName & officeId.
|
||||
* Oct 03, 2012 1241 djohnson Move query parameters to {@link SubscriptionFilterableQuery}.
|
||||
* Mar 29, 2013 1841 djohnson Renamed from SubscriptionQuery.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,21 +49,21 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class UserSubscriptionQuery extends
|
||||
SubscriptionFilterableQuery<UserSubscription> {
|
||||
public class SiteSubscriptionQuery extends
|
||||
SubscriptionFilterableQuery<SiteSubscription> {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class<UserSubscription> getResultType() {
|
||||
return UserSubscription.class;
|
||||
public Class<SiteSubscription> getResultType() {
|
||||
return SiteSubscription.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Class<UserSubscription> getObjectType() {
|
||||
return UserSubscription.class;
|
||||
public Class<SiteSubscription> getObjectType() {
|
||||
return SiteSubscription.class;
|
||||
}
|
||||
}
|
|
@ -19,12 +19,12 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.datadelivery.registry.handlers;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
|
||||
/**
|
||||
* The {@link IRegistryObjectHandler} interface for
|
||||
* {@link InitialPendingUserSubscription}.
|
||||
* {@link InitialPendingSiteSubscription}.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -41,6 +41,6 @@ import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
|||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface IPendingUserSubscriptionHandler extends
|
||||
IBasePendingSubscriptionHandler<InitialPendingUserSubscription> {
|
||||
public interface IPendingSiteSubscriptionHandler extends
|
||||
IBasePendingSubscriptionHandler<InitialPendingSiteSubscription> {
|
||||
}
|
|
@ -20,7 +20,7 @@
|
|||
package com.raytheon.uf.common.datadelivery.registry.handlers;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
|
||||
/**
|
||||
|
@ -41,6 +41,6 @@ import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
|||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface IUserSubscriptionHandler extends
|
||||
ISubscriptionTypeHandler<UserSubscription> {
|
||||
public interface ISiteSubscriptionHandler extends
|
||||
ISubscriptionTypeHandler<SiteSubscription> {
|
||||
}
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 05, 2013 1841 djohnson Initial creation
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.datadelivery.registry.handlers;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.PendingUserSubscriptionQuery;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.PendingSiteSubscriptionQuery;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
|
||||
/**
|
||||
* {@link IRegistryObjectHandler} implementation for
|
||||
* {@link InitialPendingUserSubscription}s.
|
||||
* {@link InitialPendingSiteSubscription}s.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -42,23 +42,23 @@ import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
|||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public class PendingUserSubscriptionHandler extends
|
||||
BasePendingSubscriptionHandler<InitialPendingUserSubscription, PendingUserSubscriptionQuery>
|
||||
implements IPendingUserSubscriptionHandler {
|
||||
public class PendingSiteSubscriptionHandler extends
|
||||
BasePendingSubscriptionHandler<InitialPendingSiteSubscription, PendingSiteSubscriptionQuery>
|
||||
implements IPendingSiteSubscriptionHandler {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected PendingUserSubscriptionQuery getQuery() {
|
||||
return new PendingUserSubscriptionQuery();
|
||||
protected PendingSiteSubscriptionQuery getQuery() {
|
||||
return new PendingSiteSubscriptionQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Class<InitialPendingUserSubscription> getRegistryObjectClass() {
|
||||
return InitialPendingUserSubscription.class;
|
||||
protected Class<InitialPendingSiteSubscription> getRegistryObjectClass() {
|
||||
return InitialPendingSiteSubscription.class;
|
||||
}
|
||||
}
|
|
@ -29,10 +29,10 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.collect.Sets;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
|
@ -58,22 +58,22 @@ import com.raytheon.uf.common.util.CollectionUtil;
|
|||
*/
|
||||
public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
||||
|
||||
private final IPendingUserSubscriptionHandler userSubscriptionHandler;
|
||||
private final IPendingSiteSubscriptionHandler siteSubscriptionHandler;
|
||||
|
||||
private final IPendingSharedSubscriptionHandler sharedSubscriptionHandler;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param userSubscriptionHandler
|
||||
* @param siteSubscriptionHandler
|
||||
* the user subscription handler
|
||||
* @param sharedSubscriptionHandler
|
||||
* the shared subscription handler
|
||||
*/
|
||||
public PendingSubscriptionHandler(
|
||||
IPendingUserSubscriptionHandler userSubscriptionHandler,
|
||||
IPendingSiteSubscriptionHandler siteSubscriptionHandler,
|
||||
IPendingSharedSubscriptionHandler sharedSubscriptionHandler) {
|
||||
this.userSubscriptionHandler = userSubscriptionHandler;
|
||||
this.siteSubscriptionHandler = siteSubscriptionHandler;
|
||||
this.sharedSubscriptionHandler = sharedSubscriptionHandler;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public InitialPendingSubscription getByName(String name)
|
||||
throws RegistryHandlerException {
|
||||
InitialPendingSubscription value = userSubscriptionHandler
|
||||
InitialPendingSubscription value = siteSubscriptionHandler
|
||||
.getByName(name);
|
||||
if (value == null) {
|
||||
value = sharedSubscriptionHandler.getByName(name);
|
||||
|
@ -98,8 +98,8 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getByOwner(String owner)
|
||||
throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getByOwner(owner));
|
||||
subs.addAll(userSubscriptionHandler.getByOwner(owner));
|
||||
subs.addAll(siteSubscriptionHandler.getByOwner(owner));
|
||||
subs.addAll(siteSubscriptionHandler.getByOwner(owner));
|
||||
return subs;
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getByGroupName(String group)
|
||||
throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getByGroupName(group));
|
||||
subs.addAll(siteSubscriptionHandler.getByGroupName(group));
|
||||
subs.addAll(sharedSubscriptionHandler.getByGroupName(group));
|
||||
return subs;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getByFilters(String group,
|
||||
String officeId) throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getByFilters(group, officeId));
|
||||
subs.addAll(siteSubscriptionHandler.getByFilters(group, officeId));
|
||||
subs.addAll(sharedSubscriptionHandler.getByFilters(group, officeId));
|
||||
return subs;
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public Set<String> getSubscribedToDataSetNames()
|
||||
throws RegistryHandlerException {
|
||||
Set<String> names = Sets.newHashSet();
|
||||
names.addAll(userSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
names.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
names.addAll(sharedSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
return names;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getActive()
|
||||
throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getActive());
|
||||
subs.addAll(siteSubscriptionHandler.getActive());
|
||||
subs.addAll(sharedSubscriptionHandler.getActive());
|
||||
return subs;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getActiveForRoute(Network route)
|
||||
throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getActiveForRoute(route));
|
||||
subs.addAll(siteSubscriptionHandler.getActiveForRoute(route));
|
||||
subs.addAll(sharedSubscriptionHandler.getActiveForRoute(route));
|
||||
return subs;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getActiveForRoutes(
|
||||
Network... routes) throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getActiveForRoutes(routes));
|
||||
subs.addAll(siteSubscriptionHandler.getActiveForRoutes(routes));
|
||||
subs.addAll(sharedSubscriptionHandler.getActiveForRoutes(routes));
|
||||
return subs;
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public InitialPendingSubscription getById(String id)
|
||||
throws RegistryHandlerException {
|
||||
InitialPendingSubscription value = userSubscriptionHandler.getById(id);
|
||||
InitialPendingSubscription value = siteSubscriptionHandler.getById(id);
|
||||
if (value == null) {
|
||||
value = sharedSubscriptionHandler.getById(id);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getAll()
|
||||
throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getAll());
|
||||
subs.addAll(siteSubscriptionHandler.getAll());
|
||||
subs.addAll(sharedSubscriptionHandler.getAll());
|
||||
return subs;
|
||||
}
|
||||
|
@ -206,8 +206,8 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public void store(InitialPendingSubscription obj)
|
||||
throws RegistryHandlerException {
|
||||
if (obj instanceof InitialPendingUserSubscription) {
|
||||
userSubscriptionHandler.store((InitialPendingUserSubscription) obj);
|
||||
if (obj instanceof InitialPendingSiteSubscription) {
|
||||
siteSubscriptionHandler.store((InitialPendingSiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler
|
||||
.store((InitialPendingSharedSubscription) obj);
|
||||
|
@ -220,9 +220,9 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public void update(InitialPendingSubscription obj)
|
||||
throws RegistryHandlerException {
|
||||
if (obj instanceof InitialPendingUserSubscription) {
|
||||
userSubscriptionHandler
|
||||
.update((InitialPendingUserSubscription) obj);
|
||||
if (obj instanceof InitialPendingSiteSubscription) {
|
||||
siteSubscriptionHandler
|
||||
.update((InitialPendingSiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler
|
||||
.update((InitialPendingSharedSubscription) obj);
|
||||
|
@ -235,9 +235,9 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public void delete(InitialPendingSubscription obj)
|
||||
throws RegistryHandlerException {
|
||||
if (obj instanceof InitialPendingUserSubscription) {
|
||||
userSubscriptionHandler
|
||||
.delete((InitialPendingUserSubscription) obj);
|
||||
if (obj instanceof InitialPendingSiteSubscription) {
|
||||
siteSubscriptionHandler
|
||||
.delete((InitialPendingSiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler
|
||||
.delete((InitialPendingSharedSubscription) obj);
|
||||
|
@ -250,7 +250,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public void deleteById(String username, String registryId)
|
||||
throws RegistryHandlerException {
|
||||
userSubscriptionHandler.deleteById(username, registryId);
|
||||
siteSubscriptionHandler.deleteById(username, registryId);
|
||||
sharedSubscriptionHandler.deleteById(username, registryId);
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public void deleteByIds(String username, List<String> registryIds)
|
||||
throws RegistryHandlerException {
|
||||
userSubscriptionHandler.deleteByIds(username, registryIds);
|
||||
siteSubscriptionHandler.deleteByIds(username, registryIds);
|
||||
sharedSubscriptionHandler.deleteByIds(username, registryIds);
|
||||
}
|
||||
|
||||
|
@ -270,9 +270,9 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public void delete(String username, InitialPendingSubscription obj)
|
||||
throws RegistryHandlerException {
|
||||
if (obj instanceof InitialPendingUserSubscription) {
|
||||
userSubscriptionHandler.delete(username,
|
||||
(InitialPendingUserSubscription) obj);
|
||||
if (obj instanceof InitialPendingSiteSubscription) {
|
||||
siteSubscriptionHandler.delete(username,
|
||||
(InitialPendingSiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler.delete(username,
|
||||
(InitialPendingSharedSubscription) obj);
|
||||
|
@ -288,8 +288,8 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
throws RegistryHandlerException {
|
||||
if (!CollectionUtil.isNullOrEmpty(objects)) {
|
||||
final Collection asSubtype = objects;
|
||||
if (objects.iterator().next() instanceof InitialPendingUserSubscription) {
|
||||
userSubscriptionHandler.delete(asSubtype);
|
||||
if (objects.iterator().next() instanceof InitialPendingSiteSubscription) {
|
||||
siteSubscriptionHandler.delete(asSubtype);
|
||||
} else {
|
||||
sharedSubscriptionHandler.delete(asSubtype);
|
||||
}
|
||||
|
@ -306,8 +306,8 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
throws RegistryHandlerException {
|
||||
if (!CollectionUtil.isNullOrEmpty(objects)) {
|
||||
final Collection asSubtype = objects;
|
||||
if (objects.iterator().next() instanceof UserSubscription) {
|
||||
userSubscriptionHandler.delete(username, asSubtype);
|
||||
if (objects.iterator().next() instanceof SiteSubscription) {
|
||||
siteSubscriptionHandler.delete(username, asSubtype);
|
||||
} else {
|
||||
sharedSubscriptionHandler.delete(username, asSubtype);
|
||||
}
|
||||
|
@ -320,8 +320,8 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public InitialPendingSubscription getBySubscription(
|
||||
Subscription subscription) throws RegistryHandlerException {
|
||||
if (subscription instanceof UserSubscription) {
|
||||
return userSubscriptionHandler.getBySubscription(subscription);
|
||||
if (subscription instanceof SiteSubscription) {
|
||||
return siteSubscriptionHandler.getBySubscription(subscription);
|
||||
} else {
|
||||
return sharedSubscriptionHandler.getBySubscription(subscription);
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
@Override
|
||||
public InitialPendingSubscription getBySubscriptionId(String id)
|
||||
throws RegistryHandlerException {
|
||||
InitialPendingSubscription value = userSubscriptionHandler.getById(id);
|
||||
InitialPendingSubscription value = siteSubscriptionHandler.getById(id);
|
||||
if (value == null) {
|
||||
value = sharedSubscriptionHandler.getById(id);
|
||||
}
|
||||
|
@ -350,8 +350,8 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
throws RegistryHandlerException {
|
||||
if (!CollectionUtil.isNullOrEmpty(subscriptions)) {
|
||||
final Collection asSubtype = subscriptions;
|
||||
if (subscriptions.iterator().next() instanceof UserSubscription) {
|
||||
return nullOrSubscriptionList(userSubscriptionHandler
|
||||
if (subscriptions.iterator().next() instanceof SiteSubscription) {
|
||||
return nullOrSubscriptionList(siteSubscriptionHandler
|
||||
.getBySubscriptions(asSubtype));
|
||||
} else {
|
||||
return nullOrSubscriptionList(sharedSubscriptionHandler
|
||||
|
@ -368,7 +368,7 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
public List<InitialPendingSubscription> getBySubscriptionIds(
|
||||
List<String> ids) throws RegistryHandlerException {
|
||||
List<InitialPendingSubscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getBySubscriptionIds(ids));
|
||||
subs.addAll(siteSubscriptionHandler.getBySubscriptionIds(ids));
|
||||
subs.addAll(sharedSubscriptionHandler.getBySubscriptionIds(ids));
|
||||
return subs;
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.datadelivery.registry.handlers;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.UserSubscriptionQuery;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.SiteSubscriptionQuery;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
|
||||
/**
|
||||
* {@link IRegistryObjectHandler} implementation for {@link UserSubscription}.
|
||||
* {@link IRegistryObjectHandler} implementation for {@link SiteSubscription}.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -43,23 +43,23 @@ import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
|||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public class UserSubscriptionHandler extends
|
||||
SubscriptionTypeHandler<UserSubscription, UserSubscriptionQuery>
|
||||
implements IUserSubscriptionHandler {
|
||||
public class SiteSubscriptionHandler extends
|
||||
SubscriptionTypeHandler<SiteSubscription, SiteSubscriptionQuery>
|
||||
implements ISiteSubscriptionHandler {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected UserSubscriptionQuery getQuery() {
|
||||
return new UserSubscriptionQuery();
|
||||
protected SiteSubscriptionQuery getQuery() {
|
||||
return new SiteSubscriptionQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Class<UserSubscription> getRegistryObjectClass() {
|
||||
return UserSubscription.class;
|
||||
protected Class<SiteSubscription> getRegistryObjectClass() {
|
||||
return SiteSubscription.class;
|
||||
}
|
||||
}
|
|
@ -26,11 +26,11 @@ import java.util.Set;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PendingSiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PendingUserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
|
@ -49,6 +49,7 @@ import com.raytheon.uf.common.util.CollectionUtil;
|
|||
* Oct 17, 2012 0726 djohnson Add {@link #getActiveByDataSetAndProvider}.
|
||||
* Apr 05, 2013 1841 djohnson Add support for shared subscriptions.
|
||||
* 4/9/2013 1802 bphillip Using constant values from constants package instead of RegistryUtil
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,22 +58,22 @@ import com.raytheon.uf.common.util.CollectionUtil;
|
|||
*/
|
||||
public class SubscriptionHandler implements ISubscriptionHandler {
|
||||
|
||||
private final IUserSubscriptionHandler userSubscriptionHandler;
|
||||
private final ISiteSubscriptionHandler siteSubscriptionHandler;
|
||||
|
||||
private final ISharedSubscriptionHandler sharedSubscriptionHandler;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param userSubscriptionHandler
|
||||
* @param siteSubscriptionHandler
|
||||
* the user subscription handler
|
||||
* @param sharedSubscriptionHandler
|
||||
* the shared subscription handler
|
||||
*/
|
||||
public SubscriptionHandler(
|
||||
IUserSubscriptionHandler userSubscriptionHandler,
|
||||
ISiteSubscriptionHandler siteSubscriptionHandler,
|
||||
ISharedSubscriptionHandler sharedSubscriptionHandler) {
|
||||
this.userSubscriptionHandler = userSubscriptionHandler;
|
||||
this.siteSubscriptionHandler = siteSubscriptionHandler;
|
||||
this.sharedSubscriptionHandler = sharedSubscriptionHandler;
|
||||
}
|
||||
|
||||
|
@ -82,8 +83,8 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
@Override
|
||||
public Subscription getByPendingSubscription(PendingSubscription pending)
|
||||
throws RegistryHandlerException {
|
||||
if (pending instanceof PendingUserSubscription) {
|
||||
return userSubscriptionHandler.getByPendingSubscription(pending);
|
||||
if (pending instanceof PendingSiteSubscription) {
|
||||
return siteSubscriptionHandler.getByPendingSubscription(pending);
|
||||
} else {
|
||||
return sharedSubscriptionHandler.getByPendingSubscription(pending);
|
||||
}
|
||||
|
@ -95,7 +96,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
@Override
|
||||
public Subscription getByPendingSubscriptionId(final String id)
|
||||
throws RegistryHandlerException {
|
||||
Subscription value = userSubscriptionHandler.getById(id);
|
||||
Subscription value = siteSubscriptionHandler.getById(id);
|
||||
if (value == null) {
|
||||
value = sharedSubscriptionHandler.getById(id);
|
||||
}
|
||||
|
@ -108,7 +109,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
@Override
|
||||
public void deleteByIds(String username, List<String> ids)
|
||||
throws RegistryHandlerException {
|
||||
userSubscriptionHandler.deleteByIds(username, ids);
|
||||
siteSubscriptionHandler.deleteByIds(username, ids);
|
||||
sharedSubscriptionHandler.deleteByIds(username, ids);
|
||||
}
|
||||
|
||||
|
@ -119,7 +120,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
public List<Subscription> getActiveByDataSetAndProvider(String dataSetName,
|
||||
String providerName) throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getActiveByDataSetAndProvider(
|
||||
subs.addAll(siteSubscriptionHandler.getActiveByDataSetAndProvider(
|
||||
dataSetName, providerName));
|
||||
subs.addAll(sharedSubscriptionHandler.getActiveByDataSetAndProvider(
|
||||
dataSetName, providerName));
|
||||
|
@ -132,7 +133,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
*/
|
||||
@Override
|
||||
public Subscription getByName(String name) throws RegistryHandlerException {
|
||||
Subscription value = userSubscriptionHandler.getByName(name);
|
||||
Subscription value = siteSubscriptionHandler.getByName(name);
|
||||
if (value == null) {
|
||||
value = sharedSubscriptionHandler.getByName(name);
|
||||
}
|
||||
|
@ -146,7 +147,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
public List<Subscription> getByOwner(String owner)
|
||||
throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getByOwner(owner));
|
||||
subs.addAll(siteSubscriptionHandler.getByOwner(owner));
|
||||
subs.addAll(sharedSubscriptionHandler.getByOwner(owner));
|
||||
|
||||
return subs;
|
||||
|
@ -159,7 +160,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
public List<Subscription> getByGroupName(String group)
|
||||
throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getByGroupName(group));
|
||||
subs.addAll(siteSubscriptionHandler.getByGroupName(group));
|
||||
subs.addAll(sharedSubscriptionHandler.getByGroupName(group));
|
||||
|
||||
return subs;
|
||||
|
@ -172,7 +173,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
public List<Subscription> getByFilters(String group, String officeId)
|
||||
throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getByFilters(group, officeId));
|
||||
subs.addAll(siteSubscriptionHandler.getByFilters(group, officeId));
|
||||
subs.addAll(sharedSubscriptionHandler.getByFilters(group, officeId));
|
||||
|
||||
return subs;
|
||||
|
@ -185,7 +186,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
public Set<String> getSubscribedToDataSetNames()
|
||||
throws RegistryHandlerException {
|
||||
Set<String> set = Sets.newHashSet();
|
||||
set.addAll(userSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
set.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
set.addAll(sharedSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
|
||||
return set;
|
||||
|
@ -197,7 +198,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
@Override
|
||||
public List<Subscription> getActive() throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getActive());
|
||||
subs.addAll(siteSubscriptionHandler.getActive());
|
||||
subs.addAll(sharedSubscriptionHandler.getActive());
|
||||
|
||||
return subs;
|
||||
|
@ -210,7 +211,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
public List<Subscription> getActiveForRoute(Network route)
|
||||
throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getActiveForRoute(route));
|
||||
subs.addAll(siteSubscriptionHandler.getActiveForRoute(route));
|
||||
subs.addAll(sharedSubscriptionHandler.getActiveForRoute(route));
|
||||
return subs;
|
||||
}
|
||||
|
@ -222,7 +223,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
public List<Subscription> getActiveForRoutes(Network... routes)
|
||||
throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getActiveForRoutes(routes));
|
||||
subs.addAll(siteSubscriptionHandler.getActiveForRoutes(routes));
|
||||
subs.addAll(sharedSubscriptionHandler.getActiveForRoutes(routes));
|
||||
return subs;
|
||||
}
|
||||
|
@ -232,7 +233,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
*/
|
||||
@Override
|
||||
public Subscription getById(String id) throws RegistryHandlerException {
|
||||
Subscription value = userSubscriptionHandler.getById(id);
|
||||
Subscription value = siteSubscriptionHandler.getById(id);
|
||||
if (value == null) {
|
||||
value = sharedSubscriptionHandler.getById(id);
|
||||
}
|
||||
|
@ -245,7 +246,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
@Override
|
||||
public List<Subscription> getAll() throws RegistryHandlerException {
|
||||
List<Subscription> subs = Lists.newArrayList();
|
||||
subs.addAll(userSubscriptionHandler.getAll());
|
||||
subs.addAll(siteSubscriptionHandler.getAll());
|
||||
subs.addAll(sharedSubscriptionHandler.getAll());
|
||||
return subs;
|
||||
}
|
||||
|
@ -255,8 +256,8 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
*/
|
||||
@Override
|
||||
public void store(Subscription obj) throws RegistryHandlerException {
|
||||
if (obj instanceof UserSubscription) {
|
||||
userSubscriptionHandler.store((UserSubscription) obj);
|
||||
if (obj instanceof SiteSubscription) {
|
||||
siteSubscriptionHandler.store((SiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler.store((SharedSubscription) obj);
|
||||
}
|
||||
|
@ -267,8 +268,8 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
*/
|
||||
@Override
|
||||
public void update(Subscription obj) throws RegistryHandlerException {
|
||||
if (obj instanceof UserSubscription) {
|
||||
userSubscriptionHandler.update((UserSubscription) obj);
|
||||
if (obj instanceof SiteSubscription) {
|
||||
siteSubscriptionHandler.update((SiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler.update((SharedSubscription) obj);
|
||||
}
|
||||
|
@ -279,8 +280,8 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
*/
|
||||
@Override
|
||||
public void delete(Subscription obj) throws RegistryHandlerException {
|
||||
if (obj instanceof UserSubscription) {
|
||||
userSubscriptionHandler.delete((UserSubscription) obj);
|
||||
if (obj instanceof SiteSubscription) {
|
||||
siteSubscriptionHandler.delete((SiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler.delete((SharedSubscription) obj);
|
||||
}
|
||||
|
@ -292,7 +293,7 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
@Override
|
||||
public void deleteById(String username, String registryId)
|
||||
throws RegistryHandlerException {
|
||||
userSubscriptionHandler.deleteById(username, registryId);
|
||||
siteSubscriptionHandler.deleteById(username, registryId);
|
||||
sharedSubscriptionHandler.deleteById(username, registryId);
|
||||
}
|
||||
|
||||
|
@ -302,8 +303,8 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
@Override
|
||||
public void delete(String username, Subscription obj)
|
||||
throws RegistryHandlerException {
|
||||
if (obj instanceof UserSubscription) {
|
||||
userSubscriptionHandler.delete(username, (UserSubscription) obj);
|
||||
if (obj instanceof SiteSubscription) {
|
||||
siteSubscriptionHandler.delete(username, (SiteSubscription) obj);
|
||||
} else {
|
||||
sharedSubscriptionHandler
|
||||
.delete(username, (SharedSubscription) obj);
|
||||
|
@ -319,8 +320,8 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
throws RegistryHandlerException {
|
||||
if (!CollectionUtil.isNullOrEmpty(objects)) {
|
||||
final Collection asSubtype = objects;
|
||||
if (objects.iterator().next() instanceof UserSubscription) {
|
||||
userSubscriptionHandler.delete(asSubtype);
|
||||
if (objects.iterator().next() instanceof SiteSubscription) {
|
||||
siteSubscriptionHandler.delete(asSubtype);
|
||||
} else {
|
||||
sharedSubscriptionHandler.delete(asSubtype);
|
||||
}
|
||||
|
@ -336,8 +337,8 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
throws RegistryHandlerException {
|
||||
if (!CollectionUtil.isNullOrEmpty(objects)) {
|
||||
final Collection asSubtype = objects;
|
||||
if (objects.iterator().next() instanceof UserSubscription) {
|
||||
userSubscriptionHandler.delete(username, asSubtype);
|
||||
if (objects.iterator().next() instanceof SiteSubscription) {
|
||||
siteSubscriptionHandler.delete(username, asSubtype);
|
||||
} else {
|
||||
sharedSubscriptionHandler.delete(username, asSubtype);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import com.raytheon.uf.common.util.CollectionUtil;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 05, 2013 1841 djohnson Extracted and genericized from UserSubscriptionHandler.
|
||||
* Apr 05, 2013 1841 djohnson Extracted and genericized from siteSubscriptionHandler.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -28,7 +28,8 @@ package com.raytheon.uf.common.datadelivery.request;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 3, 2012 1241 djohnson Initial creation
|
||||
* Oct 03, 2012 1241 djohnson Initial creation.
|
||||
* May 20, 2013 1040 mpduff Added Shared Subscription permissions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,7 +46,11 @@ public enum DataDeliveryPermission {
|
|||
"subscription.edit"), SYSTEM_MANAGEMENT_VIEW(
|
||||
"systemmanagement.view"), SUBSCRIPTION_CREATE("subscription.create"), SUBSCRIPTION_ACTIVATE(
|
||||
"subscription.activate"), SUBSCRIPTION_DELETE("subscription.delete"), SYSTEM_MANAGEMENT_CREATE(
|
||||
"systemmanagement.create");
|
||||
"systemmanagement.create"), SHARED_SUBSCRIPTION_CREATE(
|
||||
"shared.subscription.create"), SHARED_SUBSCRIPTION_DELETE(
|
||||
"shared.subscription.delete"), SHARED_SUBSCRIPTION_EDIT(
|
||||
"shared.subscription.edit"), SHARED_SUBSCRIPTION_ACTIVATE(
|
||||
"shared.subscription.activate");
|
||||
|
||||
private String stringValue;
|
||||
|
||||
|
|
|
@ -10,11 +10,10 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ValueType;
|
||||
|
||||
/**
|
||||
* A <code>SlotConverter</code> implementation for converting the
|
||||
* members of a Set into a RegistryObject slot type. A collection
|
||||
* slot type will be created and the Set members converted to elements
|
||||
* with slot values of a appropriate type for the member. The collection
|
||||
* type for the slot will be set to Set.
|
||||
* A <code>SlotConverter</code> implementation for converting the members of a
|
||||
* Set into a RegistryObject slot type. A collection slot type will be created
|
||||
* and the Set members converted to elements with slot values of a appropriate
|
||||
* type for the member. The collection type for the slot will be set to Set.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -23,13 +22,14 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ValueType;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 15, 2012 455 jspinks Initial creation
|
||||
* May 15, 2013 1040 mpduff Made non-abstract.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jspinks
|
||||
* @version 1.0
|
||||
*/
|
||||
public abstract class SetSlotConverter implements SlotConverter {
|
||||
public class SetSlotConverter implements SlotConverter {
|
||||
|
||||
/**
|
||||
* Extract a List of SlotType Objects from the given slotValue Object.
|
||||
|
@ -44,39 +44,41 @@ public abstract class SetSlotConverter implements SlotConverter {
|
|||
* provided.
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the slotValue Object provided is not an instance of Set, or
|
||||
* the Set member cannot be converted to a value.
|
||||
* If the slotValue Object provided is not an instance of Set,
|
||||
* or the Set member cannot be converted to a value.
|
||||
*
|
||||
* @see java.util.Map
|
||||
*/
|
||||
@Override
|
||||
public List<SlotType> getSlots(String slotName, Object slotValue) throws IllegalArgumentException {
|
||||
public List<SlotType> getSlots(String slotName, Object slotValue)
|
||||
throws IllegalArgumentException {
|
||||
List<SlotType> slots = new ArrayList<SlotType>();
|
||||
|
||||
|
||||
SlotType slot = new SlotType();
|
||||
slot.setName(slotName);
|
||||
List<ValueType> collectionValues = new ArrayList<ValueType>();
|
||||
CollectionValueType cvt = new CollectionValueType();
|
||||
|
||||
|
||||
if (slotValue instanceof Set) {
|
||||
|
||||
for (Object o : (Set<?>)slotValue) {
|
||||
for (Object o : (Set<?>) slotValue) {
|
||||
ValueType vt = newEntrySlot(o);
|
||||
if (vt != null) {
|
||||
collectionValues.add(newEntrySlot(o));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Set with parameterized type " + o.getClass().getName() +
|
||||
" cannot be converted by " + SetSlotConverter.class.getName());
|
||||
throw new IllegalArgumentException(
|
||||
"Set with parameterized type "
|
||||
+ o.getClass().getName()
|
||||
+ " cannot be converted by "
|
||||
+ SetSlotConverter.class.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("Object of type " + slotValue.getClass().getName() +
|
||||
" cannot be converted by " + SetSlotConverter.class.getName());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Object of type "
|
||||
+ slotValue.getClass().getName()
|
||||
+ " cannot be converted by "
|
||||
+ SetSlotConverter.class.getName());
|
||||
}
|
||||
|
||||
cvt.setCollectionValue(collectionValues);
|
||||
|
@ -99,7 +101,7 @@ public abstract class SetSlotConverter implements SlotConverter {
|
|||
// TODO: Add more types as necessary.
|
||||
if (value instanceof String) {
|
||||
StringValueType entry = new StringValueType();
|
||||
entry.setStringValue((String)value);
|
||||
entry.setStringValue((String) value);
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.site;
|
||||
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
/**
|
||||
* AWIPS 2 site data object holding information regarding the site.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 29, 2013 1040 mpduff Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SiteData {
|
||||
private static final String WFO_STRING = "wfo";
|
||||
|
||||
private static final String RFC_STRING = "rfc";
|
||||
|
||||
private static final String RO_STRING = "ro";
|
||||
|
||||
private static final String NC_STRING = "nc";
|
||||
|
||||
/**
|
||||
* Site Data Types
|
||||
*/
|
||||
@XmlEnum
|
||||
public enum SiteDataType {
|
||||
@XmlEnumValue(WFO_STRING)
|
||||
WFO, @XmlEnumValue(RFC_STRING)
|
||||
RFC, @XmlEnumValue(RO_STRING)
|
||||
RO, @XmlEnumValue(NC_STRING)
|
||||
NC;
|
||||
}
|
||||
|
||||
/** Site id */
|
||||
private String id;
|
||||
|
||||
/** Site type (cwa, rfc, etc) */
|
||||
private SiteDataType type;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public SiteData() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param id
|
||||
* Site id
|
||||
* @param type
|
||||
* Site type
|
||||
*/
|
||||
public SiteData(String id, SiteDataType type) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the id
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* the id to set
|
||||
*/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public SiteDataType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* the type to set
|
||||
*/
|
||||
public void setType(SiteDataType type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
|
@ -30,13 +30,20 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.site.xml.NwsSitesXML;
|
||||
import com.raytheon.uf.common.site.xml.SiteIdXML;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -52,6 +59,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Jul 16, 2010 bfarmer Initial creation
|
||||
* Apr 09, 2012 DR14765 mhuang Map out correct CCCC site ID for backup
|
||||
* sites.
|
||||
* May 15, 2013 1040 mpduff Add awips_site_list.xml.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -73,21 +81,45 @@ public class SiteMap {
|
|||
|
||||
private static final String RFC_TABLE_FILENAME = "textdb/rfc_lookup_table.dat";
|
||||
|
||||
private List<String> rfcList = new ArrayList<String>();
|
||||
private static final String LOCATION_ID_FILENAME = "awips_site_list.xml";
|
||||
|
||||
private Map<String, String> siteToSiteMap = new HashMap<String, String>();
|
||||
private final List<String> rfcList = new ArrayList<String>();
|
||||
|
||||
private Map<String, String> nationalCategoryMap = new HashMap<String, String>();
|
||||
private final Map<String, String> siteToSiteMap = new HashMap<String, String>();
|
||||
|
||||
private Map<String, String> siteTo4LetterSite = new HashMap<String, String>();
|
||||
private final Map<String, String> nationalCategoryMap = new HashMap<String, String>();
|
||||
|
||||
private Map<String, Set<String>> siteTo3LetterSite = new HashMap<String, Set<String>>();
|
||||
private final Map<String, String> siteTo4LetterSite = new HashMap<String, String>();
|
||||
|
||||
private final Map<String, Set<String>> siteTo3LetterSite = new HashMap<String, Set<String>>();
|
||||
|
||||
private final Map<String, SiteData> siteMap = new TreeMap<String, SiteData>();
|
||||
|
||||
/** JAXB context */
|
||||
private JAXBContext jax;
|
||||
|
||||
/** Unmarshaller object */
|
||||
private Unmarshaller unmarshaller;
|
||||
|
||||
/**
|
||||
* Get an instance.
|
||||
*
|
||||
* @return the instance
|
||||
*/
|
||||
public static SiteMap getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private SiteMap() {
|
||||
Class[] classes = new Class[] { NwsSitesXML.class, SiteIdXML.class };
|
||||
|
||||
try {
|
||||
jax = JAXBContext.newInstance(classes);
|
||||
this.unmarshaller = jax.createUnmarshaller();
|
||||
} catch (JAXBException e) {
|
||||
throw new ExceptionInInitializerError(
|
||||
"Error creating context for SiteMap");
|
||||
}
|
||||
readFiles();
|
||||
}
|
||||
|
||||
|
@ -111,8 +143,11 @@ public class SiteMap {
|
|||
}
|
||||
|
||||
/**
|
||||
* Attempt to map an xxxid to a cccid. Use the afos_lookup_table.dat data only.
|
||||
* @param xxx An id to map.
|
||||
* Attempt to map an xxxid to a cccid. Use the afos_lookup_table.dat data
|
||||
* only.
|
||||
*
|
||||
* @param xxx
|
||||
* An id to map.
|
||||
* @return
|
||||
*/
|
||||
public String getAFOSTableMap(String xxx) {
|
||||
|
@ -128,6 +163,7 @@ public class SiteMap {
|
|||
nationalCategoryMap.clear();
|
||||
siteTo4LetterSite.clear();
|
||||
siteTo3LetterSite.clear();
|
||||
siteMap.clear();
|
||||
|
||||
// load base afos lookup
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
|
@ -151,6 +187,18 @@ public class SiteMap {
|
|||
file = pathMgr.getFile(lc, NATIONAL_CATEGORY_TABLE_FILENAME);
|
||||
loadNationalCategoryFile(file, nationalCategoryMap);
|
||||
|
||||
// Load site list
|
||||
lc = pathMgr.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.SITE);
|
||||
file = pathMgr.getFile(lc, LOCATION_ID_FILENAME);
|
||||
if (file == null || !file.exists()) {
|
||||
lc = pathMgr.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.BASE);
|
||||
file = pathMgr.getFile(lc, LOCATION_ID_FILENAME);
|
||||
System.out.println(LOCATION_ID_FILENAME);
|
||||
}
|
||||
loadSiteListFile(file);
|
||||
|
||||
// post-process the nationalCategoryMap to generate the 3 to 4 letter
|
||||
// mapping
|
||||
for (String icao : nationalCategoryMap.keySet()) {
|
||||
|
@ -314,6 +362,24 @@ public class SiteMap {
|
|||
}
|
||||
}
|
||||
|
||||
private void loadSiteListFile(File file) {
|
||||
if (file != null && file.exists()) {
|
||||
NwsSitesXML siteXml;
|
||||
try {
|
||||
siteXml = (NwsSitesXML) unmarshaller.unmarshal(file);
|
||||
for (SiteIdXML xml : siteXml.getSiteIds()) {
|
||||
String id = xml.getId();
|
||||
SiteData sd = new SiteData(id, xml.getType());
|
||||
this.siteMap.put(id, sd);
|
||||
}
|
||||
} catch (JAXBException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Problem reading in Site Id File ["
|
||||
+ LOCATION_ID_FILENAME + "]", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a 3 letter site ID into a 4 letter ID, e.g. OAX to KOAX
|
||||
*
|
||||
|
@ -330,13 +396,13 @@ public class SiteMap {
|
|||
} else {
|
||||
// DR_14765, in case the site hashed out from combined mapping
|
||||
// table from both national_category_table and afo_lookup_table
|
||||
// does not start with K but not from site3LetterTo4LetterOerride.dat
|
||||
// does not start with K but not from
|
||||
// site3LetterTo4LetterOerride.dat
|
||||
// which are starting with P or T
|
||||
char[] siteChar = site.toCharArray();
|
||||
if (siteChar[0] != 'K') {
|
||||
if (!((siteChar[0] == 'P' && (siteChar[1] == 'A' || siteChar[1] == 'G'
|
||||
|| siteChar[1] == 'H')) ||
|
||||
(siteChar[0] == 'T' && siteChar[1] == 'S'))) {
|
||||
if (!((siteChar[0] == 'P' && (siteChar[1] == 'A'
|
||||
|| siteChar[1] == 'G' || siteChar[1] == 'H')) || (siteChar[0] == 'T' && siteChar[1] == 'S'))) {
|
||||
site = "K" + site3LetterId;
|
||||
}
|
||||
}
|
||||
|
@ -371,4 +437,13 @@ public class SiteMap {
|
|||
public boolean isRFCSite(String site) {
|
||||
return rfcList.contains(site);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the site data objects.
|
||||
*
|
||||
* @return site data objects
|
||||
*/
|
||||
public Map<String, SiteData> getSiteData() {
|
||||
return siteMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.site.xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* XML object for NWS Site IDs.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 29, 2013 1040 mpduff Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlRootElement(name = "nwsSites")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class NwsSitesXML {
|
||||
@XmlElements({ @XmlElement(name = "site", type = SiteIdXML.class) })
|
||||
private List<SiteIdXML> siteIds = new ArrayList<SiteIdXML>();
|
||||
|
||||
/**
|
||||
* @return the siteIds
|
||||
*/
|
||||
public List<SiteIdXML> getSiteIds() {
|
||||
return siteIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param siteIds
|
||||
* the siteIds to set
|
||||
*/
|
||||
public void setSiteIds(ArrayList<SiteIdXML> siteIds) {
|
||||
this.siteIds = siteIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a site id to the list.
|
||||
*
|
||||
* @param idXml
|
||||
* The object to add.
|
||||
*/
|
||||
public void addSiteId(SiteIdXML idXml) {
|
||||
if (idXml != null) {
|
||||
this.siteIds.add(idXml);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.site.xml;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import com.raytheon.uf.common.site.SiteData.SiteDataType;
|
||||
|
||||
/**
|
||||
* Site tag xml object.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 29, 2013 1040 mpduff Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class SiteIdXML {
|
||||
/** Site ID */
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
|
||||
/** Site type */
|
||||
@XmlAttribute(name = "type")
|
||||
private SiteDataType type;
|
||||
|
||||
/**
|
||||
* @return the id
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* the id to set
|
||||
*/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public SiteDataType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* the type to set
|
||||
*/
|
||||
public void setType(SiteDataType type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<nwsSites>
|
||||
<site type="wfo" id="AFC"/>
|
||||
<site type="wfo" id="ABQ"/>
|
||||
<site type="wfo" id="ABR"/>
|
||||
<site type="wfo" id="AER"/>
|
||||
<site type="wfo" id="AFG"/>
|
||||
<site type="wfo" id="AJK"/>
|
||||
<site type="wfo" id="AKQ"/>
|
||||
<site type="wfo" id="ALU"/>
|
||||
<site type="wfo" id="ALY"/>
|
||||
<site type="wfo" id="AMA"/>
|
||||
<site type="wfo" id="APX"/>
|
||||
<site type="wfo" id="ARX"/>
|
||||
<site type="wfo" id="BGM"/>
|
||||
<site type="wfo" id="BIS"/>
|
||||
<site type="wfo" id="BMX"/>
|
||||
<site type="wfo" id="BOI"/>
|
||||
<site type="wfo" id="BOU"/>
|
||||
<site type="wfo" id="BOX"/>
|
||||
<site type="wfo" id="BRO"/>
|
||||
<site type="wfo" id="BTV"/>
|
||||
<site type="wfo" id="BUF"/>
|
||||
<site type="wfo" id="BYZ"/>
|
||||
<site type="wfo" id="CAE"/>
|
||||
<site type="wfo" id="CAR"/>
|
||||
<site type="wfo" id="CHS"/>
|
||||
<site type="wfo" id="CLE"/>
|
||||
<site type="wfo" id="CRP"/>
|
||||
<site type="wfo" id="CTP"/>
|
||||
<site type="wfo" id="CYS"/>
|
||||
<site type="wfo" id="DDC"/>
|
||||
<site type="wfo" id="DLH"/>
|
||||
<site type="wfo" id="DMX"/>
|
||||
<site type="wfo" id="DTX"/>
|
||||
<site type="wfo" id="DVN"/>
|
||||
<site type="wfo" id="EAX"/>
|
||||
<site type="wfo" id="EKA"/>
|
||||
<site type="wfo" id="EPZ"/>
|
||||
<site type="wfo" id="EWX"/>
|
||||
<site type="wfo" id="FFC"/>
|
||||
<site type="wfo" id="FGF"/>
|
||||
<site type="wfo" id="FGZ"/>
|
||||
<site type="wfo" id="FSD"/>
|
||||
<site type="wfo" id="FWD"/>
|
||||
<site type="wfo" id="GGW"/>
|
||||
<site type="wfo" id="GID"/>
|
||||
<site type="wfo" id="GJT"/>
|
||||
<site type="wfo" id="GLD"/>
|
||||
<site type="wfo" id="GRB"/>
|
||||
<site type="wfo" id="GRR"/>
|
||||
<site type="wfo" id="GSP"/>
|
||||
<site type="wfo" id="GUM"/>
|
||||
<site type="wfo" id="GYX"/>
|
||||
<site type="wfo" id="HFO"/>
|
||||
<site type="wfo" id="HGX"/>
|
||||
<site type="wfo" id="HNX"/>
|
||||
<site type="wfo" id="HUN"/>
|
||||
<site type="wfo" id="ICT"/>
|
||||
<site type="wfo" id="ILM"/>
|
||||
<site type="wfo" id="ILN"/>
|
||||
<site type="wfo" id="ILX"/>
|
||||
<site type="wfo" id="IND"/>
|
||||
<site type="wfo" id="IWX"/>
|
||||
<site type="wfo" id="JAN"/>
|
||||
<site type="wfo" id="JAX"/>
|
||||
<site type="wfo" id="JKL"/>
|
||||
<site type="wfo" id="KEY"/>
|
||||
<site type="wfo" id="LBF"/>
|
||||
<site type="wfo" id="LCH"/>
|
||||
<site type="wfo" id="LIX"/>
|
||||
<site type="wfo" id="LKN"/>
|
||||
<site type="wfo" id="LMK"/>
|
||||
<site type="wfo" id="LOT"/>
|
||||
<site type="wfo" id="LOX"/>
|
||||
<site type="wfo" id="LSX"/>
|
||||
<site type="wfo" id="LUB"/>
|
||||
<site type="wfo" id="LWX"/>
|
||||
<site type="wfo" id="LZK"/>
|
||||
<site type="wfo" id="MAF"/>
|
||||
<site type="wfo" id="MEG"/>
|
||||
<site type="wfo" id="MFL"/>
|
||||
<site type="wfo" id="MFR"/>
|
||||
<site type="wfo" id="MHX"/>
|
||||
<site type="wfo" id="MKX"/>
|
||||
<site type="wfo" id="MLB"/>
|
||||
<site type="wfo" id="MOB"/>
|
||||
<site type="wfo" id="MPX"/>
|
||||
<site type="wfo" id="MQT"/>
|
||||
<site type="wfo" id="MRX"/>
|
||||
<site type="wfo" id="MSO"/>
|
||||
<site type="wfo" id="MTR"/>
|
||||
<site type="wfo" id="OAX"/>
|
||||
<site type="wfo" id="OHX"/>
|
||||
<site type="wfo" id="OKX"/>
|
||||
<site type="wfo" id="OTX"/>
|
||||
<site type="wfo" id="OUN"/>
|
||||
<site type="wfo" id="PAH"/>
|
||||
<site type="wfo" id="PBZ"/>
|
||||
<site type="wfo" id="PDT"/>
|
||||
<site type="wfo" id="PHI"/>
|
||||
<site type="wfo" id="PIH"/>
|
||||
<site type="wfo" id="PQR"/>
|
||||
<site type="wfo" id="PSR"/>
|
||||
<site type="wfo" id="PUB"/>
|
||||
<site type="wfo" id="RAH"/>
|
||||
<site type="wfo" id="REV"/>
|
||||
<site type="wfo" id="RIW"/>
|
||||
<site type="wfo" id="RLX"/>
|
||||
<site type="wfo" id="RNK"/>
|
||||
<site type="wfo" id="SEW"/>
|
||||
<site type="wfo" id="SGF"/>
|
||||
<site type="wfo" id="SGX"/>
|
||||
<site type="wfo" id="SHV"/>
|
||||
<site type="wfo" id="SJT"/>
|
||||
<site type="wfo" id="SJU"/>
|
||||
<site type="wfo" id="SLC"/>
|
||||
<site type="wfo" id="STO"/>
|
||||
<site type="wfo" id="TAE"/>
|
||||
<site type="wfo" id="TBW"/>
|
||||
<site type="wfo" id="TFX"/>
|
||||
<site type="wfo" id="TOP"/>
|
||||
<site type="wfo" id="TSA"/>
|
||||
<site type="wfo" id="TWC"/>
|
||||
<site type="wfo" id="UNR"/>
|
||||
<site type="wfo" id="VEF"/>
|
||||
<site type="rfc" id="ACR"/>
|
||||
<site type="rfc" id="ALR"/>
|
||||
<site type="rfc" id="FWR"/>
|
||||
<site type="rfc" id="KRF"/>
|
||||
<site type="rfc" id="MSR"/>
|
||||
<site type="rfc" id="ORN"/>
|
||||
<site type="rfc" id="PTR"/>
|
||||
<site type="rfc" id="RHA"/>
|
||||
<site type="rfc" id="RSA"/>
|
||||
<site type="rfc" id="STR"/>
|
||||
<site type="rfc" id="TAR"/>
|
||||
<site type="rfc" id="TIR"/>
|
||||
<site type="rfc" id="TUA"/>
|
||||
<site type="ro" id="VUY"/>
|
||||
<site type="ro" id="BCQ"/>
|
||||
<site type="ro" id="EHU"/>
|
||||
<site type="ro" id="VHW"/>
|
||||
<site type="ro" id="PBP"/>
|
||||
<site type="ro" id="ARE"/>
|
||||
<site type="ro" id="ARW"/>
|
||||
<site type="nc" id="HAK"/>
|
||||
<site type="nc" id="HUS"/>
|
||||
</nwsSites>
|
|
@ -123,7 +123,8 @@ public final class StringUtil {
|
|||
* the character to join them with
|
||||
* @return the concatenated string
|
||||
*/
|
||||
public static <T> String join(final Collection<T> portions, final char joinCharacter) {
|
||||
public static <T> String join(final Collection<T> portions,
|
||||
final char joinCharacter) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
if (CollectionUtil.isNullOrEmpty(portions)) {
|
||||
|
@ -209,4 +210,66 @@ public final class StringUtil {
|
|||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string as a separated list showing up to the limit of items.
|
||||
*
|
||||
* @param list
|
||||
* List of items to put in the "list"
|
||||
* @param delimiter
|
||||
* Delimiting String
|
||||
* @param limit
|
||||
* number of items to display
|
||||
* @return the list
|
||||
*/
|
||||
public static String getDisplayList(Collection<String> list,
|
||||
String delimiter, int limit) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (list.size() < limit) {
|
||||
limit = list.size();
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (String s : list) {
|
||||
if (count < limit) {
|
||||
sb.append(s).append(delimiter);
|
||||
} else {
|
||||
// remove the trailing space
|
||||
sb.replace(sb.length() - 1, sb.length(), "");
|
||||
sb.append("...");
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a list with all the lines except the first indented.
|
||||
*
|
||||
* @param list
|
||||
* list of items
|
||||
* @param indent
|
||||
* String of spaces making up the indent
|
||||
* @return the list
|
||||
*/
|
||||
public static String getIndentedList(Collection<String> list,
|
||||
final String indent) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
int count = 0;
|
||||
for (String id : list) {
|
||||
if (count == 10) {
|
||||
sb.append(StringUtil.NEWLINE);
|
||||
sb.append(indent);
|
||||
count = 0;
|
||||
}
|
||||
sb.append(id).append(" ");
|
||||
count++;
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ import com.raytheon.uf.common.datadelivery.registry.GriddedDataSetMetaData;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.event.EventBus;
|
||||
import com.raytheon.uf.common.registry.event.InsertRegistryEvent;
|
||||
|
@ -208,7 +208,7 @@ public abstract class BandwidthManager extends
|
|||
+ "]");
|
||||
}
|
||||
|
||||
} else if (DataDeliveryRegistryObjectTypes.USER_SUBSCRIPTION
|
||||
} else if (DataDeliveryRegistryObjectTypes.SITE_SUBSCRIPTION
|
||||
.equals(objectType)
|
||||
|| DataDeliveryRegistryObjectTypes.SHARED_SUBSCRIPTION
|
||||
.equals(objectType)) {
|
||||
|
@ -308,8 +308,8 @@ public abstract class BandwidthManager extends
|
|||
Subscription sub = updateSubscriptionWithDataSetMetaData(
|
||||
subscription, dataSetMetaData);
|
||||
|
||||
if (sub instanceof UserSubscription) {
|
||||
schedule(new AdhocSubscription((UserSubscription) sub));
|
||||
if (sub instanceof SiteSubscription) {
|
||||
schedule(new AdhocSubscription((SiteSubscription) sub));
|
||||
} else {
|
||||
statusHandler
|
||||
.warn("Unable to create adhoc queries for shared subscriptions at this point. This functionality should be added in the future...");
|
||||
|
@ -582,7 +582,7 @@ public abstract class BandwidthManager extends
|
|||
public void subscriptionRemoved(RemoveRegistryEvent event) {
|
||||
String objectType = event.getObjectType();
|
||||
if (objectType != null) {
|
||||
if (DataDeliveryRegistryObjectTypes.USER_SUBSCRIPTION
|
||||
if (DataDeliveryRegistryObjectTypes.SITE_SUBSCRIPTION
|
||||
.equals(objectType)
|
||||
|| DataDeliveryRegistryObjectTypes.SHARED_SUBSCRIPTION
|
||||
.equals(objectType)) {
|
||||
|
@ -752,9 +752,9 @@ public abstract class BandwidthManager extends
|
|||
// Create an adhoc subscription based on the new subscription,
|
||||
// and set it to retrieve the most recent cycle (or most recent
|
||||
// url if a daily product)
|
||||
if (subscription instanceof UserSubscription) {
|
||||
if (subscription instanceof SiteSubscription) {
|
||||
AdhocSubscription adhoc = new AdhocSubscription(
|
||||
(UserSubscription) subscription);
|
||||
(SiteSubscription) subscription);
|
||||
adhoc = bandwidthDaoUtil.setAdhocMostRecentUrlAndTime(
|
||||
adhoc, useMostRecentDataSetUpdate);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
class="com.raytheon.uf.common.datadelivery.registry.handlers.SubscriptionHandler">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.UserSubscriptionHandler" />
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.SiteSubscriptionHandler" />
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<bean
|
||||
|
@ -22,7 +22,7 @@
|
|||
class="com.raytheon.uf.common.datadelivery.registry.handlers.PendingSubscriptionHandler">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.PendingUserSubscriptionHandler" />
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.PendingSiteSubscriptionHandler" />
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<bean
|
||||
|
|
|
@ -46,6 +46,36 @@
|
|||
</description>
|
||||
</permission>
|
||||
|
||||
<permission id="shared.subscription.create">
|
||||
<description>
|
||||
Control Access to Create Data Delivery Shared Subscriptions
|
||||
</description>
|
||||
</permission>
|
||||
|
||||
<permission id="shared.subscription.edit">
|
||||
<description>
|
||||
Control Access to Edit Data Delivery Shared Subscriptions
|
||||
</description>
|
||||
</permission>
|
||||
|
||||
<permission id="shared.subscription.delete">
|
||||
<description>
|
||||
Control Access to Delete Data Delivery Shared Subscriptions
|
||||
</description>
|
||||
</permission>
|
||||
|
||||
<permission id="shared.subscription.activate">
|
||||
<description>
|
||||
Control Access to Activate Data Delivery Shared Subscriptions
|
||||
</description>
|
||||
</permission>
|
||||
|
||||
<permission id="subscription.approve.share">
|
||||
<description>
|
||||
Authorization to Approve Shared Data Delivery Subscriptions
|
||||
</description>
|
||||
</permission>
|
||||
|
||||
<permission id="subscription.approve.view">
|
||||
<description>
|
||||
Authorization to View Pending Data Delivery Subscriptions
|
||||
|
@ -100,6 +130,17 @@
|
|||
<rolePermission>group.edit</rolePermission>
|
||||
</role>
|
||||
|
||||
<role roleId="shared.subscription.admin">
|
||||
<roleDescription>
|
||||
This role is a grouping of permissions, default shared subscription admin role
|
||||
</roleDescription>
|
||||
<rolePermission>shared.subscription.create</rolePermission>
|
||||
<rolePermission>shared.subscription.edit</rolePermission>
|
||||
<rolePermission>shared.subscription.delete</rolePermission>
|
||||
<rolePermission>shared.subscription.activate</rolePermission>
|
||||
<rolePermission>subscription.approve.share</rolePermission>
|
||||
</role>
|
||||
|
||||
<!-- ALL user is selected for permissions permitted to all users -->
|
||||
<user userId="ALL">
|
||||
<userPermission>subscription.view</userPermission>
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.springframework.context.ApplicationContext;
|
|||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionFixture;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactoryTest;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.time.util.TimeUtilTest;
|
||||
|
@ -163,7 +163,7 @@ public abstract class AbstractBandwidthManagerIntTest {
|
|||
*
|
||||
* @return the subscription
|
||||
*/
|
||||
protected UserSubscription createSubscriptionThatFillsUpABucket() {
|
||||
protected SiteSubscription createSubscriptionThatFillsUpABucket() {
|
||||
return createSubscriptionWithDataSetSizeInBytes(fullBucketSize);
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ public abstract class AbstractBandwidthManagerIntTest {
|
|||
*
|
||||
* @return the subscription
|
||||
*/
|
||||
protected UserSubscription createSubscriptionThatFillsUpTenBuckets() {
|
||||
protected SiteSubscription createSubscriptionThatFillsUpTenBuckets() {
|
||||
return createSubscriptionWithDataSetSizeInBytes(fullBucketSize * 10);
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ public abstract class AbstractBandwidthManagerIntTest {
|
|||
*
|
||||
* @return the subscription
|
||||
*/
|
||||
protected UserSubscription createSubscriptionThatFillsHalfABucket() {
|
||||
protected SiteSubscription createSubscriptionThatFillsHalfABucket() {
|
||||
return createSubscriptionWithDataSetSizeInBytes(halfBucketSize);
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ public abstract class AbstractBandwidthManagerIntTest {
|
|||
*
|
||||
* @return the subscription
|
||||
*/
|
||||
protected UserSubscription createSubscriptionThatFillsAThirdOfABucket() {
|
||||
protected SiteSubscription createSubscriptionThatFillsAThirdOfABucket() {
|
||||
return createSubscriptionWithDataSetSizeInBytes(thirdBucketSizeInBytes);
|
||||
}
|
||||
|
||||
|
@ -199,13 +199,13 @@ public abstract class AbstractBandwidthManagerIntTest {
|
|||
*
|
||||
* @return the subscription
|
||||
*/
|
||||
protected UserSubscription createSubscriptionThatFillsUpTwoBuckets() {
|
||||
protected SiteSubscription createSubscriptionThatFillsUpTwoBuckets() {
|
||||
return createSubscriptionWithDataSetSizeInBytes(fullBucketSize * 2);
|
||||
}
|
||||
|
||||
protected UserSubscription createSubscriptionWithDataSetSizeInBytes(
|
||||
protected SiteSubscription createSubscriptionWithDataSetSizeInBytes(
|
||||
long bytes) {
|
||||
UserSubscription subscription = SubscriptionFixture.INSTANCE
|
||||
SiteSubscription subscription = SubscriptionFixture.INSTANCE
|
||||
.get(subscriptionSeed++);
|
||||
subscription.setDataSetSize(BandwidthUtil
|
||||
.convertBytesToKilobytes(bytes));
|
||||
|
|
|
@ -62,7 +62,7 @@ import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Subscription.SubscriptionPriority;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionFixture;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.registry.event.RemoveRegistryEvent;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
@ -816,7 +816,7 @@ public class BandwidthManagerIntTest extends AbstractBandwidthManagerIntTest {
|
|||
|
||||
final int numberOfSubscriptionsWithSameProviderDataSet = 4;
|
||||
|
||||
final UserSubscription templateSubscription = createSubscriptionThatFillsUpABucket();
|
||||
final SiteSubscription templateSubscription = createSubscriptionThatFillsUpABucket();
|
||||
final Network route = templateSubscription.getRoute();
|
||||
templateSubscription.setDataSetSize(templateSubscription
|
||||
.getDataSetSize()
|
||||
|
@ -828,7 +828,7 @@ public class BandwidthManagerIntTest extends AbstractBandwidthManagerIntTest {
|
|||
final Subscription[] subscriptions = new Subscription[numberOfSubscriptionsWithSameProviderDataSet];
|
||||
for (int i = 0; i < numberOfSubscriptionsWithSameProviderDataSet; i++) {
|
||||
|
||||
final UserSubscription currentSubscription = new UserSubscription(
|
||||
final SiteSubscription currentSubscription = new SiteSubscription(
|
||||
templateSubscription, "ILookLikeTheOtherGuys-" + i);
|
||||
subscriptions[i] = currentSubscription;
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ public class BandwidthManagerIntTest extends AbstractBandwidthManagerIntTest {
|
|||
private void sendDeletedSubscriptionEvent(Subscription subscription) {
|
||||
RemoveRegistryEvent event = new RemoveRegistryEvent(
|
||||
subscription.getOwner(), subscription.getId());
|
||||
event.setObjectType(DataDeliveryRegistryObjectTypes.USER_SUBSCRIPTION);
|
||||
event.setObjectType(DataDeliveryRegistryObjectTypes.SITE_SUBSCRIPTION);
|
||||
bandwidthManager.subscriptionRemoved(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ import com.raytheon.uf.common.util.AbstractFixture;
|
|||
*/
|
||||
|
||||
public class AdhocSubscriptionFixture extends
|
||||
BaseUserSubscriptionFixture<AdhocSubscription> {
|
||||
BaseSiteSubscriptionFixture<AdhocSubscription> {
|
||||
|
||||
public static final AdhocSubscriptionFixture INSTANCE = new AdhocSubscriptionFixture();
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Random;
|
|||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
|
||||
/**
|
||||
* Adds attributes specific to {@link UserSubscription} types.
|
||||
* Adds attributes specific to {@link SiteSubscription} types.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -40,7 +40,7 @@ import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public abstract class BaseUserSubscriptionFixture<T extends UserSubscription>
|
||||
public abstract class BaseSiteSubscriptionFixture<T extends SiteSubscription>
|
||||
extends BaseSubscriptionFixture<T> {
|
||||
|
||||
/**
|
|
@ -41,6 +41,7 @@ import com.raytheon.uf.common.util.AbstractFixture;
|
|||
* Jan 30, 2013 1543 djohnson Add coverage/parameter data.
|
||||
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Office Ids are now a list.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -74,7 +75,7 @@ public abstract class BaseSubscriptionFixture<T extends Subscription> extends
|
|||
subscription.setFullDataSet(random.nextBoolean());
|
||||
subscription.setGroupName("group" + random.nextInt());
|
||||
subscription.setName("name" + seedValue);
|
||||
subscription.setOfficeID("officeID" + random.nextInt());
|
||||
subscription.addOfficeID("officeID" + random.nextInt());
|
||||
subscription.addParameter(ParameterFixture.INSTANCE.get());
|
||||
// Same priority for all, individual tests needing to test specific
|
||||
// priorities should set it manually anyway
|
||||
|
|
|
@ -42,7 +42,7 @@ import com.raytheon.uf.common.util.AbstractFixture;
|
|||
*/
|
||||
|
||||
public class PendingSubscriptionFixture extends
|
||||
BaseUserSubscriptionFixture<PendingUserSubscription> {
|
||||
BaseSiteSubscriptionFixture<PendingSiteSubscription> {
|
||||
|
||||
public static final PendingSubscriptionFixture INSTANCE = new PendingSubscriptionFixture();
|
||||
|
||||
|
@ -56,8 +56,8 @@ public class PendingSubscriptionFixture extends
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public PendingUserSubscription getInstance(long seedValue, Random random) {
|
||||
PendingUserSubscription sub = super.getInstance(seedValue, random);
|
||||
public PendingSiteSubscription getInstance(long seedValue, Random random) {
|
||||
PendingSiteSubscription sub = super.getInstance(seedValue, random);
|
||||
sub.setChangeReqId("change" + seedValue);
|
||||
|
||||
return sub;
|
||||
|
@ -67,8 +67,8 @@ public class PendingSubscriptionFixture extends
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected PendingUserSubscription getSubscription() {
|
||||
return new PendingUserSubscription();
|
||||
protected PendingSiteSubscription getSubscription() {
|
||||
return new PendingSiteSubscription();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.junit.Test;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 27, 2012 0743 djohnson Initial creation
|
||||
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* May 15, 2013 1040 mpduff Changed to handle the list of office ids.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,9 +46,9 @@ public class PendingSubscriptionTest {
|
|||
|
||||
@Test
|
||||
public void testCopyConstructorSetsOriginalSubNameAsName() {
|
||||
UserSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
SiteSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
|
||||
PendingUserSubscription pendingSubscription = new PendingUserSubscription(
|
||||
PendingSiteSubscription pendingSubscription = new PendingSiteSubscription(
|
||||
subscription, "djohnson");
|
||||
assertEquals(
|
||||
"The original subscription name should have been used for the pending subscription!",
|
||||
|
@ -56,9 +57,9 @@ public class PendingSubscriptionTest {
|
|||
|
||||
@Test
|
||||
public void testCopyConstructorSetsSubscriptionValuesOnPendingSubscription() {
|
||||
UserSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
SiteSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
|
||||
PendingUserSubscription copied = new PendingUserSubscription(
|
||||
PendingSiteSubscription copied = new PendingSiteSubscription(
|
||||
subscription, "djohnson");
|
||||
|
||||
assertEquals(subscription.getActivePeriodEnd(),
|
||||
|
@ -71,7 +72,7 @@ public class PendingSubscriptionTest {
|
|||
assertEquals(subscription.getDataSetType(), copied.getDataSetType());
|
||||
assertEquals(subscription.getDescription(), copied.getDescription());
|
||||
assertEquals(subscription.getGroupName(), copied.getGroupName());
|
||||
assertEquals(subscription.getOfficeID(), copied.getOfficeID());
|
||||
assertEquals(subscription.getOfficeIDs(), copied.getOfficeIDs());
|
||||
assertEquals(subscription.getPriority(), copied.getPriority());
|
||||
assertEquals(subscription.getProvider(), copied.getProvider());
|
||||
assertEquals(subscription.getStatus(), copied.getStatus());
|
||||
|
|
|
@ -28,11 +28,14 @@ import static org.junit.Assert.assertThat;
|
|||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
|
||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
||||
import com.raytheon.uf.common.time.CalendarBuilder;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.time.util.TimeUtilTest;
|
||||
|
@ -50,13 +53,14 @@ import com.raytheon.uf.common.time.util.TimeUtilTest;
|
|||
* Jan 02, 2013 1345 djohnson Fix broken assertion that id matches copied object.
|
||||
* Jan 11, 2013 1453 djohnson Add test for active period crossing year boundary.
|
||||
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* May 15, 2013 1040 mpduff Office Id now a set.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public class UserSubscriptionTest {
|
||||
public class SiteSubscriptionTest {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
@ -74,9 +78,9 @@ public class UserSubscriptionTest {
|
|||
|
||||
@Test
|
||||
public void testCopyConstructorSetsSpecifiedName() throws Exception {
|
||||
UserSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
SiteSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
|
||||
Subscription copied = new UserSubscription(subscription, "newName");
|
||||
Subscription copied = new SiteSubscription(subscription, "newName");
|
||||
|
||||
assertEquals("Expected the new name to be set on the subscription!",
|
||||
"newName", copied.getName());
|
||||
|
@ -85,9 +89,9 @@ public class UserSubscriptionTest {
|
|||
@Test
|
||||
public void testCopyConstructorSetsValuesFromSourceSubscription()
|
||||
throws Exception {
|
||||
UserSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
SiteSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
|
||||
Subscription copied = new UserSubscription(subscription, "newName");
|
||||
Subscription copied = new SiteSubscription(subscription, "newName");
|
||||
|
||||
assertEquals(subscription.getActivePeriodEnd(),
|
||||
copied.getActivePeriodEnd());
|
||||
|
@ -102,7 +106,7 @@ public class UserSubscriptionTest {
|
|||
|
||||
assertThat(copied.getId(), is(not(equalTo(subscription.getId()))));
|
||||
|
||||
assertEquals(subscription.getOfficeID(), copied.getOfficeID());
|
||||
assertEquals(subscription.getOfficeIDs(), copied.getOfficeIDs());
|
||||
assertEquals(subscription.getPriority(), copied.getPriority());
|
||||
assertEquals(subscription.getProvider(), copied.getProvider());
|
||||
assertEquals(subscription.getStatus(), copied.getStatus());
|
||||
|
@ -198,4 +202,12 @@ public class UserSubscriptionTest {
|
|||
assertThat(subscription.getStatus(),
|
||||
is(equalTo(SubscriptionStatus.ACTIVE.toString())));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIt() throws JAXBException {
|
||||
Subscription subscription = new SubscriptionBuilder().withOfficeId(
|
||||
"OAX").build();
|
||||
System.out.println(new JAXBManager(SiteSubscription.class)
|
||||
.marshalToXml(subscription));
|
||||
}
|
||||
}
|
|
@ -38,6 +38,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* Jan 30, 2013 1543 djohnson Add ability to specify route.
|
||||
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Office Id now a set.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -96,8 +97,8 @@ public class SubscriptionBuilder {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public UserSubscription build() {
|
||||
UserSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
public SiteSubscription build() {
|
||||
SiteSubscription subscription = SubscriptionFixture.INSTANCE.get();
|
||||
subscription.setActive(active);
|
||||
subscription.setActivePeriodStart(activePeriodStart);
|
||||
subscription.setActivePeriodEnd(activePeriodEnd);
|
||||
|
@ -110,7 +111,7 @@ public class SubscriptionBuilder {
|
|||
subscription.setGroupName(groupName);
|
||||
subscription.setLatencyInMinutes(latencyInMinutes);
|
||||
subscription.setName(name);
|
||||
subscription.setOfficeID(officeId);
|
||||
subscription.addOfficeID(officeId);
|
||||
subscription.setOwner(owner);
|
||||
subscription.setPriority(priority);
|
||||
subscription.setSubscriptionStart(subscriptionStart);
|
||||
|
|
|
@ -41,7 +41,7 @@ import com.raytheon.uf.common.util.AbstractFixture;
|
|||
*/
|
||||
|
||||
public class SubscriptionFixture extends
|
||||
BaseUserSubscriptionFixture<UserSubscription> {
|
||||
BaseSiteSubscriptionFixture<SiteSubscription> {
|
||||
|
||||
public static final SubscriptionFixture INSTANCE = new SubscriptionFixture();
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class SubscriptionFixture extends
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected UserSubscription getSubscription() {
|
||||
return new UserSubscription();
|
||||
protected SiteSubscription getSubscription() {
|
||||
return new SiteSubscription();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 17, 2012 0726 djohnson Initial creation
|
||||
* Feb 20, 2013 1543 djohnson Implement route filtering.
|
||||
* May 15, 2013 1040 mpduff Office Id now a set.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -113,12 +114,12 @@ public class BaseMemorySubscriptionHandler<T extends Subscription> extends
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<T> getByFilters(String group, String officeId)
|
||||
public List<T> getByFilters(String group, String officeIds)
|
||||
throws RegistryHandlerException {
|
||||
List<T> retVal = new ArrayList<T>();
|
||||
for (T obj : getAll()) {
|
||||
if (matches(group, obj.getGroupName())
|
||||
&& matches(officeId, obj.getOfficeID())) {
|
||||
&& matches(officeIds, obj.getOfficeIDs())) {
|
||||
retVal.add(obj);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
|
|||
import com.raytheon.uf.common.datadelivery.registry.GroupDefinitionServiceRequest;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionBuilder;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.service.GroupDefinitionService;
|
||||
import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
|
||||
import com.raytheon.uf.common.registry.RegistryManagerTest;
|
||||
|
@ -97,10 +97,10 @@ public class GroupDefinitionServiceTest {
|
|||
group.setGroupName(GROUP_NAME);
|
||||
groupHandler.store(group);
|
||||
|
||||
UserSubscription subscription = new SubscriptionBuilder()
|
||||
SiteSubscription subscription = new SubscriptionBuilder()
|
||||
.withGroupName(
|
||||
GROUP_NAME).build();
|
||||
UserSubscription subscription2 = new UserSubscription(subscription,
|
||||
SiteSubscription subscription2 = new SiteSubscription(subscription,
|
||||
"sub2");
|
||||
|
||||
subscriptionHandler.store(subscription);
|
||||
|
|
|
@ -34,7 +34,7 @@ import com.raytheon.uf.common.datadelivery.registry.GriddedCoverage;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ParameterFixture;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionFixture;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Envelope;
|
||||
|
@ -61,8 +61,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
|
||||
@Test
|
||||
public void returnsPercentOfParametersThatAreTheSame() {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
sub1.getParameter().clear();
|
||||
sub1.addParameter(ParameterFixture.INSTANCE.get(1));
|
||||
|
@ -79,8 +79,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
|
||||
@Test
|
||||
public void returnsZeroPercentOfParametersForNullsOrEmpties() {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
sub1.setParameter(null);
|
||||
|
||||
|
@ -101,8 +101,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
|
||||
@Test
|
||||
public void returnsPercentOfForecastHoursThatAreTheSame() {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
final List<Integer> sub1SelectedTimes = Arrays.asList(0, 1);
|
||||
sub1.getTime().setSelectedTimeIndices(sub1SelectedTimes);
|
||||
|
@ -117,8 +117,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
|
||||
@Test
|
||||
public void returnsZeroPercentOfForecastHoursForNullsOrEmpties() {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
sub1.getTime().setSelectedTimeIndices(null);
|
||||
final List<Integer> sub2SelectedTimes = Arrays.asList(0, 3, 4);
|
||||
|
@ -139,8 +139,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
|
||||
@Test
|
||||
public void returnsPercentOfCyclesThatAreTheSame() {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
final List<Integer> sub1CycleTimes = Arrays.asList(0, 6);
|
||||
sub1.getTime().setCycleTimes(sub1CycleTimes);
|
||||
|
@ -155,8 +155,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
|
||||
@Test
|
||||
public void returnsZeroPercentOfCyclesForNullsOrEmpties() {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
sub1.getTime().setCycleTimes(null);
|
||||
final List<Integer> cycleTimes = Arrays.asList(0, 3, 4);
|
||||
|
@ -173,8 +173,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
@Test
|
||||
public void returnsPercentOfSpatialThatIsTheSame()
|
||||
throws TransformException {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
ReferencedEnvelope envelope1 = new ReferencedEnvelope(new Envelope(
|
||||
new Coordinate(-5, 0), new Coordinate(0, 5)),
|
||||
|
@ -198,8 +198,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
@Test
|
||||
public void returnsZeroPercentOfSpatialWhenNoOverlap()
|
||||
throws TransformException {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
ReferencedEnvelope envelope1 = new ReferencedEnvelope(new Envelope(
|
||||
new Coordinate(-5, 0), new Coordinate(0, 5)),
|
||||
|
@ -217,8 +217,8 @@ public class SubscriptionDuplicateCheckerTest {
|
|||
|
||||
@Test
|
||||
public void returnsZeroPercentOfSpatialForNulls() throws TransformException {
|
||||
final UserSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final UserSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
final SiteSubscription sub1 = SubscriptionFixture.INSTANCE.get(1);
|
||||
final SiteSubscription sub2 = SubscriptionFixture.INSTANCE.get(2);
|
||||
|
||||
sub1.setCoverage(null);
|
||||
|
||||
|
|
|
@ -78,11 +78,11 @@ public class TestJaxbableClassesLocator implements IJaxbableClassesLocator {
|
|||
com.raytheon.uf.common.datadelivery.registry.Parameter.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.ParameterLevel.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.PendingSharedSubscription.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.PendingUserSubscription.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.PendingSiteSubscription.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.Projection.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.Provider.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.SharedSubscription.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.UserSubscription.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.SiteSubscription.class,
|
||||
com.raytheon.uf.common.datadelivery.registry.Time.class,
|
||||
com.raytheon.uf.common.datadelivery.retrieval.xml.ParameterLookup.class,
|
||||
com.raytheon.uf.common.datadelivery.retrieval.xml.ParameterConfig.class,
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.Test;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionBuilder;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
@ -64,15 +64,15 @@ public class FindActiveSubscriptionsForRouteTest {
|
|||
.getSubscriptionHandler();
|
||||
|
||||
// Two OPSNET subscriptions
|
||||
final UserSubscription opsnetSub1 = new SubscriptionBuilder()
|
||||
final SiteSubscription opsnetSub1 = new SubscriptionBuilder()
|
||||
.withName("opsnetSub1").withRoute(Network.OPSNET).build();
|
||||
final UserSubscription opsnetSub2 = new UserSubscription(opsnetSub1,
|
||||
final SiteSubscription opsnetSub2 = new SiteSubscription(opsnetSub1,
|
||||
"opsnetSub2");
|
||||
|
||||
// Two SBN subscriptions
|
||||
final UserSubscription sbnSub1 = new SubscriptionBuilder()
|
||||
final SiteSubscription sbnSub1 = new SubscriptionBuilder()
|
||||
.withName("sbnSub1").withRoute(Network.SBN).build();
|
||||
final UserSubscription sbnSub2 = new UserSubscription(sbnSub1,
|
||||
final SiteSubscription sbnSub2 = new SiteSubscription(sbnSub1,
|
||||
"sbnSub2");
|
||||
|
||||
// Store all subscriptions
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.raytheon.uf.common.datadelivery.registry.GriddedDataSetMetaData;
|
|||
import com.raytheon.uf.common.datadelivery.registry.OpenDapGriddedDataSetMetaDataFixture;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.registry.RegistryManagerTest;
|
||||
|
||||
/**
|
||||
|
@ -61,7 +61,7 @@ public class OpenDAPRetrievalGeneratorTest {
|
|||
Time time = new Time();
|
||||
time.setCycleTimes(Arrays.asList(0, 12));
|
||||
|
||||
UserSubscription subscription = new UserSubscription();
|
||||
SiteSubscription subscription = new SiteSubscription();
|
||||
subscription.setTime(time);
|
||||
|
||||
GriddedDataSetMetaData metaData = OpenDapGriddedDataSetMetaDataFixture.INSTANCE
|
||||
|
@ -77,7 +77,7 @@ public class OpenDAPRetrievalGeneratorTest {
|
|||
Time time = new Time();
|
||||
time.setCycleTimes(Arrays.asList(0, 12));
|
||||
|
||||
UserSubscription subscription = new UserSubscription();
|
||||
SiteSubscription subscription = new SiteSubscription();
|
||||
subscription.setTime(time);
|
||||
|
||||
GriddedDataSetMetaData metaData = OpenDapGriddedDataSetMetaDataFixture.INSTANCE
|
||||
|
@ -93,7 +93,7 @@ public class OpenDAPRetrievalGeneratorTest {
|
|||
Time time = new Time();
|
||||
time.setCycleTimes(Arrays.asList(0, 12));
|
||||
|
||||
Subscription subscription = new UserSubscription();
|
||||
Subscription subscription = new SiteSubscription();
|
||||
subscription.setTime(time);
|
||||
|
||||
GriddedDataSetMetaData metaData = OpenDapGriddedDataSetMetaDataFixture.INSTANCE
|
||||
|
@ -110,7 +110,7 @@ public class OpenDAPRetrievalGeneratorTest {
|
|||
time.setCycleTimes(Arrays
|
||||
.<Integer> asList(GriddedDataSetMetaData.NO_CYCLE));
|
||||
|
||||
Subscription subscription = new UserSubscription();
|
||||
Subscription subscription = new SiteSubscription();
|
||||
subscription.setTime(time);
|
||||
|
||||
GriddedDataSetMetaData metaData = OpenDapGriddedDataSetMetaDataFixture.INSTANCE
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.junit.BeforeClass;
|
|||
import org.junit.Test;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
|
||||
/**
|
||||
|
@ -62,7 +62,7 @@ public class NotificationMessageContainsTypeTest {
|
|||
@BeforeClass
|
||||
public static void classSetUp() throws JMSException, JAXBException {
|
||||
when(message.getText()).thenReturn(
|
||||
SerializationUtil.marshalToXml(new UserSubscription()));
|
||||
SerializationUtil.marshalToXml(new SiteSubscription()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -70,7 +70,7 @@ public class NotificationMessageContainsTypeTest {
|
|||
throws JMSException, JAXBException {
|
||||
|
||||
NotificationMessageContainsType condition = new NotificationMessageContainsType(
|
||||
String.class, UserSubscription.class);
|
||||
String.class, SiteSubscription.class);
|
||||
assertThat(
|
||||
condition
|
||||
.matchesCondition(new NotificationMessage[] { notificationMessage }),
|
||||
|
@ -82,7 +82,7 @@ public class NotificationMessageContainsTypeTest {
|
|||
JAXBException {
|
||||
|
||||
NotificationMessageContainsType condition = new NotificationMessageContainsType(
|
||||
UserSubscription.class);
|
||||
SiteSubscription.class);
|
||||
assertThat(
|
||||
condition
|
||||
.matchesCondition(new NotificationMessage[] { notificationMessage }),
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
import com.raytheon.uf.common.auth.user.IUser;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingUserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
|
@ -340,6 +340,6 @@ public class SubscriptionServiceMassUpdateTest extends
|
|||
when(
|
||||
DataDeliveryHandlers.getPendingSubscriptionHandler()
|
||||
.getBySubscription(subscription)).thenReturn(
|
||||
new InitialPendingUserSubscription());
|
||||
new InitialPendingSiteSubscription());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ import com.raytheon.uf.common.datadelivery.registry.OpenDapGriddedDataSet;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionBuilder;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SubscriptionFixture;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
import com.raytheon.uf.common.time.CalendarBuilder;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
@ -74,6 +74,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.view.ICreateSubscriptionDlg
|
|||
* Jan 11, 2013 1453 djohnson Add test from failed test scenario.
|
||||
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 08, 2013 1826 djohnson Remove delivery options.
|
||||
* May 15, 2013 1040 mpduff Remove method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -197,7 +198,7 @@ public class CreateSubscriptionPresenterTest {
|
|||
cal.add(Calendar.YEAR, -1);
|
||||
Date oneYearAgo = cal.getTime();
|
||||
|
||||
UserSubscription subscription = new SubscriptionBuilder()
|
||||
SiteSubscription subscription = new SubscriptionBuilder()
|
||||
.withActivePeriodStart(oneYearAgo)
|
||||
.withActivePeriodEnd(oneYearAgo).build();
|
||||
|
||||
|
@ -221,7 +222,7 @@ public class CreateSubscriptionPresenterTest {
|
|||
// Freeze time at Jan. 5
|
||||
TimeUtilTest.freezeTime(yesterday.getTime() + TimeUtil.MILLIS_PER_DAY);
|
||||
|
||||
UserSubscription subscription = new SubscriptionBuilder()
|
||||
SiteSubscription subscription = new SubscriptionBuilder()
|
||||
.withActivePeriodStart(yesterday)
|
||||
.withActivePeriodEnd(yesterday).build();
|
||||
|
||||
|
@ -254,7 +255,7 @@ public class CreateSubscriptionPresenterTest {
|
|||
cal.add(Calendar.DAY_OF_MONTH, 3);
|
||||
Date threeDaysFromNow = cal.getTime();
|
||||
|
||||
UserSubscription subscription = new SubscriptionBuilder()
|
||||
SiteSubscription subscription = new SubscriptionBuilder()
|
||||
.withActivePeriodStart(yesterday)
|
||||
.withActivePeriodEnd(threeDaysFromNow).build();
|
||||
|
||||
|
@ -281,7 +282,7 @@ public class CreateSubscriptionPresenterTest {
|
|||
cal2.add(Calendar.DAY_OF_YEAR, 3);
|
||||
Date oneYearAgoPlusThreeDays = cal2.getTime();
|
||||
|
||||
UserSubscription subscription = new SubscriptionBuilder()
|
||||
SiteSubscription subscription = new SubscriptionBuilder()
|
||||
.withActivePeriodStart(oneYearAgo)
|
||||
.withActivePeriodEnd(oneYearAgoPlusThreeDays).build();
|
||||
|
||||
|
@ -313,7 +314,7 @@ public class CreateSubscriptionPresenterTest {
|
|||
cal2.set(Calendar.YEAR, 1970);
|
||||
Date januaryFourth = cal2.getTime();
|
||||
|
||||
UserSubscription subscription = new SubscriptionBuilder()
|
||||
SiteSubscription subscription = new SubscriptionBuilder()
|
||||
.withActivePeriodStart(decemberThirtieth)
|
||||
.withActivePeriodEnd(januaryFourth).build();
|
||||
|
||||
|
@ -377,7 +378,7 @@ public class CreateSubscriptionPresenterTest {
|
|||
cal2.set(Calendar.YEAR, 1970);
|
||||
final Date endDate = cal2.getTime();
|
||||
|
||||
UserSubscription subscription = new SubscriptionBuilder()
|
||||
SiteSubscription subscription = new SubscriptionBuilder()
|
||||
.withActivePeriodStart(startDate).withActivePeriodEnd(endDate)
|
||||
.build();
|
||||
|
||||
|
@ -395,16 +396,9 @@ public class CreateSubscriptionPresenterTest {
|
|||
argThat(yyyyMmDdMatches(januaryFirstYearLater)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifySubscriptionSetToView() {
|
||||
presenter.open();
|
||||
verify(view).setSubscription(presenter.getSubscription());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyCycleTimesSetToView() {
|
||||
presenter.open();
|
||||
verify(view).setCycleTimes(dataSet.getCycles());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.junit.Test;
|
|||
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.UserSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.units.DataSizeUnit;
|
||||
import com.raytheon.uf.viz.datadelivery.system.CreateEditRuleDlg.FreqUnitOptions;
|
||||
import com.raytheon.uf.viz.datadelivery.system.Operator;
|
||||
|
@ -64,7 +64,7 @@ public class RuleXMLTest {
|
|||
|
||||
@Before
|
||||
public void setUp() {
|
||||
sub = new UserSubscription();
|
||||
sub = new SiteSubscription();
|
||||
sub.setDataSetName("GFS");
|
||||
sub.setDataSetType(DataType.GRID);
|
||||
sub.setDataSetSize(100);
|
||||
|
|
Loading…
Add table
Reference in a new issue