mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/asset/AssetDirectoryMessageService.java
private Message scanForNewAssets(final AssetDirectoryServiceNamespace message, final TerraHarvestMessage request, 
            final RemoteChannel channel) throws IOException
    {
        final ScanForNewAssetsRequestData scanRequest = ScanForNewAssetsRequestData.parseFrom(message.getData());
        final String assetType = scanRequest.getProductType();
        try
        {
            if (assetType.isEmpty())
            {
                m_AssetDirectoryService.scanForNewAssets();
            }
            else
            {
                m_AssetDirectoryService.scanForNewAssets(assetType);
            }
            m_MessageFactory.createAssetDirectoryServiceResponseMessage(request, 
                    AssetDirectoryServiceMessageType.ScanForNewAssetsResponse, null).queue(channel);
        }
        catch (final IllegalArgumentException e)
        {
            m_Logging.error(e, "Failed to scan assets of type %s.", assetType);
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.ASSET_ERROR, 
                    GENERIC_ERR_MSG + e.getMessage()).queue(channel);
        } 
        return scanRequest;
    }
/**
     * Method responsible for remotely requesting the asset service to scan the system for new assets. If the asset
     * type is attached to the request message, the service only scans for new assets of the specified type. If a
     * type is not specified in the request message, the service scans for new assets of all types.  
     * @param message
     *      "scan for new assets" request message which optionally contains the specific type of asset for 
     *      which to scan 
     * @param request
     *      entire remote message for the request
     * @param channel 
     *      channel to use for sending a response
     * @return
     *      the data message for this request
     * @throws IOException 
     *      if message cannot be parsed or if response message cannot be sent
     */
Method responsible for remotely requesting the asset service to scan the system for new assets. If the asset
type is attached to the request message, the service only scans for new assets of the specified type. If a
type is not specified in the request message, the service scans for new assets of all types.
Method responsible for remotely requesting the asset service to scan the system for new assets . If the asset type is attached to the request message the service only scans for new assets of the specified type . If a type is not specified in the request message the service scans for new assets of all types .
private Message scanForNewAssets(final AssetDirectoryServiceNamespace message, final TerraHarvestMessage request, 
            final RemoteChannel channel) throws IOException
    {
        final ScanForNewAssetsRequestData scanRequest = ScanForNewAssetsRequestData.parseFrom(message.getData());
        final String assetType = scanRequest.getProductType();
        try
        {
            if (assetType.isEmpty())
            {
                m_AssetDirectoryService.scanForNewAssets();
            }
            else
            {
                m_AssetDirectoryService.scanForNewAssets(assetType);
            }
            m_MessageFactory.createAssetDirectoryServiceResponseMessage(request, 
                    AssetDirectoryServiceMessageType.ScanForNewAssetsResponse, null).queue(channel);
        }
        catch (final IllegalArgumentException e)
        {
            m_Logging.error(e, "Failed to scan assets of type %s.", assetType);
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.ASSET_ERROR, 
                    GENERIC_ERR_MSG + e.getMessage()).queue(channel);
        } 
        return scanRequest;
    }
private Message scanForNewAssets ( final AssetDirectoryServiceNamespace message , final TerraHarvestMessage request , final RemoteChannel channel ) throws IOException { final ScanForNewAssetsRequestData scanRequest = ScanForNewAssetsRequestData . parseFrom ( message . getData ( ) ) ; final String assetType = scanRequest . getProductType ( ) ; try { if ( assetType . isEmpty ( ) ) { m_AssetDirectoryService . scanForNewAssets ( ) ; } else { m_AssetDirectoryService . scanForNewAssets ( assetType ) ; } m_MessageFactory . createAssetDirectoryServiceResponseMessage ( request , AssetDirectoryServiceMessageType . ScanForNewAssetsResponse , null ) . queue ( channel ) ; } catch ( final IllegalArgumentException e ) { m_Logging . error ( e , "Failed to scan assets of type %s." , assetType ) ; m_MessageFactory . createBaseErrorMessage ( request , ErrorCode . ASSET_ERROR , GENERIC_ERR_MSG + e . getMessage ( ) ) . queue ( channel ) ; } return scanRequest ; }
Method responsible for remotely requesting the asset service to scan the system for new assets.
Method responsible for remotely requesting the asset service to scan the system for new assets .