mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/controller/ControllerMgrImpl.java
private synchronized boolean addControllerIfNew(final int controllerId)
    {
        ControllerModel model = getController(controllerId);
        if (model == null)
        {
            model = new ControllerModel(controllerId, m_ControllerImageInterface);
            m_Controllers.add(model);
            
            EncryptType encryptType = null;
            try
            {
                encryptType = m_EncryptionTypeManager.getEncryptTypeAsnyc(controllerId);
            }
            catch (final IllegalArgumentException ex)
            {
                m_GrowlUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_ERROR, "Request Error:", 
                        String.format("Unable to send encryption type request for controller ID: %s. See server log "
                                + "for more details.", controllerId), ex);
            }
            
            if (encryptType != null)
            {                
                //send cleanup request if controller is completely new
                sendCleanupRequestIfNeeded(model);
            }

            //Create a controller added event and post it to the event admin service.
            final Map<String, Object> props = new HashMap<String, Object>();
            props.put(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID, model.getId());
            m_EventAdmin.postEvent(new Event(ControllerMgr.TOPIC_CONTROLLER_ADDED, props));
            
            if (controllerId != MAX_SYSTEM_ID)
            {
                m_GrowlUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, LOG_MESSAGE_DESCRIPTOR_INFO, 
                        String.format("Added controller 0x%08x", controllerId));
            }
            
            return true;
        } 
        
        return false;
    }
/**
     * Add a controller to the controller manager if not already added.
     * 
     * @param controllerId
     *     the id of the controller to add
     * @return 
     *     returns true if the controller was new and therefore was added to the list of 
     *     known controllers; false otherwise
     */
Add a controller to the controller manager if not already added.

@param controllerId
the id of the controller to add
@return
returns true if the controller was new and therefore was added to the list of
known controllers; false otherwise
Add a controller to the controller manager if not already added . @param controllerId the id of the controller to add @return returns true if the controller was new and therefore was added to the list of known controllers ; false otherwise
private synchronized boolean addControllerIfNew(final int controllerId)
    {
        ControllerModel model = getController(controllerId);
        if (model == null)
        {
            model = new ControllerModel(controllerId, m_ControllerImageInterface);
            m_Controllers.add(model);
            EncryptType encryptType = null;
            try
            {
                encryptType = m_EncryptionTypeManager.getEncryptTypeAsnyc(controllerId);
            }
            catch (final IllegalArgumentException ex)
            {
                m_GrowlUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_ERROR, "Request Error:", 
                        String.format("Unable to send encryption type request for controller ID: %s. See server log "
                                + "for more details.", controllerId), ex);
            }
            if (encryptType != null)
            {                
                sendCleanupRequestIfNeeded(model);
            }
            final Map<String, Object> props = new HashMap<String, Object>();
            props.put(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID, model.getId());
            m_EventAdmin.postEvent(new Event(ControllerMgr.TOPIC_CONTROLLER_ADDED, props));
            if (controllerId != MAX_SYSTEM_ID)
            {
                m_GrowlUtil.createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, LOG_MESSAGE_DESCRIPTOR_INFO, 
                        String.format("Added controller 0x%08x", controllerId));
            }
            return true;
        } 
        return false;
    }
private synchronized boolean addControllerIfNew ( final int controllerId ) { ControllerModel model = getController ( controllerId ) ; if ( model == null ) { model = new ControllerModel ( controllerId , m_ControllerImageInterface ) ; m_Controllers . add ( model ) ; EncryptType encryptType = null ; try { encryptType = m_EncryptionTypeManager . getEncryptTypeAsnyc ( controllerId ) ; } catch ( final IllegalArgumentException ex ) { m_GrowlUtil . createGlobalFacesMessage ( FacesMessage . SEVERITY_ERROR , "Request Error:" , String . format ( "Unable to send encryption type request for controller ID: %s. See server log " + "for more details." , controllerId ) , ex ) ; } if ( encryptType != null ) { sendCleanupRequestIfNeeded ( model ) ; } final Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( SharedPropertyConstants . EVENT_PROP_CONTROLLER_ID , model . getId ( ) ) ; m_EventAdmin . postEvent ( new Event ( ControllerMgr . TOPIC_CONTROLLER_ADDED , props ) ) ; if ( controllerId != MAX_SYSTEM_ID ) { m_GrowlUtil . createGlobalFacesMessage ( FacesMessage . SEVERITY_INFO , LOG_MESSAGE_DESCRIPTOR_INFO , String . format ( "Added controller 0x%08x" , controllerId ) ) ; } return true ; } return false ; }
Add a controller to the controller manager if not already added.
Add a controller to the controller manager if not already added .
//send cleanup request if controller is completely new //Create a controller added event and post it to the event admin service.