Merge remote-tracking branch 'omaha/omaha_16.2.1' into master_16.2.1

Former-commit-id: 9d4d406ffe09c0c4b4f87ce66b332f9155673e9b
This commit is contained in:
Shawn.Hooper 2016-04-19 15:13:28 -04:00
commit 7e8a992530
2 changed files with 28 additions and 9 deletions

View file

@ -23,10 +23,11 @@ package com.raytheon.uf.common.registry.event;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/** /**
* *
* TODO Add Description * Registry Event for removing objects
* *
* <pre> * <pre>
* *
@ -38,6 +39,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Nov 08, 2013 2506 bgonzale Added constructors. Added object deleted field. * Nov 08, 2013 2506 bgonzale Added constructors. Added object deleted field.
* Added RegistryObjectType field. * Added RegistryObjectType field.
* Mar 31, 2014 2889 dhladky Added username for notification center tracking. * Mar 31, 2014 2889 dhladky Added username for notification center tracking.
* Apr 05, 2016 5488 tjensen Added DynamicSerializeElement to removedObject
* *
* </pre> * </pre>
* *
@ -49,6 +51,7 @@ public class RemoveRegistryEvent extends RegistryEvent {
private static final long serialVersionUID = -5854149256576746509L; private static final long serialVersionUID = -5854149256576746509L;
@DynamicSerializeElement
private RegistryObjectType removedObject; private RegistryObjectType removedObject;
public RemoveRegistryEvent() { public RemoveRegistryEvent() {

View file

@ -113,8 +113,9 @@ import com.raytheon.uf.edex.registry.events.DeleteSlotEvent;
* Mar 31, 2014 2889 dhladky Added username for notification center tracking. * Mar 31, 2014 2889 dhladky Added username for notification center tracking.
* 4/11/2014 3011 bphillip Modified merge behavior * 4/11/2014 3011 bphillip Modified merge behavior
* 4/17/2014 3011 bphillip Delete slot events now contain strings * 4/17/2014 3011 bphillip Delete slot events now contain strings
* June 25, 2014 2760 dhladky Added external delivery of registry events * Jun 25, 2014 2760 dhladky Added external delivery of registry events
* May 14, 2015 4493 dhladky Better integrated external delivery of registry events. * May 14, 2015 4493 dhladky Better integrated external delivery of registry events.
* Apr 05, 2016 5488 tjensen Fixed serialization issue in removeObjects
* *
* *
* </pre> * </pre>
@ -297,8 +298,22 @@ public class LifecycleManagerImpl implements LifecycleManager {
// Don't send notifications for Association types // Don't send notifications for Association types
if (objectType != null if (objectType != null
&& !objectType.equals(RegistryObjectTypes.ASSOCIATION)) { && !objectType.equals(RegistryObjectTypes.ASSOCIATION)) {
/*
* Clone the object before publishing it to the Event Bus. This
* resolves an issue with serialization due to the
* InternationalStringType data of the obj having odd
* classnames.
*/
RegistryObjectType objClone = new RegistryObjectType(
obj.getId(), obj.getLid(), obj.getObjectType(),
obj.getOwner(), obj.getStatus(), obj.getName()
.toString(), obj.getDescription().toString());
objClone.setSlot(obj.getSlot());
objClone.setVersionInfo(obj.getVersionInfo());
RemoveRegistryEvent event = new RemoveRegistryEvent( RemoveRegistryEvent event = new RemoveRegistryEvent(
request.getUsername(), obj.getId(), obj); request.getUsername(), obj.getId(), objClone);
event.setAction(Action.DELETE); event.setAction(Action.DELETE);
event.setLid(obj.getLid()); event.setLid(obj.getLid());
event.setObjectType(objectType); event.setObjectType(objectType);
@ -762,7 +777,8 @@ public class LifecycleManagerImpl implements LifecycleManager {
private void mergeObjects(RegistryObjectType newObject, private void mergeObjects(RegistryObjectType newObject,
RegistryObjectType existingObject) { RegistryObjectType existingObject) {
DeleteSlotEvent deleteSlotEvent = new DeleteSlotEvent(existingObject.getSlot()); DeleteSlotEvent deleteSlotEvent = new DeleteSlotEvent(
existingObject.getSlot());
registryObjectDao.merge(newObject, existingObject); registryObjectDao.merge(newObject, existingObject);
EventBus.publish(deleteSlotEvent); EventBus.publish(deleteSlotEvent);
} }