mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/comms/CommsMgrImpl.java
private synchronized void processFactoryEvent(final Event event) //NOCHECKSTYLE: cyclomatic complexity is 13. Need to 
                                                                   // account for all factory object events.
    {           
        //pull out event props
        final String topic = event.getTopic(); 
        final int systemId = (Integer)event.getProperty(RemoteConstants.REMOTE_EVENT_PROP_CONTROLLER_ID);        
        final String baseType = (String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE);        
        
        // add new layer to a stack if the new layer does not already exist
        if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_CREATED))
        {
            processNewLayerHelper(event);

            //post notice
            m_GrowlMessageUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, "New Layer Added", 
                    String.format("Controller 0x%08x added a new %s", systemId, baseType));
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_DELETED))
        {           
            processDeleteLayerHelper(event);

            //post notice
            m_GrowlMessageUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, "Layer Deleted", 
                    String.format("Controller 0x%08x deleted a %s", systemId, baseType));
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_NAME_UPDATED))
        {
            //check the name
            final String name = (String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_NAME);

            //pull out the uuid and update layer name
            final UUID uuid = UUID.fromString((String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_UUID)); 
            updateLayerName(convertBaseTypeToCommType(baseType), uuid, systemId, name); 
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_PID_CREATED))
        {
            final String pid = (String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_PID);
            final UUID uuid = UUID.fromString((String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_UUID)); 
            findLayer(uuid, findListByType(convertBaseTypeToCommType(baseType), systemId)).setPid(pid);
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_PID_REMOVED))
        {
            final UUID uuid = UUID.fromString((String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_UUID)); 
            findLayer(uuid, findListByType(convertBaseTypeToCommType(baseType), systemId)).setPid("");
        }
    }
/**
     * Method for adding/updating a comms stack based on remote factory event received.
     * Specifically, the method processes events about the addition or removal of specific
     * comms layers.    
     * @param event
     *      properties of the event
     */
Method for adding/updating a comms stack based on remote factory event received.
Specifically, the method processes events about the addition or removal of specific
comms layers.
@param event
properties of the event
Method for adding / updating a comms stack based on remote factory event received . Specifically the method processes events about the addition or removal of specific comms layers . @param event properties of the event
private synchronized void processFactoryEvent(final Event event) 
    {           
        final String topic = event.getTopic(); 
        final int systemId = (Integer)event.getProperty(RemoteConstants.REMOTE_EVENT_PROP_CONTROLLER_ID);        
        final String baseType = (String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE);        
        if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_CREATED))
        {
            processNewLayerHelper(event);
            m_GrowlMessageUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, "New Layer Added", 
                    String.format("Controller 0x%08x added a new %s", systemId, baseType));
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_DELETED))
        {           
            processDeleteLayerHelper(event);
            m_GrowlMessageUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, "Layer Deleted", 
                    String.format("Controller 0x%08x deleted a %s", systemId, baseType));
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_NAME_UPDATED))
        {
            final String name = (String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_NAME);
            final UUID uuid = UUID.fromString((String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_UUID)); 
            updateLayerName(convertBaseTypeToCommType(baseType), uuid, systemId, name); 
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_PID_CREATED))
        {
            final String pid = (String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_PID);
            final UUID uuid = UUID.fromString((String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_UUID)); 
            findLayer(uuid, findListByType(convertBaseTypeToCommType(baseType), systemId)).setPid(pid);
        }
        else if (topic.contains(FactoryDescriptor.TOPIC_FACTORY_OBJ_PID_REMOVED))
        {
            final UUID uuid = UUID.fromString((String)event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_UUID)); 
            findLayer(uuid, findListByType(convertBaseTypeToCommType(baseType), systemId)).setPid("");
        }
    }
private synchronized void processFactoryEvent ( final Event event ) { final String topic = event . getTopic ( ) ; final int systemId = ( Integer ) event . getProperty ( RemoteConstants . REMOTE_EVENT_PROP_CONTROLLER_ID ) ; final String baseType = ( String ) event . getProperty ( FactoryDescriptor . EVENT_PROP_OBJ_BASE_TYPE ) ; if ( topic . contains ( FactoryDescriptor . TOPIC_FACTORY_OBJ_CREATED ) ) { processNewLayerHelper ( event ) ; m_GrowlMessageUtil . createGlobalFacesMessage ( FacesMessage . SEVERITY_INFO , "New Layer Added" , String . format ( "Controller 0x%08x added a new %s" , systemId , baseType ) ) ; } else if ( topic . contains ( FactoryDescriptor . TOPIC_FACTORY_OBJ_DELETED ) ) { processDeleteLayerHelper ( event ) ; m_GrowlMessageUtil . createGlobalFacesMessage ( FacesMessage . SEVERITY_INFO , "Layer Deleted" , String . format ( "Controller 0x%08x deleted a %s" , systemId , baseType ) ) ; } else if ( topic . contains ( FactoryDescriptor . TOPIC_FACTORY_OBJ_NAME_UPDATED ) ) { final String name = ( String ) event . getProperty ( FactoryDescriptor . EVENT_PROP_OBJ_NAME ) ; final UUID uuid = UUID . fromString ( ( String ) event . getProperty ( FactoryDescriptor . EVENT_PROP_OBJ_UUID ) ) ; updateLayerName ( convertBaseTypeToCommType ( baseType ) , uuid , systemId , name ) ; } else if ( topic . contains ( FactoryDescriptor . TOPIC_FACTORY_OBJ_PID_CREATED ) ) { final String pid = ( String ) event . getProperty ( FactoryDescriptor . EVENT_PROP_OBJ_PID ) ; final UUID uuid = UUID . fromString ( ( String ) event . getProperty ( FactoryDescriptor . EVENT_PROP_OBJ_UUID ) ) ; findLayer ( uuid , findListByType ( convertBaseTypeToCommType ( baseType ) , systemId ) ) . setPid ( pid ) ; } else if ( topic . contains ( FactoryDescriptor . TOPIC_FACTORY_OBJ_PID_REMOVED ) ) { final UUID uuid = UUID . fromString ( ( String ) event . getProperty ( FactoryDescriptor . EVENT_PROP_OBJ_UUID ) ) ; findLayer ( uuid , findListByType ( convertBaseTypeToCommType ( baseType ) , systemId ) ) . setPid ( "" ) ; } }
Method for adding/updating a comms stack based on remote factory event received.
Method for adding / updating a comms stack based on remote factory event received .
//NOCHECKSTYLE: cyclomatic complexity is 13. Need to  // account for all factory object events. //pull out event props // add new layer to a stack if the new layer does not already exist //post notice //post notice //check the name //pull out the uuid and update layer name