Issue #176 remove id from dataURI notifications

Change-Id: I418de45a0daf13c9656161cc4ef67b755052ea58

Former-commit-id: 2995d2b29b [formerly 100b4c4ba0 [formerly 32b8f723ebf64d97636705911c0b7b22a9cd2148]]
Former-commit-id: 100b4c4ba0
Former-commit-id: e2141b574e
This commit is contained in:
Ben Steffensmeier 2012-02-14 12:59:42 -06:00
parent b95dd7bc43
commit 0c8da60976
8 changed files with 47 additions and 269 deletions

View file

@ -42,9 +42,6 @@ public class DataURINotificationMessage implements ISerializableObject {
@DynamicSerializeElement
private String[] dataURIs;
@DynamicSerializeElement
private int[] ids;
/**
* @return the dataURIs
*/
@ -52,18 +49,6 @@ public class DataURINotificationMessage implements ISerializableObject {
return dataURIs;
}
public int[] getIds() {
return ids;
}
/**
* @param ids
* The ids to set
*/
public void setIds(int[] ids) {
this.ids = ids;
}
/**
* @param dataURIs
* the dataURIs to set

View file

@ -42,9 +42,6 @@ public class PracticeDataURINotificationMessage implements ISerializableObject {
@DynamicSerializeElement
private String[] dataURIs;
@DynamicSerializeElement
private int[] ids;
/**
* @return the dataURIs
*/
@ -52,18 +49,6 @@ public class PracticeDataURINotificationMessage implements ISerializableObject {
return dataURIs;
}
public int[] getIds() {
return ids;
}
/**
* @param ids
* The ids to set
*/
public void setIds(int[] ids) {
this.ids = ids;
}
/**
* @param dataURIs
* the dataURIs to set

View file

@ -44,8 +44,6 @@ public class DataUriAggregator {
private List<String> dataUris = new ArrayList<String>();
private List<Integer> ids = new ArrayList<Integer>();
/**
* Add data uris to the queue
*
@ -55,11 +53,7 @@ public class DataUriAggregator {
synchronized (this) {
for (String uri : uris) {
if (uri != null) {
int idx = uri.lastIndexOf('/');
Integer id = Integer.valueOf(uri.substring(idx + 1));
uri = uri.substring(0, idx);
dataUris.add(uri);
ids.add(id);
}
}
}
@ -73,7 +67,7 @@ public class DataUriAggregator {
*/
public boolean hasUris(Object obj) {
synchronized (this) {
return dataUris.size() > 0 || ids.size() > 0;
return dataUris.size() > 0;
}
}
@ -85,16 +79,9 @@ public class DataUriAggregator {
public DataURINotificationMessage sendQueuedUris() {
synchronized (this) {
String[] uris = dataUris.toArray(new String[dataUris.size()]);
int[] ids = new int[this.ids.size()];
int idx = 0;
for (Integer i : this.ids) {
ids[idx++] = i.intValue();
}
dataUris.clear();
this.ids.clear();
DataURINotificationMessage msg = new DataURINotificationMessage();
msg.setDataURIs(uris);
msg.setIds(ids);
return msg;
}
}
@ -107,16 +94,9 @@ public class DataUriAggregator {
public PracticeDataURINotificationMessage sendPracticeQueuedUris() {
synchronized (this) {
String[] uris = dataUris.toArray(new String[dataUris.size()]);
int[] ids = new int[this.ids.size()];
int idx = 0;
for (Integer i : this.ids) {
ids[idx++] = i.intValue();
}
dataUris.clear();
this.ids.clear();
PracticeDataURINotificationMessage msg = new PracticeDataURINotificationMessage();
msg.setDataURIs(uris);
msg.setIds(ids);
return msg;
}
}

View file

@ -42,13 +42,13 @@ public class ToDataURI {
public String[] toDataURI(PluginDataObject[] pdo) {
String[] strs = new String[pdo.length];
for (int i = 0; i < strs.length; i++) {
strs[i] = pdo[i].getDataURI() + '/' + pdo[i].getId();
strs[i] = pdo[i].getDataURI();
}
return strs;
}
public String toDataURI(PluginDataObject pdo) {
return pdo.getDataURI() + '/' + pdo.getId();
return pdo.getDataURI();
}
}

View file

@ -1,44 +1,8 @@
/*****************************************************************************************
* COPYRIGHT (c), 2009, RAYTHEON COMPANY
* ALL RIGHTS RESERVED, An Unpublished Work
*
* RAYTHEON PROPRIETARY
* If the end user is not the U.S. Government or any agency thereof, use
* or disclosure of data contained in this source code file is subject to
* the proprietary restrictions set forth in the Master Rights File.
*
* U.S. GOVERNMENT PURPOSE RIGHTS NOTICE
* If the end user is the U.S. Government or any agency thereof, this source
* code is provided to the U.S. Government with Government Purpose Rights.
* Use or disclosure of data contained in this source code file is subject to
* the "Government Purpose Rights" restriction in the Master Rights File.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* Use or disclosure of data contained in this source code file is subject to
* the export restrictions set forth in the Master Rights File.
******************************************************************************************/
/*
* Auto-generated code to handle the thrift messages.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/9/09 3375 brockwoo Initial Creation
*
* </pre>
*
* @author brockwoo
* @version 1
*/
/**
* Autogenerated by Thrift
* Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "Notification_constants.h"

View file

@ -1,44 +1,8 @@
/*****************************************************************************************
* COPYRIGHT (c), 2009, RAYTHEON COMPANY
* ALL RIGHTS RESERVED, An Unpublished Work
*
* RAYTHEON PROPRIETARY
* If the end user is not the U.S. Government or any agency thereof, use
* or disclosure of data contained in this source code file is subject to
* the proprietary restrictions set forth in the Master Rights File.
*
* U.S. GOVERNMENT PURPOSE RIGHTS NOTICE
* If the end user is the U.S. Government or any agency thereof, this source
* code is provided to the U.S. Government with Government Purpose Rights.
* Use or disclosure of data contained in this source code file is subject to
* the "Government Purpose Rights" restriction in the Master Rights File.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* Use or disclosure of data contained in this source code file is subject to
* the export restrictions set forth in the Master Rights File.
******************************************************************************************/
/*
* Auto-generated code to handle the thrift messages.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/9/09 3375 brockwoo Initial Creation
*
* </pre>
*
* @author brockwoo
* @version 1
*/
/**
* Autogenerated by Thrift
* Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#ifndef Notification_CONSTANTS_H
#define Notification_CONSTANTS_H

View file

@ -1,78 +1,42 @@
/*****************************************************************************************
* COPYRIGHT (c), 2009, RAYTHEON COMPANY
* ALL RIGHTS RESERVED, An Unpublished Work
*
* RAYTHEON PROPRIETARY
* If the end user is not the U.S. Government or any agency thereof, use
* or disclosure of data contained in this source code file is subject to
* the proprietary restrictions set forth in the Master Rights File.
*
* U.S. GOVERNMENT PURPOSE RIGHTS NOTICE
* If the end user is the U.S. Government or any agency thereof, this source
* code is provided to the U.S. Government with Government Purpose Rights.
* Use or disclosure of data contained in this source code file is subject to
* the "Government Purpose Rights" restriction in the Master Rights File.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* Use or disclosure of data contained in this source code file is subject to
* the export restrictions set forth in the Master Rights File.
******************************************************************************************/
/*
* Auto-generated code to handle the thrift messages.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/9/09 3375 brockwoo Initial Creation
*
* </pre>
*
* @author brockwoo
* @version 1
*/
/**
* Autogenerated by Thrift
* Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "Notification_types.h"
const char* DataURINotificationMessage::ascii_fingerprint = "544A7C2D0FBAA52B283383658874CC1E";
const uint8_t DataURINotificationMessage::binary_fingerprint[16] = {0x54,0x4A,0x7C,0x2D,0x0F,0xBA,0xA5,0x2B,0x28,0x33,0x83,0x65,0x88,0x74,0xCC,0x1E};
const char* com_raytheon_edex_msg_DataURINotificationMessage::ascii_fingerprint = "ACE4F644F0FDD289DDC4EE5B83BC13C0";
const uint8_t com_raytheon_edex_msg_DataURINotificationMessage::binary_fingerprint[16] = {0xAC,0xE4,0xF6,0x44,0xF0,0xFD,0xD2,0x89,0xDD,0xC4,0xEE,0x5B,0x83,0xBC,0x13,0xC0};
uint32_t DataURINotificationMessage::read(apache::thrift::protocol::TProtocol* iprot) {
uint32_t com_raytheon_edex_msg_DataURINotificationMessage::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
apache::thrift::protocol::TType ftype;
::apache::thrift::protocol::TType ftype;
int16_t fid;
xfer += iprot->readStructBegin(fname);
using apache::thrift::protocol::TProtocolException;
using ::apache::thrift::protocol::TProtocolException;
while (true)
{
xfer += iprot->readFieldBegin(fname, ftype, fid);
if (ftype == apache::thrift::protocol::T_STOP) {
if (ftype == ::apache::thrift::protocol::T_STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == apache::thrift::protocol::T_LIST) {
if (ftype == ::apache::thrift::protocol::T_LIST) {
{
this->dataURIs.clear();
uint32_t _size0;
apache::thrift::protocol::TType _etype3;
::apache::thrift::protocol::TType _etype3;
iprot->readListBegin(_etype3, _size0);
this->dataURIs.resize(_size0);
uint32_t _i4;
@ -87,26 +51,6 @@ uint32_t DataURINotificationMessage::read(apache::thrift::protocol::TProtocol* i
xfer += iprot->skip(ftype);
}
break;
case 2:
if (ftype == apache::thrift::protocol::T_LIST) {
{
this->ids.clear();
uint32_t _size5;
apache::thrift::protocol::TType _etype8;
iprot->readListBegin(_etype8, _size5);
this->ids.resize(_size5);
uint32_t _i9;
for (_i9 = 0; _i9 < _size5; ++_i9)
{
xfer += iprot->readI32(this->ids[_i9]);
}
iprot->readListEnd();
}
this->__isset.ids = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
@ -119,27 +63,16 @@ uint32_t DataURINotificationMessage::read(apache::thrift::protocol::TProtocol* i
return xfer;
}
uint32_t DataURINotificationMessage::write(apache::thrift::protocol::TProtocol* oprot) const {
uint32_t com_raytheon_edex_msg_DataURINotificationMessage::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
xfer += oprot->writeStructBegin("DataURINotificationMessage");
xfer += oprot->writeFieldBegin("dataURIs", apache::thrift::protocol::T_LIST, 1);
xfer += oprot->writeStructBegin("com_raytheon_edex_msg_DataURINotificationMessage");
xfer += oprot->writeFieldBegin("dataURIs", ::apache::thrift::protocol::T_LIST, 1);
{
xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->dataURIs.size());
std::vector<std::string> ::const_iterator _iter10;
for (_iter10 = this->dataURIs.begin(); _iter10 != this->dataURIs.end(); ++_iter10)
xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->dataURIs.size()));
std::vector<std::string> ::const_iterator _iter5;
for (_iter5 = this->dataURIs.begin(); _iter5 != this->dataURIs.end(); ++_iter5)
{
xfer += oprot->writeString((*_iter10));
}
xfer += oprot->writeListEnd();
}
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("ids", apache::thrift::protocol::T_LIST, 2);
{
xfer += oprot->writeListBegin(apache::thrift::protocol::T_I32, this->ids.size());
std::vector<int32_t> ::const_iterator _iter11;
for (_iter11 = this->ids.begin(); _iter11 != this->ids.end(); ++_iter11)
{
xfer += oprot->writeI32((*_iter11));
xfer += oprot->writeString((*_iter5));
}
xfer += oprot->writeListEnd();
}

View file

@ -1,49 +1,14 @@
/*****************************************************************************************
* COPYRIGHT (c), 2009, RAYTHEON COMPANY
* ALL RIGHTS RESERVED, An Unpublished Work
*
* RAYTHEON PROPRIETARY
* If the end user is not the U.S. Government or any agency thereof, use
* or disclosure of data contained in this source code file is subject to
* the proprietary restrictions set forth in the Master Rights File.
*
* U.S. GOVERNMENT PURPOSE RIGHTS NOTICE
* If the end user is the U.S. Government or any agency thereof, this source
* code is provided to the U.S. Government with Government Purpose Rights.
* Use or disclosure of data contained in this source code file is subject to
* the "Government Purpose Rights" restriction in the Master Rights File.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* Use or disclosure of data contained in this source code file is subject to
* the export restrictions set forth in the Master Rights File.
******************************************************************************************/
/*
* Auto-generated code to handle the thrift messages.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/9/09 3375 brockwoo Initial Creation
*
* </pre>
*
* @author brockwoo
* @version 1
*/
/**
* Autogenerated by Thrift
* Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#ifndef Notification_TYPES_H
#define Notification_TYPES_H
#include <Thrift.h>
#include <TApplicationException.h>
#include <protocol/TProtocol.h>
#include <transport/TTransport.h>
@ -51,42 +16,44 @@
class DataURINotificationMessage {
typedef struct _com_raytheon_edex_msg_DataURINotificationMessage__isset {
_com_raytheon_edex_msg_DataURINotificationMessage__isset() : dataURIs(false) {}
bool dataURIs;
} _com_raytheon_edex_msg_DataURINotificationMessage__isset;
class com_raytheon_edex_msg_DataURINotificationMessage {
public:
static const char* ascii_fingerprint; // = "544A7C2D0FBAA52B283383658874CC1E";
static const uint8_t binary_fingerprint[16]; // = {0x54,0x4A,0x7C,0x2D,0x0F,0xBA,0xA5,0x2B,0x28,0x33,0x83,0x65,0x88,0x74,0xCC,0x1E};
static const char* ascii_fingerprint; // = "ACE4F644F0FDD289DDC4EE5B83BC13C0";
static const uint8_t binary_fingerprint[16]; // = {0xAC,0xE4,0xF6,0x44,0xF0,0xFD,0xD2,0x89,0xDD,0xC4,0xEE,0x5B,0x83,0xBC,0x13,0xC0};
DataURINotificationMessage() {
com_raytheon_edex_msg_DataURINotificationMessage() {
}
virtual ~DataURINotificationMessage() throw() {}
virtual ~com_raytheon_edex_msg_DataURINotificationMessage() throw() {}
std::vector<std::string> dataURIs;
std::vector<int32_t> ids;
struct __isset {
__isset() : dataURIs(false), ids(false) {}
bool dataURIs;
bool ids;
} __isset;
_com_raytheon_edex_msg_DataURINotificationMessage__isset __isset;
bool operator == (const DataURINotificationMessage & rhs) const
void __set_dataURIs(const std::vector<std::string> & val) {
dataURIs = val;
}
bool operator == (const com_raytheon_edex_msg_DataURINotificationMessage & rhs) const
{
if (!(dataURIs == rhs.dataURIs))
return false;
if (!(ids == rhs.ids))
return false;
return true;
}
bool operator != (const DataURINotificationMessage &rhs) const {
bool operator != (const com_raytheon_edex_msg_DataURINotificationMessage &rhs) const {
return !(*this == rhs);
}
bool operator < (const DataURINotificationMessage & ) const;
bool operator < (const com_raytheon_edex_msg_DataURINotificationMessage & ) const;
uint32_t read(apache::thrift::protocol::TProtocol* iprot);
uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};