mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/asset/AssetSyncableCommandModel.java
public final void updateCapabilities(final CommandCapabilities capabilities) 
            throws ClassNotFoundException, InstantiationException, IllegalAccessException
    {
        m_CommandCaps = capabilities;
        final List<CommandTypeEnum> supportedCommands = capabilities.getSupportedCommands();
        //Add new commands to the command map.
        for (CommandTypeEnum commandType: supportedCommands)
        {
            //The set position command is handle on the asset configuration page and therefore should be ignored.
            //Also, check if the command type already exists within the map and skip adding it if it does.
            if (commandType.equals(CommandTypeEnum.SET_POSITION_COMMAND) || m_CommandMap.containsKey(commandType))
            {
                continue;
            }
            //The set tune settings command does not support syncing since it would require a large amount
            //of special handling to support. Therefore null is entered into the map so no get command is associated.
            else if (commandType.equals(CommandTypeEnum.SET_TUNE_SETTINGS_COMMAND)
                    || commandType.equals(CommandTypeEnum.SET_LIFT_COMMAND))
            {
                m_CommandMap.put(commandType, AssetCommandUtil.instantiateCommandBasedOnType(commandType));
            } 
            else if (commandType.toString().startsWith(AssetCommandUtil.SET_COMMAND_PREFIX))
            {
                m_CommandMap.put(commandType, AssetCommandUtil.instantiateCommandBasedOnType(commandType));
                m_SyncableCommandTypeBiMap.put(commandType, CommandTypeEnum.valueOf(AssetCommandUtil.GET_COMMAND_PREFIX 
                        + commandType.toString().substring(AssetCommandUtil.GET_COMMAND_PREFIX.length())));
            }
            else if (!commandType.toString().startsWith(AssetCommandUtil.GET_COMMAND_PREFIX))
            {
                m_CommandMap.put(commandType, AssetCommandUtil.instantiateCommandBasedOnType(commandType));
            }
        }
        
        //Remove any commands that are no longer supported.
        final Iterator<Entry<CommandTypeEnum, Command>> commandIterator = m_CommandMap.entrySet().iterator();
        while (commandIterator.hasNext())
        {
            final Entry<CommandTypeEnum, Command> commandEntry = commandIterator.next();
            if (!supportedCommands.contains(commandEntry.getKey()))
            {
                commandIterator.remove();
            }
        }
    }
/**
     * Updates list of supported commands based off the specified command capabilities.
     * 
     * @param capabilities
     *      Command capabilities used to determine supported commands.
     * @throws IllegalAccessException
     *      Thrown if the command class to be instantiated cannot be accessed.
     * @throws InstantiationException
     *      Thrown if the command object cannot be instantiated using reflections.
     * @throws ClassNotFoundException
     *      Thrown if the class for the command to be instantiated cannot be found. 
     */
Updates list of supported commands based off the specified command capabilities.

@param capabilities
Command capabilities used to determine supported commands.
@throws IllegalAccessException
Thrown if the command class to be instantiated cannot be accessed.
@throws InstantiationException
Thrown if the command object cannot be instantiated using reflections.
@throws ClassNotFoundException
Thrown if the class for the command to be instantiated cannot be found.
Updates list of supported commands based off the specified command capabilities . @param capabilities Command capabilities used to determine supported commands . @throws IllegalAccessException Thrown if the command class to be instantiated cannot be accessed . @throws InstantiationException Thrown if the command object cannot be instantiated using reflections . @throws ClassNotFoundException Thrown if the class for the command to be instantiated cannot be found .
public final void updateCapabilities(final CommandCapabilities capabilities) 
            throws ClassNotFoundException, InstantiationException, IllegalAccessException
    {
        m_CommandCaps = capabilities;
        final List<CommandTypeEnum> supportedCommands = capabilities.getSupportedCommands();
        for (CommandTypeEnum commandType: supportedCommands)
        {
            if (commandType.equals(CommandTypeEnum.SET_POSITION_COMMAND) || m_CommandMap.containsKey(commandType))
            {
                continue;
            }
            else if (commandType.equals(CommandTypeEnum.SET_TUNE_SETTINGS_COMMAND)
                    || commandType.equals(CommandTypeEnum.SET_LIFT_COMMAND))
            {
                m_CommandMap.put(commandType, AssetCommandUtil.instantiateCommandBasedOnType(commandType));
            } 
            else if (commandType.toString().startsWith(AssetCommandUtil.SET_COMMAND_PREFIX))
            {
                m_CommandMap.put(commandType, AssetCommandUtil.instantiateCommandBasedOnType(commandType));
                m_SyncableCommandTypeBiMap.put(commandType, CommandTypeEnum.valueOf(AssetCommandUtil.GET_COMMAND_PREFIX 
                        + commandType.toString().substring(AssetCommandUtil.GET_COMMAND_PREFIX.length())));
            }
            else if (!commandType.toString().startsWith(AssetCommandUtil.GET_COMMAND_PREFIX))
            {
                m_CommandMap.put(commandType, AssetCommandUtil.instantiateCommandBasedOnType(commandType));
            }
        }
        final Iterator<Entry<CommandTypeEnum, Command>> commandIterator = m_CommandMap.entrySet().iterator();
        while (commandIterator.hasNext())
        {
            final Entry<CommandTypeEnum, Command> commandEntry = commandIterator.next();
            if (!supportedCommands.contains(commandEntry.getKey()))
            {
                commandIterator.remove();
            }
        }
    }
public final void updateCapabilities ( final CommandCapabilities capabilities ) throws ClassNotFoundException , InstantiationException , IllegalAccessException { m_CommandCaps = capabilities ; final List < CommandTypeEnum > supportedCommands = capabilities . getSupportedCommands ( ) ; for ( CommandTypeEnum commandType : supportedCommands ) { if ( commandType . equals ( CommandTypeEnum . SET_POSITION_COMMAND ) || m_CommandMap . containsKey ( commandType ) ) { continue ; } else if ( commandType . equals ( CommandTypeEnum . SET_TUNE_SETTINGS_COMMAND ) || commandType . equals ( CommandTypeEnum . SET_LIFT_COMMAND ) ) { m_CommandMap . put ( commandType , AssetCommandUtil . instantiateCommandBasedOnType ( commandType ) ) ; } else if ( commandType . toString ( ) . startsWith ( AssetCommandUtil . SET_COMMAND_PREFIX ) ) { m_CommandMap . put ( commandType , AssetCommandUtil . instantiateCommandBasedOnType ( commandType ) ) ; m_SyncableCommandTypeBiMap . put ( commandType , CommandTypeEnum . valueOf ( AssetCommandUtil . GET_COMMAND_PREFIX + commandType . toString ( ) . substring ( AssetCommandUtil . GET_COMMAND_PREFIX . length ( ) ) ) ) ; } else if ( ! commandType . toString ( ) . startsWith ( AssetCommandUtil . GET_COMMAND_PREFIX ) ) { m_CommandMap . put ( commandType , AssetCommandUtil . instantiateCommandBasedOnType ( commandType ) ) ; } } final Iterator < Entry < CommandTypeEnum , Command > > commandIterator = m_CommandMap . entrySet ( ) . iterator ( ) ; while ( commandIterator . hasNext ( ) ) { final Entry < CommandTypeEnum , Command > commandEntry = commandIterator . next ( ) ; if ( ! supportedCommands . contains ( commandEntry . getKey ( ) ) ) { commandIterator . remove ( ) ; } } }
Updates list of supported commands based off the specified command capabilities.
Updates list of supported commands based off the specified command capabilities .
//Add new commands to the command map. //The set position command is handle on the asset configuration page and therefore should be ignored. //Also, check if the command type already exists within the map and skip adding it if it does. //The set tune settings command does not support syncing since it would require a large amount //of special handling to support. Therefore null is entered into the map so no get command is associated. //Remove any commands that are no longer supported.