Issue #2870 log product id when generic packet fails to find

corresponding packet class

Change-Id: I839e622b063eae4e707f9abc31f010ef795bc9f1

Former-commit-id: 0d01b387e454f276d0ebdecfb14ad294b67a55b7
This commit is contained in:
Nate Jensen 2014-03-04 11:52:34 -06:00
parent cbf8b9249c
commit 6818ea9c23

View file

@ -31,7 +31,8 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
/** /**
* TODO Add Description * A factory for creating packets based on the packet ID. In the case of generic
* packets, it further uses the product ID to determine the packet to create.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
@ -39,6 +40,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 03/04/2013 DCS51 zwang Handle GFM product * 03/04/2013 DCS51 zwang Handle GFM product
* 07/29/2013 2148 mnash Refactor registering of packets to Spring * 07/29/2013 2148 mnash Refactor registering of packets to Spring
* 03/04/2014 2870 njensen Log product ID when no class found for generic packet
* *
* </pre> * </pre>
* *
@ -47,6 +49,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
*/ */
public class PacketFactory { public class PacketFactory {
/** The logger */ /** The logger */
private static final IUFStatusHandler handler = UFStatus private static final IUFStatusHandler handler = UFStatus
.getHandler(PacketFactory.class); .getHandler(PacketFactory.class);
@ -96,6 +99,12 @@ public class PacketFactory {
if (packetClass != null && packetClass.equals(GenericDataPacket.class)) { if (packetClass != null && packetClass.equals(GenericDataPacket.class)) {
int productId = GenericUtil.getProductID(in); int productId = GenericUtil.getProductID(in);
packetClass = genericClassMap.get(productId); packetClass = genericClassMap.get(productId);
if (packetClass == null) {
handler.handle(Priority.ERROR,
"No class registered for generic packet ID: "
+ packetId + " with product ID: " + productId);
return packet;
}
} }
if (packetClass != null) { if (packetClass != null) {