Issue #1981 - OUPRequest is now a privileged request.
Also proctecting TafQueueRequest Change-Id: I3a05a407a21b8f9d2e6426c4f456e2218479242a Former-commit-id: acc1b993db8d78f7edfc3bd287b7d3ca39c0d391
This commit is contained in:
parent
03a377c552
commit
ee5e9c1435
23 changed files with 379 additions and 90 deletions
|
@ -37,6 +37,7 @@ import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 21, 2010 mschenke Initial creation
|
* May 21, 2010 mschenke Initial creation
|
||||||
* Nov 06, 2012 1302 djohnson Add ability to get roles/permissions for an application.
|
* Nov 06, 2012 1302 djohnson Add ability to get roles/permissions for an application.
|
||||||
|
* Jun 07, 2013 1981 mpduff Add ability to update with the user id as a string.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -85,4 +86,14 @@ public interface IUserManager {
|
||||||
* @return the list of roles
|
* @return the list of roles
|
||||||
*/
|
*/
|
||||||
List<IRole> getRoles(String application);
|
List<IRole> getRoles(String application);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the user object with the authentication data update
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* User's id
|
||||||
|
* @param authData
|
||||||
|
* User's authentication data
|
||||||
|
*/
|
||||||
|
void updateUserObject(String userId, IAuthenticationData authData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
||||||
* Nov 06, 2012 1302 djohnson Add ability to retrieve the {@link IUserManager}.
|
* Nov 06, 2012 1302 djohnson Add ability to retrieve the {@link IUserManager}.
|
||||||
* Jan 04, 2013 1451 djohnson Move static block code to an implementation of an interface.
|
* Jan 04, 2013 1451 djohnson Move static block code to an implementation of an interface.
|
||||||
* Mar 21, 2013 1794 djohnson ServiceLoaderUtil now requires the requesting class.
|
* Mar 21, 2013 1794 djohnson ServiceLoaderUtil now requires the requesting class.
|
||||||
|
* Jun 07, 2013 1981 mpduff Add ability to update with the user id as a string.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -166,6 +167,12 @@ public class UserController {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUserObject(String userId,
|
||||||
|
IAuthenticationData authData) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return manager;
|
return manager;
|
||||||
|
@ -194,6 +201,16 @@ public class UserController {
|
||||||
manager.updateUserObject(manager.getUserObject(), data);
|
manager.updateUserObject(manager.getUserObject(), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the user's id.
|
||||||
|
*
|
||||||
|
* @param userID
|
||||||
|
* The user id
|
||||||
|
*/
|
||||||
|
public static void updateUserData(String userID) {
|
||||||
|
manager.updateUserObject(userID, null);
|
||||||
|
}
|
||||||
|
|
||||||
public static INotAuthHandler getNotAuthHandler() {
|
public static INotAuthHandler getNotAuthHandler() {
|
||||||
return manager.getNotAuthHandler();
|
return manager.getNotAuthHandler();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package com.raytheon.uf.viz.core.comm;
|
package com.raytheon.uf.viz.core.comm;
|
||||||
|
|
||||||
import com.raytheon.uf.common.comm.IHttpsCredentialsHandler;
|
import com.raytheon.uf.common.comm.IHttpsCredentialsHandler;
|
||||||
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cave implementation of the IHttpsCredentialsHandler. Displays the Cave login
|
* Cave implementation of the IHttpsCredentialsHandler. Displays the Cave login
|
||||||
|
@ -31,7 +32,8 @@ import com.raytheon.uf.common.comm.IHttpsCredentialsHandler;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 4, 2013 1786 mpduff Initial creation
|
* Mar 04, 2013 1786 mpduff Initial creation.
|
||||||
|
* Jun 07, 2013 1981 mpduff Save user's username in UserController.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -52,6 +54,9 @@ public class CaveHttpsCredentialsHandler implements IHttpsCredentialsHandler {
|
||||||
}
|
}
|
||||||
HttpsLoginDlg login = new HttpsLoginDlg(message);
|
HttpsLoginDlg login = new HttpsLoginDlg(message);
|
||||||
login.open();
|
login.open();
|
||||||
return login.getCredentials();
|
String[] credentials = login.getCredentials();
|
||||||
|
// Save off the user's username in the UserController
|
||||||
|
UserController.updateUserData(credentials[0]);
|
||||||
|
return credentials;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 27, 2010 rgeorge Initial creation
|
* May 27, 2010 rgeorge Initial creation
|
||||||
|
* Jun 07, 2013 1981 mpduff Add an IUser field.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -49,6 +50,9 @@ public class NwsUserManager implements IUserManager {
|
||||||
|
|
||||||
private final NwsNotAuthHandler notAuthHandler = new NwsNotAuthHandler();
|
private final NwsNotAuthHandler notAuthHandler = new NwsNotAuthHandler();
|
||||||
|
|
||||||
|
/** Saved User Name */
|
||||||
|
private IUser user;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -66,8 +70,13 @@ public class NwsUserManager implements IUserManager {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IUser getUserObject() {
|
public IUser getUserObject() {
|
||||||
String userId = System.getProperty("user.name");
|
if (this.user == null) {
|
||||||
return new User(userId);
|
String userId = System.getProperty("user.name");
|
||||||
|
this.user = new User(userId);
|
||||||
|
return this.user;
|
||||||
|
} else {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -80,6 +89,7 @@ public class NwsUserManager implements IUserManager {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateUserObject(IUser user, IAuthenticationData authData) {
|
public void updateUserObject(IUser user, IAuthenticationData authData) {
|
||||||
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,4 +109,12 @@ public class NwsUserManager implements IUserManager {
|
||||||
// TODO: Should this pass through to EDEX to get this stuff?
|
// TODO: Should this pass through to EDEX to get this stuff?
|
||||||
return NwsRoleDataManager.getInstance().getRoles(application);
|
return NwsRoleDataManager.getInstance().getRoles(application);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updateUserObject(String userId, IAuthenticationData authData) {
|
||||||
|
user = new User(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
|
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.viz.application;bundle-version="1.0.0",
|
com.raytheon.uf.viz.application;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.tafqueue;bundle-version="1.0.0",
|
com.raytheon.uf.common.tafqueue;bundle-version="1.0.0",
|
||||||
org.apache.commons.lang;bundle-version="2.3.0"
|
org.apache.commons.lang;bundle-version="2.3.0",
|
||||||
|
com.raytheon.uf.common.auth;bundle-version="1.12.1174"
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||||
Export-Package: com.raytheon.viz.aviation,
|
Export-Package: com.raytheon.viz.aviation,
|
||||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.uf.common.tafqueue.ServerResponse;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRecord;
|
import com.raytheon.uf.common.tafqueue.TafQueueRecord;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
||||||
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.viz.aviation.AviationDialog;
|
import com.raytheon.viz.aviation.AviationDialog;
|
||||||
|
@ -70,6 +71,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 12/08/2011 11745 rferrel Updated header time to transmission time.
|
* 12/08/2011 11745 rferrel Updated header time to transmission time.
|
||||||
* 08AUG2012 15613 zhao Determine proper BBB for transmission
|
* 08AUG2012 15613 zhao Determine proper BBB for transmission
|
||||||
* 09OCT2012 1229 rferrel Make dialog non-blocking.
|
* 09OCT2012 1229 rferrel Make dialog non-blocking.
|
||||||
|
* 0yJUN2013 1981 mpduff Set user on the request.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -116,12 +118,12 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* Tab composite containing the TAF Viewer and the TAF Editor.
|
* Tab composite containing the TAF Viewer and the TAF Editor.
|
||||||
*/
|
*/
|
||||||
private EditorTafTabComp tabComp;
|
private final EditorTafTabComp tabComp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message status composite.
|
* Message status composite.
|
||||||
*/
|
*/
|
||||||
private IStatusSettable msgStatComp;
|
private final IStatusSettable msgStatComp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main composite.
|
* Main composite.
|
||||||
|
@ -136,7 +138,7 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* Send the TAFs individually or as a collective.
|
* Send the TAFs individually or as a collective.
|
||||||
*/
|
*/
|
||||||
private boolean sendCollective;
|
private final boolean sendCollective;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -346,6 +348,7 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
private void sendAction() {
|
private void sendAction() {
|
||||||
TafQueueRequest request = new TafQueueRequest();
|
TafQueueRequest request = new TafQueueRequest();
|
||||||
request.setType(Type.CREATE);
|
request.setType(Type.CREATE);
|
||||||
|
request.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
// Forecaster ID
|
// Forecaster ID
|
||||||
int forecasterId = forecasterArray.get(personList.getSelectionIndex())
|
int forecasterId = forecasterArray.get(personList.getSelectionIndex())
|
||||||
|
@ -473,11 +476,12 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
try {
|
try {
|
||||||
TafQueueRequest request = new TafQueueRequest();
|
TafQueueRequest request = new TafQueueRequest();
|
||||||
request.setType(Type.GET_LIST);
|
request.setType(Type.GET_LIST);
|
||||||
|
request.setUser(UserController.getUserObject());
|
||||||
request.setState(TafQueueRecord.TafQueueState.SENT);
|
request.setState(TafQueueRecord.TafQueueState.SENT);
|
||||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||||
.sendRequest(request);
|
.sendRequest(request);
|
||||||
java.util.List<String> payload = response.getPayload();
|
java.util.List<String> payload = response.getPayload();
|
||||||
String[] records = (String[]) payload.toArray(new String[0]);
|
String[] records = payload.toArray(new String[0]);
|
||||||
int numRecords = records.length;
|
int numRecords = records.length;
|
||||||
for (int i = numRecords - 1; i >= 0; i--) {
|
for (int i = numRecords - 1; i >= 0; i--) {
|
||||||
if (records[i].contains(siteId)) {
|
if (records[i].contains(siteId)) {
|
||||||
|
|
|
@ -42,6 +42,7 @@ import com.raytheon.uf.common.tafqueue.ServerResponse;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRecord.TafQueueState;
|
import com.raytheon.uf.common.tafqueue.TafQueueRecord.TafQueueState;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
||||||
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
|
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
|
||||||
|
@ -62,6 +63,7 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
||||||
* 14 MAY 2012 14715 rferrel Use EDEX to perform requests.
|
* 14 MAY 2012 14715 rferrel Use EDEX to perform requests.
|
||||||
* 10 OCT 2012 1229 rferrel Make dialog non-blocking.
|
* 10 OCT 2012 1229 rferrel Make dialog non-blocking.
|
||||||
* 10 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
* 10 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
|
* 07 JUN 2013 1981 mpduff Set user on the request.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -113,8 +115,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
*/
|
*/
|
||||||
private String[] dayOfWeek = new String[] { "Sunday", "Monday", "Tuesday",
|
private final String[] dayOfWeek = new String[] { "Sunday", "Monday",
|
||||||
"Wednesday", "Thursday", "Friday", "Saturday" };
|
"Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Selected day of the week Calendar day of the week value.
|
* The Selected day of the week Calendar day of the week value.
|
||||||
|
@ -306,8 +308,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
+ " moved back to 'pending'. The transmission time (the last\n"
|
+ " moved back to 'pending'. The transmission time (the last\n"
|
||||||
+ " part of the file name) is updated to the current time.\n"
|
+ " part of the file name) is updated to the current time.\n"
|
||||||
+ " Help: displays this window";
|
+ " Help: displays this window";
|
||||||
usageDlg = new HelpUsageDlg(shell, description,
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
helpText);
|
|
||||||
usageDlg.open();
|
usageDlg.open();
|
||||||
} else {
|
} else {
|
||||||
usageDlg.bringToTop();
|
usageDlg.bringToTop();
|
||||||
|
@ -333,6 +334,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
request.setType(Type.RETRANSMIT);
|
request.setType(Type.RETRANSMIT);
|
||||||
request.setState(getDisplayState());
|
request.setState(getDisplayState());
|
||||||
request.setArgument(idList);
|
request.setArgument(idList);
|
||||||
|
request.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||||
|
@ -384,6 +386,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
TafQueueRequest request = new TafQueueRequest();
|
TafQueueRequest request = new TafQueueRequest();
|
||||||
request.setType(Type.GET_TAFS);
|
request.setType(Type.GET_TAFS);
|
||||||
request.setArgument(idList);
|
request.setArgument(idList);
|
||||||
|
request.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
ServerResponse<String> response = null;
|
ServerResponse<String> response = null;
|
||||||
try {
|
try {
|
||||||
response = (ServerResponse<String>) ThriftClient
|
response = (ServerResponse<String>) ThriftClient
|
||||||
|
@ -426,6 +430,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
request.setType(Type.REMOVE_SELECTED);
|
request.setType(Type.REMOVE_SELECTED);
|
||||||
request.setState(getDisplayState());
|
request.setState(getDisplayState());
|
||||||
request.setArgument(idList);
|
request.setArgument(idList);
|
||||||
|
request.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||||
|
@ -634,6 +639,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
selectedDayEnd.add(Calendar.DAY_OF_MONTH, 1);
|
selectedDayEnd.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
dateList.add(selectedDayEnd.getTime());
|
dateList.add(selectedDayEnd.getTime());
|
||||||
request.setArgument(dateList);
|
request.setArgument(dateList);
|
||||||
|
request.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ServerResponse<String> response = (ServerResponse<String>) ThriftClient
|
ServerResponse<String> response = (ServerResponse<String>) ThriftClient
|
||||||
|
@ -660,6 +666,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
request.setType(Type.GET_LIST);
|
request.setType(Type.GET_LIST);
|
||||||
|
|
||||||
request.setState(getDisplayState());
|
request.setState(getDisplayState());
|
||||||
|
request.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||||
.sendRequest(request);
|
.sendRequest(request);
|
||||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.time.SimulatedTime;
|
import com.raytheon.uf.common.time.SimulatedTime;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.viz.core.mode.CAVEMode;
|
import com.raytheon.viz.core.mode.CAVEMode;
|
||||||
|
@ -68,6 +69,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 02apr2013 15564 mgamazaychikov Ensured awipsWanPil to be 10 characters space-padded long
|
* 02apr2013 15564 mgamazaychikov Ensured awipsWanPil to be 10 characters space-padded long
|
||||||
* 08 MAY 2013 1842 dgilling Use VtecUtil to set product ETNs, fix
|
* 08 MAY 2013 1842 dgilling Use VtecUtil to set product ETNs, fix
|
||||||
* warnings.
|
* warnings.
|
||||||
|
* 07 Jun 2013 1981 mpduff Set user's id in OUPRequest as it is now a protected operation.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -120,15 +122,15 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
|
||||||
|
|
||||||
private String productText;
|
private String productText;
|
||||||
|
|
||||||
private ProductEditorComp parentEditor;
|
private final ProductEditorComp parentEditor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Product transmission callback to report the state of transmitting a
|
* Product transmission callback to report the state of transmitting a
|
||||||
* product.
|
* product.
|
||||||
*/
|
*/
|
||||||
private ITransmissionState transmissionCB;
|
private final ITransmissionState transmissionCB;
|
||||||
|
|
||||||
private String pid;
|
private final String pid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -427,7 +429,9 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
|
||||||
oup.setNeedsWmoHeader(false);
|
oup.setNeedsWmoHeader(false);
|
||||||
oup.setSource("GFE");
|
oup.setSource("GFE");
|
||||||
((OUPRequest) req).setProduct(oup);
|
((OUPRequest) req).setProduct(oup);
|
||||||
|
((OUPRequest) req).setUser(UserController.getUserObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object response = ThriftClient.sendRequest(req);
|
Object response = ThriftClient.sendRequest(req);
|
||||||
// TODO need a response on the other one? it's going
|
// TODO need a response on the other one? it's going
|
||||||
|
|
|
@ -30,7 +30,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
|
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.viz.application;bundle-version="1.0.0",
|
com.raytheon.uf.viz.application;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.dataplugin.shef;bundle-version="1.12.1174",
|
com.raytheon.uf.common.dataplugin.shef;bundle-version="1.12.1174",
|
||||||
com.raytheon.viz.pointdata;bundle-version="1.12.1174"
|
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.common.auth;bundle-version="1.12.1174"
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.viz.hydro,
|
Export-Package: com.raytheon.viz.hydro,
|
||||||
com.raytheon.viz.hydro.perspective,
|
com.raytheon.viz.hydro.perspective,
|
||||||
|
|
|
@ -77,6 +77,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.time.SimulatedTime;
|
import com.raytheon.uf.common.time.SimulatedTime;
|
||||||
import com.raytheon.uf.common.util.FileUtil;
|
import com.raytheon.uf.common.util.FileUtil;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.viz.hydro.timeseries.table.DataRecord;
|
import com.raytheon.viz.hydro.timeseries.table.DataRecord;
|
||||||
|
@ -126,6 +127,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Feb 05,2013 1578 rferrel Changes for non-blocking singleton TimeSeriesDlg.
|
* Feb 05,2013 1578 rferrel Changes for non-blocking singleton TimeSeriesDlg.
|
||||||
* Code clean up for non-blocking dialog.
|
* Code clean up for non-blocking dialog.
|
||||||
* Feb 27,2013 1790 rferrel Bug fix for non-blocking dialogs.
|
* Feb 27,2013 1790 rferrel Bug fix for non-blocking dialogs.
|
||||||
|
* Jun 07, 2013 1981 mpduff Set user's id on the OUPRequest as it is now protected.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -188,19 +190,21 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
/**
|
/**
|
||||||
* Simple date formatter.
|
* Simple date formatter.
|
||||||
*/
|
*/
|
||||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
private final SimpleDateFormat sdf = new SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple date formatter for the forecast basis time.
|
* Simple date formatter for the forecast basis time.
|
||||||
*/
|
*/
|
||||||
private SimpleDateFormat prodBasisFmt = new SimpleDateFormat(
|
private final SimpleDateFormat prodBasisFmt = new SimpleDateFormat(
|
||||||
"yyyy-MM-dd HH:mm:ss");
|
"yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
/** Date format for shef information. */
|
/** Date format for shef information. */
|
||||||
private SimpleDateFormat shefDateFormat = new SimpleDateFormat("yyyyMMdd");
|
private final SimpleDateFormat shefDateFormat = new SimpleDateFormat(
|
||||||
|
"yyyyMMdd");
|
||||||
|
|
||||||
/** Time format for shef information. */
|
/** Time format for shef information. */
|
||||||
private SimpleDateFormat shefTimeFormat = new SimpleDateFormat("HHmm");
|
private final SimpleDateFormat shefTimeFormat = new SimpleDateFormat("HHmm");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date & Time label.
|
* Date & Time label.
|
||||||
|
@ -210,12 +214,12 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
/**
|
/**
|
||||||
* Beginning time.
|
* Beginning time.
|
||||||
*/
|
*/
|
||||||
private Date beginningTime;
|
private final Date beginningTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ending time.
|
* Ending time.
|
||||||
*/
|
*/
|
||||||
private Date endingTime;
|
private final Date endingTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List all forecasts check box.
|
* List all forecasts check box.
|
||||||
|
@ -394,7 +398,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
private String siteLabel = null;
|
private String siteLabel = null;
|
||||||
|
|
||||||
/** The list of data for the bottom data display list */
|
/** The list of data for the bottom data display list */
|
||||||
private ArrayList<String> modifiedTSList = new ArrayList<String>();
|
private final ArrayList<String> modifiedTSList = new ArrayList<String>();
|
||||||
|
|
||||||
/** The parent dialog */
|
/** The parent dialog */
|
||||||
private TimeSeriesDlg parentDialog = null;
|
private TimeSeriesDlg parentDialog = null;
|
||||||
|
@ -3067,6 +3071,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
oup.setNeedsWmoHeader(true);
|
oup.setNeedsWmoHeader(true);
|
||||||
oup.setFilename(SHEF_FILE_NAME + "." + getPid());
|
oup.setFilename(SHEF_FILE_NAME + "." + getPid());
|
||||||
oup.setProductText(text);
|
oup.setProductText(text);
|
||||||
|
req.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
req.setCheckBBB(true);
|
req.setCheckBBB(true);
|
||||||
req.setProduct(oup);
|
req.setProduct(oup);
|
||||||
|
|
|
@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.uf.common.site;bundle-version="1.0.0",
|
com.raytheon.uf.common.site;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||||
org.apache.commons.logging,
|
org.apache.commons.logging,
|
||||||
com.raytheon.uf.viz.localization
|
com.raytheon.uf.viz.localization,
|
||||||
|
com.raytheon.uf.common.auth;bundle-version="1.12.1174"
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.viz.texteditor,
|
Export-Package: com.raytheon.viz.texteditor,
|
||||||
com.raytheon.viz.texteditor.alarmalert.dialogs,
|
com.raytheon.viz.texteditor.alarmalert.dialogs,
|
||||||
|
|
|
@ -142,6 +142,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||||
import com.raytheon.uf.edex.services.textdbsrv.IQueryTransport;
|
import com.raytheon.uf.edex.services.textdbsrv.IQueryTransport;
|
||||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.notification.INotificationObserver;
|
import com.raytheon.uf.viz.core.notification.INotificationObserver;
|
||||||
import com.raytheon.uf.viz.core.notification.NotificationException;
|
import com.raytheon.uf.viz.core.notification.NotificationException;
|
||||||
|
@ -320,6 +321,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
|
||||||
* 31JAN2013 1563 rferrel Force location of airport tooltip.
|
* 31JAN2013 1563 rferrel Force location of airport tooltip.
|
||||||
* 31JAN2013 1568 rferrel Spell checker now tied to this dialog instead of parent.
|
* 31JAN2013 1568 rferrel Spell checker now tied to this dialog instead of parent.
|
||||||
* 26Apr2013 16123 snaples Removed setFocus to TextEditor in postExecute method.
|
* 26Apr2013 16123 snaples Removed setFocus to TextEditor in postExecute method.
|
||||||
|
* 07Jun2013 1981 mpduff Add user id to OUPRequest as it is now protected.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -4491,7 +4493,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
String tmpText = textEditor.getText();
|
String tmpText = textEditor.getText();
|
||||||
Point point = textEditor.getSelection();
|
Point point = textEditor.getSelection();
|
||||||
FontData fontData = textEditor.getFont().getFontData()[0];
|
FontData fontData = textEditor.getFont().getFontData()[0];
|
||||||
PrintDisplay.print(textEditor.getSelectionText(), fontData,
|
PrintDisplay.print(textEditor.getSelectionText(), fontData,
|
||||||
statusHandler);
|
statusHandler);
|
||||||
textEditor.setText(tmpText);
|
textEditor.setText(tmpText);
|
||||||
textEditor.setSelection(point);
|
textEditor.setSelection(point);
|
||||||
|
@ -4936,6 +4938,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
}
|
}
|
||||||
req.setCheckBBB(true);
|
req.setCheckBBB(true);
|
||||||
req.setProduct(oup);
|
req.setProduct(oup);
|
||||||
|
req.setUser(UserController.getUserObject());
|
||||||
|
|
||||||
// Code in Run statement goes here!
|
// Code in Run statement goes here!
|
||||||
new Thread(new ThriftClientRunnable(req)).start();
|
new Thread(new ThriftClientRunnable(req)).start();
|
||||||
|
@ -5522,29 +5525,27 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
int numberOfLinesOfHeaderText = 2;
|
int numberOfLinesOfHeaderText = 2;
|
||||||
int afosNnnLimit = 2; // first three characters is AFOS NNN
|
int afosNnnLimit = 2; // first three characters is AFOS NNN
|
||||||
int afosXxxLimit = 5; // second three characters is AFOS XXX
|
int afosXxxLimit = 5; // second three characters is AFOS XXX
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DR15610 - Make sure that if the first line of the
|
* DR15610 - Make sure that if the first line of the text product is not
|
||||||
* text product is not a WMO heading it is treated as
|
* a WMO heading it is treated as part of the text body.
|
||||||
* part of the text body.
|
|
||||||
*/
|
*/
|
||||||
String[] pieces = textEditor.getText().split("\r*\n", 2);
|
String[] pieces = textEditor.getText().split("\r*\n", 2);
|
||||||
if (pieces.length > 1) {
|
if (pieces.length > 1) {
|
||||||
pieces[0] += "\n"; // WMOHeader expects this
|
pieces[0] += "\n"; // WMOHeader expects this
|
||||||
}
|
}
|
||||||
WMOHeader header = new WMOHeader(pieces[0].getBytes(), null);
|
WMOHeader header = new WMOHeader(pieces[0].getBytes(), null);
|
||||||
if ( !header.isValid() ) {
|
if (!header.isValid()) {
|
||||||
headerTF.setText("");
|
headerTF.setText("");
|
||||||
try {
|
try {
|
||||||
textEditor.setText(originalText);
|
textEditor.setText(originalText);
|
||||||
textEditor.setEditable(true);
|
textEditor.setEditable(true);
|
||||||
textEditor.setEditable(false);
|
textEditor.setEditable(false);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// There is no text product body, so set it to the empty string.
|
// There is no text product body, so set it to the empty string.
|
||||||
textEditor.setText("");
|
textEditor.setText("");
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// TODO FIX PARSING
|
// TODO FIX PARSING
|
||||||
|
|
||||||
// First, set the current header by assuming that it usually
|
// First, set the current header by assuming that it usually
|
||||||
|
@ -5552,7 +5553,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
// though there will be exceptions to that "rule" as handled below.
|
// though there will be exceptions to that "rule" as handled below.
|
||||||
// So, obtain the AFOS NNNxxx. If it's where it is supposed to be
|
// So, obtain the AFOS NNNxxx. If it's where it is supposed to be
|
||||||
// in the new format, then the existing header is already an AWIPS
|
// in the new format, then the existing header is already an AWIPS
|
||||||
// text product identifier. Otherwise it is a legacy AFOS identifier.
|
// text product identifier. Otherwise it is a legacy AFOS
|
||||||
|
// identifier.
|
||||||
if (TextDisplayModel.getInstance().hasStdTextProduct(token)) {
|
if (TextDisplayModel.getInstance().hasStdTextProduct(token)) {
|
||||||
StdTextProduct textProd = TextDisplayModel.getInstance()
|
StdTextProduct textProd = TextDisplayModel.getInstance()
|
||||||
.getStdTextProduct(token);
|
.getStdTextProduct(token);
|
||||||
|
@ -5562,14 +5564,16 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
start = textEditor.getOffsetAtLine(thisLine + 1);
|
start = textEditor.getOffsetAtLine(thisLine + 1);
|
||||||
if ((textEditor.getText(start, start + afosNnnLimit)
|
if ((textEditor.getText(start, start + afosNnnLimit)
|
||||||
.equals(prodId.getNnnid()))
|
.equals(prodId.getNnnid()))
|
||||||
&& (textEditor.getText(start + afosNnnLimit + 1, start
|
&& (textEditor.getText(start + afosNnnLimit + 1,
|
||||||
+ afosXxxLimit).equals(prodId.getXxxid()))) {
|
start + afosXxxLimit).equals(prodId
|
||||||
|
.getXxxid()))) {
|
||||||
// Text matches the products nnnid and xxxid
|
// Text matches the products nnnid and xxxid
|
||||||
numberOfLinesOfHeaderText = 2;
|
numberOfLinesOfHeaderText = 2;
|
||||||
} else if (textEditor.getText(start, start + afosNnnLimit + 2)
|
} else if (textEditor.getText(start,
|
||||||
.equals(AFOSParser.DRAFT_PIL)
|
start + afosNnnLimit + 2).equals(
|
||||||
|| textEditor.getText(start, start + afosNnnLimit + 2)
|
AFOSParser.DRAFT_PIL)
|
||||||
.equals("TTAA0")) {
|
|| textEditor.getText(start,
|
||||||
|
start + afosNnnLimit + 2).equals("TTAA0")) {
|
||||||
// Text matches temporary WRKWG#
|
// Text matches temporary WRKWG#
|
||||||
numberOfLinesOfHeaderText = 2;
|
numberOfLinesOfHeaderText = 2;
|
||||||
} else {
|
} else {
|
||||||
|
@ -5592,7 +5596,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
finish = textEditor.getCharCount() - 1;
|
finish = textEditor.getCharCount() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the content of the header block to consist of just the header of
|
// Set the content of the header block to consist of just the header
|
||||||
|
// of
|
||||||
// the text product... it will get reunited with the body when it is
|
// the text product... it will get reunited with the body when it is
|
||||||
// saved.
|
// saved.
|
||||||
if (finish > start) {
|
if (finish > start) {
|
||||||
|
@ -5609,8 +5614,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
String line = null;
|
String line = null;
|
||||||
do {
|
do {
|
||||||
numberOfBlankLines++;
|
numberOfBlankLines++;
|
||||||
line = textEditor.getLine(thisLine + numberOfLinesOfHeaderText
|
line = textEditor.getLine(thisLine
|
||||||
+ numberOfBlankLines);
|
+ numberOfLinesOfHeaderText + numberOfBlankLines);
|
||||||
} while (line.length() == 0 || line.equals(""));
|
} while (line.length() == 0 || line.equals(""));
|
||||||
// Note: 'st' is a reference to 'textEditor'...
|
// Note: 'st' is a reference to 'textEditor'...
|
||||||
// delelete the header from the text in 'textEditor'
|
// delelete the header from the text in 'textEditor'
|
||||||
|
@ -5915,7 +5920,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
if ("MTR".equals(stdProdId.getNnnid())
|
if ("MTR".equals(stdProdId.getNnnid())
|
||||||
&& (commandText.startsWith("ALL:")
|
&& (commandText.startsWith("ALL:")
|
||||||
|| commandText.startsWith("A:") || commandText
|
|| commandText.startsWith("A:") || commandText
|
||||||
.endsWith("000"))) {
|
.endsWith("000"))) {
|
||||||
stripWMOHeaders(prod);
|
stripWMOHeaders(prod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7008,7 +7013,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
|| line.endsWith("ADVISORY")
|
|| line.endsWith("ADVISORY")
|
||||||
|| line.endsWith("ADVISORY...TEST")
|
|| line.endsWith("ADVISORY...TEST")
|
||||||
|| line.endsWith("ADVISORY...CORRECTED") || line
|
|| line.endsWith("ADVISORY...CORRECTED") || line
|
||||||
.endsWith("ADVISORY...CORRECTED...TEST"))) {
|
.endsWith("ADVISORY...CORRECTED...TEST"))) {
|
||||||
line += "...RESENT";
|
line += "...RESENT";
|
||||||
updatedMND = true;
|
updatedMND = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,4 +8,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||||
Import-Package: com.raytheon.uf.common.serialization.comm
|
Import-Package: com.raytheon.uf.common.serialization.comm
|
||||||
Export-Package: com.raytheon.uf.common.dissemination
|
Export-Package: com.raytheon.uf.common.dissemination
|
||||||
Require-Bundle: com.raytheon.uf.common.serialization;bundle-version="1.11.17"
|
Require-Bundle: com.raytheon.uf.common.serialization;bundle-version="1.11.17",
|
||||||
|
com.raytheon.uf.common.auth;bundle-version="1.12.1174"
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.dissemination;
|
package com.raytheon.uf.common.dissemination;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
|
||||||
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||||
|
@ -32,6 +34,7 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 29, 2009 njensen Initial creation
|
* Oct 29, 2009 njensen Initial creation
|
||||||
|
* Jun 07, 2013 1981 mpduff This is now a privileged request.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -39,7 +42,10 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
@DynamicSerialize
|
@DynamicSerialize
|
||||||
public class OUPRequest implements IServerRequest {
|
public class OUPRequest extends AbstractPrivilegedRequest implements
|
||||||
|
IServerRequest {
|
||||||
|
/** Edex origination constant */
|
||||||
|
public static transient final String EDEX_ORIGINATION = "edex_origination";
|
||||||
|
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private OfficialUserProduct product;
|
private OfficialUserProduct product;
|
||||||
|
@ -47,6 +53,20 @@ public class OUPRequest implements IServerRequest {
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private boolean checkBBB = false;
|
private boolean checkBBB = false;
|
||||||
|
|
||||||
|
/** User object */
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private IUser user;
|
||||||
|
|
||||||
|
/** A not authorized message */
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private String NotAuthorizedMessage = "Not Authorized to Send Official User Products";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OUP Request permission. This should not be changed.
|
||||||
|
*/
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private String roleId = "awips.oup";
|
||||||
|
|
||||||
public OfficialUserProduct getProduct() {
|
public OfficialUserProduct getProduct() {
|
||||||
return product;
|
return product;
|
||||||
}
|
}
|
||||||
|
@ -63,4 +83,50 @@ public class OUPRequest implements IServerRequest {
|
||||||
this.checkBBB = checkBBB;
|
this.checkBBB = checkBBB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the user
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IUser getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param user
|
||||||
|
* the user to set
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setUser(IUser user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the roleId
|
||||||
|
*/
|
||||||
|
public String getRoleId() {
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param roleId
|
||||||
|
* the roleId to set
|
||||||
|
*/
|
||||||
|
public void setRoleId(String roleId) {
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the notAuthorizedMessage
|
||||||
|
*/
|
||||||
|
public String getNotAuthorizedMessage() {
|
||||||
|
return NotAuthorizedMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param notAuthorizedMessage
|
||||||
|
* the notAuthorizedMessage to set
|
||||||
|
*/
|
||||||
|
public void setNotAuthorizedMessage(String notAuthorizedMessage) {
|
||||||
|
NotAuthorizedMessage = notAuthorizedMessage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<nwsRoleData xmlns:ns2="group">
|
||||||
|
<!-- AWIPS 2 User Admin Roles/Permissions file -->
|
||||||
|
<application>Official User Product</application>
|
||||||
|
<permission id="awips.oup">
|
||||||
|
<description>
|
||||||
|
This permission allows the user to send Official User Products
|
||||||
|
</description>
|
||||||
|
</permission>
|
||||||
|
<user userId="ALL">
|
||||||
|
<userPermission>awips.oup</userPermission>
|
||||||
|
</user>
|
||||||
|
</nwsRoleData>
|
|
@ -9,7 +9,8 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||||
javax.persistence;bundle-version="1.0.0",
|
javax.persistence;bundle-version="1.0.0",
|
||||||
org.apache.commons.lang;bundle-version="2.3.0",
|
org.apache.commons.lang;bundle-version="2.3.0",
|
||||||
com.raytheon.uf.common.status;bundle-version="1.12.1174"
|
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.common.auth;bundle-version="1.12.1174"
|
||||||
Export-Package: com.raytheon.uf.common.tafqueue
|
Export-Package: com.raytheon.uf.common.tafqueue
|
||||||
Import-Package: com.raytheon.uf.common.localization,
|
Import-Package: com.raytheon.uf.common.localization,
|
||||||
org.apache.commons.configuration
|
org.apache.commons.configuration
|
||||||
|
|
|
@ -22,6 +22,8 @@ package com.raytheon.uf.common.tafqueue;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
|
||||||
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||||
|
@ -35,7 +37,8 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 3, 2012 14715 rferrel Initial creation
|
* May 3, 2012 14715 rferrel Initial creation
|
||||||
|
* Jun 07, 2013 1981 mpduff This is now an AbstractPrivilegedRequest
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -43,7 +46,8 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
@DynamicSerialize
|
@DynamicSerialize
|
||||||
public class TafQueueRequest implements IServerRequest {
|
public class TafQueueRequest extends AbstractPrivilegedRequest implements
|
||||||
|
IServerRequest {
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
UNKNOWN, CREATE, GET_LIST, GET_LOG, GET_TAFS, REMOVE_SELECTED, RETRANSMIT
|
UNKNOWN, CREATE, GET_LIST, GET_LOG, GET_TAFS, REMOVE_SELECTED, RETRANSMIT
|
||||||
|
@ -64,6 +68,20 @@ public class TafQueueRequest implements IServerRequest {
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private Date xmitTime;
|
private Date xmitTime;
|
||||||
|
|
||||||
|
/** User object */
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private IUser user;
|
||||||
|
|
||||||
|
/** A not authorized message */
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private final String NotAuthorizedMessage = "Not Authorized to Send Official User Products";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OUP Request permission. This should not be changed.
|
||||||
|
*/
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private final String roleId = "awips.oup";
|
||||||
|
|
||||||
public TafQueueRequest() {
|
public TafQueueRequest() {
|
||||||
this.type = Type.UNKNOWN;
|
this.type = Type.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
@ -107,4 +125,35 @@ public class TafQueueRequest implements IServerRequest {
|
||||||
public void setXmitTime(Date xmitTime) {
|
public void setXmitTime(Date xmitTime) {
|
||||||
this.xmitTime = xmitTime;
|
this.xmitTime = xmitTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the user
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IUser getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param user
|
||||||
|
* the user to set
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setUser(IUser user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the notAuthorizedMessage
|
||||||
|
*/
|
||||||
|
public String getNotAuthorizedMessage() {
|
||||||
|
return NotAuthorizedMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the roleId
|
||||||
|
*/
|
||||||
|
public String getRoleId() {
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,6 @@ Require-Bundle: org.jep;bundle-version="1.0.0",
|
||||||
com.raytheon.edex.plugin.text,
|
com.raytheon.edex.plugin.text,
|
||||||
com.raytheon.uf.common.site;bundle-version="1.12.1174",
|
com.raytheon.uf.common.site;bundle-version="1.12.1174",
|
||||||
org.springframework;bundle-version="2.5.6",
|
org.springframework;bundle-version="2.5.6",
|
||||||
com.raytheon.uf.edex.database
|
com.raytheon.uf.edex.database,
|
||||||
|
com.raytheon.uf.common.auth;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.edex.auth;bundle-version="1.12.1174"
|
||||||
|
|
|
@ -25,6 +25,8 @@ import java.util.Map;
|
||||||
|
|
||||||
import jep.JepException;
|
import jep.JepException;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.exception.AuthorizationException;
|
||||||
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.dissemination.OUPRequest;
|
import com.raytheon.uf.common.dissemination.OUPRequest;
|
||||||
import com.raytheon.uf.common.dissemination.OUPResponse;
|
import com.raytheon.uf.common.dissemination.OUPResponse;
|
||||||
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
|
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
|
||||||
|
@ -35,12 +37,15 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.python.PyUtil;
|
import com.raytheon.uf.common.python.PyUtil;
|
||||||
import com.raytheon.uf.common.python.PythonScript;
|
import com.raytheon.uf.common.python.PythonScript;
|
||||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
import com.raytheon.uf.edex.auth.AuthManager;
|
||||||
|
import com.raytheon.uf.edex.auth.AuthManagerFactory;
|
||||||
|
import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler;
|
||||||
|
import com.raytheon.uf.edex.auth.resp.AuthorizationResponse;
|
||||||
|
import com.raytheon.uf.edex.auth.roles.IRoleStorage;
|
||||||
import com.raytheon.uf.edex.dissemination.transmitted.TransProdHeader;
|
import com.raytheon.uf.edex.dissemination.transmitted.TransProdHeader;
|
||||||
import com.raytheon.uf.edex.dissemination.transmitted.TransmittedProductList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IRequestHandler for OUPRequests
|
* IRequestHandler for OUPRequests
|
||||||
|
@ -52,6 +57,7 @@ import com.raytheon.uf.edex.dissemination.transmitted.TransmittedProductList;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 22, 2009 njensen Initial creation
|
* Oct 22, 2009 njensen Initial creation
|
||||||
* Oct 12, 2012 DR 15418 D. Friedman Use clustered TransmittedProductList
|
* Oct 12, 2012 DR 15418 D. Friedman Use clustered TransmittedProductList
|
||||||
|
* Jun 07, 2013 1981 mpduff This is now a priviledged request handler.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -59,10 +65,13 @@ import com.raytheon.uf.edex.dissemination.transmitted.TransmittedProductList;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class OUPHandler implements IRequestHandler<OUPRequest> {
|
public class OUPHandler extends AbstractPrivilegedRequestHandler<OUPRequest> {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(OUPHandler.class);
|
.getHandler(OUPHandler.class);
|
||||||
|
|
||||||
|
/** The application for authentication */
|
||||||
|
private static final String APPLICATION = "Official User Product";
|
||||||
|
|
||||||
private OUPAckManager ackManager;
|
private OUPAckManager ackManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -98,7 +107,7 @@ public class OUPHandler implements IRequestHandler<OUPRequest> {
|
||||||
resp.setAttempted(true);
|
resp.setAttempted(true);
|
||||||
py.execute("process", args);
|
py.execute("process", args);
|
||||||
} catch (JepException e) {
|
} catch (JepException e) {
|
||||||
resp.setMessage("Error executing handleOUP python");
|
resp.setMessage("Error executing handleOUP python");
|
||||||
statusHandler.handle(Priority.SIGNIFICANT,
|
statusHandler.handle(Priority.SIGNIFICANT,
|
||||||
"Error executing handleOUP python", e);
|
"Error executing handleOUP python", e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -106,8 +115,9 @@ public class OUPHandler implements IRequestHandler<OUPRequest> {
|
||||||
py.dispose();
|
py.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* TODO: Should be updating TransmittedProductList here, after
|
/*
|
||||||
* success has been confirmed.
|
* TODO: Should be updating TransmittedProductList here, after
|
||||||
|
* success has been confirmed.
|
||||||
*/
|
*/
|
||||||
} catch (OUPHeaderException e) {
|
} catch (OUPHeaderException e) {
|
||||||
resp.setAttempted(false);
|
resp.setAttempted(false);
|
||||||
|
@ -160,12 +170,38 @@ public class OUPHandler implements IRequestHandler<OUPRequest> {
|
||||||
return python;
|
return python;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OUPAckManager getAckManager() {
|
public OUPAckManager getAckManager() {
|
||||||
return ackManager;
|
return ackManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAckManager(OUPAckManager ackManager) {
|
public void setAckManager(OUPAckManager ackManager) {
|
||||||
this.ackManager = ackManager;
|
this.ackManager = ackManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AuthorizationResponse authorized(IUser user, OUPRequest request)
|
||||||
|
throws AuthorizationException {
|
||||||
|
boolean authorized = false;
|
||||||
|
|
||||||
|
if (request.getUser().uniqueId().toString()
|
||||||
|
.equals(OUPRequest.EDEX_ORIGINATION)) {
|
||||||
|
authorized = true;
|
||||||
|
} else {
|
||||||
|
AuthManager manager = AuthManagerFactory.getInstance().getManager();
|
||||||
|
IRoleStorage roleStorage = manager.getRoleStorage();
|
||||||
|
|
||||||
|
authorized = roleStorage.isAuthorized((request).getRoleId(), user
|
||||||
|
.uniqueId().toString(), APPLICATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authorized) {
|
||||||
|
return new AuthorizationResponse(authorized);
|
||||||
|
} else {
|
||||||
|
return new AuthorizationResponse(
|
||||||
|
(request).getNotAuthorizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,10 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||||
javax.persistence;bundle-version="1.0.0",
|
javax.persistence;bundle-version="1.0.0",
|
||||||
org.apache.commons.lang;bundle-version="2.3.0"
|
org.apache.commons.lang;bundle-version="2.3.0",
|
||||||
|
com.raytheon.uf.common.auth;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.edex.auth;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.common.plugin.nwsauth;bundle-version="1.12.1174"
|
||||||
Import-Package: com.raytheon.uf.common.localization,
|
Import-Package: com.raytheon.uf.common.localization,
|
||||||
org.apache.commons.configuration
|
org.apache.commons.configuration
|
||||||
Export-Package: com.raytheon.uf.edex.tafqueue
|
Export-Package: com.raytheon.uf.edex.tafqueue
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.raytheon.uf.common.dataplugin.PluginException;
|
||||||
import com.raytheon.uf.common.dissemination.OUPRequest;
|
import com.raytheon.uf.common.dissemination.OUPRequest;
|
||||||
import com.raytheon.uf.common.dissemination.OUPResponse;
|
import com.raytheon.uf.common.dissemination.OUPResponse;
|
||||||
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
|
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
|
||||||
|
import com.raytheon.uf.common.plugin.nwsauth.user.User;
|
||||||
import com.raytheon.uf.common.serialization.comm.RequestRouter;
|
import com.raytheon.uf.common.serialization.comm.RequestRouter;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
@ -49,6 +50,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 10, 2012 14715 rferrel Initial creation
|
* May 10, 2012 14715 rferrel Initial creation
|
||||||
* Mar 21, 2013 15375 zhao Modified to also handle AvnFPS VFT product
|
* Mar 21, 2013 15375 zhao Modified to also handle AvnFPS VFT product
|
||||||
|
* Jun 07, 2013 1981 mpduff Add user to OUPRequest.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -183,6 +185,7 @@ public class TafQueueManager implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
OUPRequest req = new OUPRequest();
|
OUPRequest req = new OUPRequest();
|
||||||
|
req.setUser(new User(OUPRequest.EDEX_ORIGINATION));
|
||||||
req.setProduct(oup);
|
req.setProduct(oup);
|
||||||
OUPResponse resp;
|
OUPResponse resp;
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
@ -241,16 +244,16 @@ public class TafQueueManager implements Runnable {
|
||||||
cal.set(Calendar.MINUTE, 0);
|
cal.set(Calendar.MINUTE, 0);
|
||||||
cal.set(Calendar.SECOND, 0);
|
cal.set(Calendar.SECOND, 0);
|
||||||
Date nextPurgeTime = cal.getTime();
|
Date nextPurgeTime = cal.getTime();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (for DR15375)
|
* (for DR15375)
|
||||||
*/
|
*/
|
||||||
TafQueueVFTMgr vftMgr = TafQueueVFTMgr.getInstance();
|
TafQueueVFTMgr vftMgr = TafQueueVFTMgr.getInstance();
|
||||||
Date nextVftTime = null;
|
Date nextVftTime = null;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
processList = dao.getRecordsToSend();
|
processList = dao.getRecordsToSend();
|
||||||
|
|
||||||
if (processList.size() > 0) {
|
if (processList.size() > 0) {
|
||||||
|
@ -258,15 +261,15 @@ public class TafQueueManager implements Runnable {
|
||||||
// more PENDING may have been added while sending
|
// more PENDING may have been added while sending
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (for DR15375)
|
* (for DR15375)
|
||||||
*/
|
*/
|
||||||
nextVftTime = vftMgr.getNextVftTime();
|
nextVftTime = vftMgr.getNextVftTime();
|
||||||
if ( nextVftTime.compareTo(Calendar.getInstance().getTime()) <= 0 ) {
|
if (nextVftTime.compareTo(Calendar.getInstance().getTime()) <= 0) {
|
||||||
vftMgr.makeVftProduct();
|
vftMgr.makeVftProduct();
|
||||||
// transmit immediately
|
// transmit immediately
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextPurgeTime.compareTo(Calendar.getInstance().getTime()) <= 0) {
|
if (nextPurgeTime.compareTo(Calendar.getInstance().getTime()) <= 0) {
|
||||||
|
@ -284,17 +287,18 @@ public class TafQueueManager implements Runnable {
|
||||||
nextProccessTime = nextPurgeTime;
|
nextProccessTime = nextPurgeTime;
|
||||||
} else if (nextProccessTime.compareTo(nextPurgeTime) > 0) {
|
} else if (nextProccessTime.compareTo(nextPurgeTime) > 0) {
|
||||||
nextProccessTime = nextPurgeTime;
|
nextProccessTime = nextPurgeTime;
|
||||||
} else if (nextProccessTime.compareTo(Calendar.getInstance().getTime()) <= 0) {
|
} else if (nextProccessTime.compareTo(Calendar.getInstance()
|
||||||
|
.getTime()) <= 0) {
|
||||||
// immediate transmit placed on queue while processing.
|
// immediate transmit placed on queue while processing.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (DR15375)
|
* (DR15375)
|
||||||
*/
|
*/
|
||||||
nextVftTime = vftMgr.getNextVftTime();
|
nextVftTime = vftMgr.getNextVftTime();
|
||||||
if ( nextVftTime.compareTo(nextProccessTime) < 0 ) {
|
if (nextVftTime.compareTo(nextProccessTime) < 0) {
|
||||||
nextProccessTime = nextVftTime;
|
nextProccessTime = nextVftTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
|
|
@ -23,14 +23,20 @@ import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.exception.AuthorizationException;
|
||||||
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.serialization.SerializationException;
|
import com.raytheon.uf.common.serialization.SerializationException;
|
||||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
|
||||||
import com.raytheon.uf.common.tafqueue.ServerResponse;
|
import com.raytheon.uf.common.tafqueue.ServerResponse;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRecord;
|
import com.raytheon.uf.common.tafqueue.TafQueueRecord;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRecord.TafQueueState;
|
import com.raytheon.uf.common.tafqueue.TafQueueRecord.TafQueueState;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
||||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
||||||
|
import com.raytheon.uf.edex.auth.AuthManager;
|
||||||
|
import com.raytheon.uf.edex.auth.AuthManagerFactory;
|
||||||
|
import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler;
|
||||||
|
import com.raytheon.uf.edex.auth.resp.AuthorizationResponse;
|
||||||
|
import com.raytheon.uf.edex.auth.roles.IRoleStorage;
|
||||||
import com.raytheon.uf.edex.core.EDEXUtil;
|
import com.raytheon.uf.edex.core.EDEXUtil;
|
||||||
import com.raytheon.uf.edex.core.EdexException;
|
import com.raytheon.uf.edex.core.EdexException;
|
||||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||||
|
@ -46,12 +52,16 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 1, 2012 14715 rferrel Initial creation
|
* May 1, 2012 14715 rferrel Initial creation
|
||||||
* May 08, 2013 1814 rjpeter Added time to live to topic
|
* May 08, 2013 1814 rjpeter Added time to live to topic
|
||||||
|
* Jun 07, 2013 1981 mpduff TafQueueRequest is now protected.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rferrel
|
* @author rferrel
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class TafQueueRequestHandler implements IRequestHandler<TafQueueRequest> {
|
public class TafQueueRequestHandler extends
|
||||||
|
AbstractPrivilegedRequestHandler<TafQueueRequest> {
|
||||||
|
/** The application for authentication */
|
||||||
|
private static final String APPLICATION = "Official User Product";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -194,4 +204,24 @@ public class TafQueueRequestHandler implements IRequestHandler<TafQueueRequest>
|
||||||
EDEXUtil.getMessageProducer().sendAsyncUri(
|
EDEXUtil.getMessageProducer().sendAsyncUri(
|
||||||
"jms-generic:topic:tafQueueChanged?timeToLive=60000", message);
|
"jms-generic:topic:tafQueueChanged?timeToLive=60000", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AuthorizationResponse authorized(IUser user, TafQueueRequest request)
|
||||||
|
throws AuthorizationException {
|
||||||
|
AuthManager manager = AuthManagerFactory.getInstance().getManager();
|
||||||
|
IRoleStorage roleStorage = manager.getRoleStorage();
|
||||||
|
|
||||||
|
boolean authorized = roleStorage.isAuthorized((request).getRoleId(),
|
||||||
|
user.uniqueId().toString(), APPLICATION);
|
||||||
|
|
||||||
|
if (authorized) {
|
||||||
|
return new AuthorizationResponse(authorized);
|
||||||
|
} else {
|
||||||
|
return new AuthorizationResponse(
|
||||||
|
(request).getNotAuthorizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,11 @@ public class TestUserManagerLoader implements IUserManagerLoader {
|
||||||
public List<IRole> getRoles(String application) {
|
public List<IRole> getRoles(String application) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUserObject(String userId, IAuthenticationData authData) {
|
||||||
|
// Currently unused
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final TestUserManager USER_MANAGER = new TestUserManager();
|
private static final TestUserManager USER_MANAGER = new TestUserManager();
|
||||||
|
|
Loading…
Add table
Reference in a new issue