Omaha #3474 AWIPS2-Development portion of DD #2752

Former-commit-id: 944637a144 [formerly 053a656621ac0b6fb5dfd07b66c3440f61bd7136]
Former-commit-id: c6f5e8f6b1
This commit is contained in:
Dave Hladky 2014-07-30 14:54:52 -05:00
parent 310ef8cc32
commit 8d3ba6585a
5 changed files with 53 additions and 11 deletions

View file

@ -54,6 +54,7 @@ import com.raytheon.uf.common.registry.ebxml.slots.SlotConverter;
import com.raytheon.uf.common.registry.ebxml.slots.StringSlotConverter;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.time.util.ImmutableDate;
import com.raytheon.uf.common.util.ClusterIdUtil;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.common.util.ReflectionException;
import com.raytheon.uf.common.util.ReflectionUtil;
@ -84,6 +85,8 @@ import com.raytheon.uf.common.util.ReflectionUtil;
* 6/5/2014 1712 bphillip Registry now communicates over https
* June 25, 2014 3273 dhladky Remove all DD environment variables from setup.env
* 7/10/2014 1717 bphillip Changed default user
* Jul 28, 2014 3474 dhladky Fixed bad default user settings.
*
*
* </pre>
*
@ -101,10 +104,10 @@ public final class RegistryUtil {
public static final String registryObjectClassName = "registryObjectClassName";
public static final String registryObjectDefaultVersion = "1.0";
public static final String defaultUser = "NCF";
public static final String registryUser = "Registry";
public static final String defaultUser = RegistryObjectType.SYSTEM_USER;
public static final String DEFAULT_OWNER = "System";
static {
if (System.getProperty("ebxml.registry.host") != null
@ -121,7 +124,7 @@ public final class RegistryUtil {
/**
* The default internal owner is the local registry ID
*/
public static final String DEFAULT_OWNER = defaultUser;
public static final String registryUser = ClusterIdUtil.getId();
// A private mapping of attribute types to slot types, used when storing an
// object to the registry to map QueryableAttributes to SlotConverters.
@ -381,7 +384,7 @@ public final class RegistryUtil {
registryObject, RegistryObjectOwner.class);
registryObject.setOwner(objectOwner);
if (objectOwner == null) {
registryObject.setOwner(DEFAULT_OWNER);
registryObject.setOwner(registryUser);
}
registryObject.setName(getInternationalString(ReflectionUtil

View file

@ -1,4 +1,23 @@
package com.raytheon.uf.edex.registry.ebxml;
/**
* 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.
**/
import java.util.List;
@ -37,6 +56,23 @@ import com.raytheon.uf.edex.registry.ebxml.dao.RoleDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
import com.raytheon.uf.edex.security.SecurityConfiguration;
/**
*
* Registry User Utilitiy class
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/28/2014 3474 dhladky Fixed bad ownership settings.
* </pre>
*
* @author bphillip
* @version 1
*/
@Path("/registryUsers/")
@Service
@Transactional
@ -98,7 +134,7 @@ public class RegistryUsers {
user.setObjectType(RegistryObjectTypes.PERSON);
user.setName(new InternationalStringType("User " + userName));
user.setDescription(new InternationalStringType("User" + userName));
user.setOwner(RegistryUtil.DEFAULT_OWNER);
user.setOwner(RegistryUtil.registryUser);
addUser(userName, pwd, role);
return "Successfully added user " + userName + " to registry";
@ -171,13 +207,13 @@ public class RegistryUsers {
user.setObjectType(RegistryObjectTypes.PERSON);
user.setName(new InternationalStringType("Registry User " + id));
user.setDescription(new InternationalStringType("Registry User " + id));
user.setOwner(RegistryUtil.DEFAULT_OWNER);
user.setOwner(RegistryUtil.registryUser);
AssociationType association = new AssociationType();
association.setId(id + "_" + role + "_Association");
association.setLid(association.getId());
association.setObjectType(RegistryObjectTypes.ASSOCIATION);
association.setOwner(RegistryUtil.DEFAULT_OWNER);
association.setOwner(RegistryUtil.registryUser);
association.setName(new InternationalStringType(role
+ " role assocation for user " + id));
association.setDescription(new InternationalStringType(role

View file

@ -94,6 +94,7 @@ import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener;
* Dec 04, 2013 2584 dhladky Version based EbxmlJaxbManager
* 7/10/2014 1717 bphillip Removed xacml policy admin object
* Jul 10, 2014 2914 garmendariz Remove EnvProperties
* Jul 28, 2014 3474 dhladky Fixed bad ownership settings.
* </pre>
*
* @author bphillip
@ -289,7 +290,7 @@ public class DbInit extends com.raytheon.uf.edex.database.init.DbInit implements
// If no owner is assigned, assign the defaul owner
if (regObj.getOwner() == null) {
regObj.setOwner(RegistryUtil.DEFAULT_OWNER);
regObj.setOwner(RegistryUtil.defaultUser);
}
/*

View file

@ -62,6 +62,7 @@ import com.raytheon.uf.edex.registry.events.CreateAuditTrailEvent;
* only be run on a quartz timer
* 12/2/2013 1829 bphillip Now uses event bus for triggering auditable event generation
* 01/21/2014 2613 bphillip Changed how auditable events are created for deletes
* 7/28/2014 3474 dhladky Fixed bad ownership settings.
*
* </pre>
*
@ -170,7 +171,7 @@ public class AuditableEventService {
String objectId = RegistryUtil.generateRegistryObjectId();
event.setId(objectId);
event.setLid(objectId);
event.setOwner(RegistryUtil.DEFAULT_OWNER);
event.setOwner(RegistryUtil.registryUser);
event.setObjectType(RegistryObjectTypes.AUDITABLE_EVENT);
event.setRequestId(request.getId());
event.setTimestamp(EbxmlObjectUtil

View file

@ -78,6 +78,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* 12/9/2013 2613 bphillip Changed start time boundary of get auditable events to be the last run time of the subscription
* 01/21/2014 2613 bphillip Changed start time boundary again and also a few minor cleanup items
* 2/13/2014 2769 bphillip Optimized sendNotifications method
* 7/28/2014 3474 dhladky Fixed bad ownership settings.
* </pre>
*
* @author bphillip
@ -400,7 +401,7 @@ public class RegistryNotificationManager {
+ subscriptionId + "]"));
notification.setObjectType(RegistryObjectTypes.NOTIFICATION);
notification.setStatus(StatusTypes.APPROVED);
notification.setOwner(RegistryUtil.DEFAULT_OWNER);
notification.setOwner(RegistryUtil.registryUser);
notification.setSubscription(subscriptionId);
notification.setEvent(eventsOfInterest);
return notification;