mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/asset/AssetDirectoryMessageService.java
private Message createAsset(final AssetDirectoryServiceNamespace message, final TerraHarvestMessage request, 
            final RemoteChannel channel)throws IOException
    {
        final CreateAssetRequestData createRequest = CreateAssetRequestData.parseFrom(message.getData());
        final String productType = createRequest.getProductType();
        final String assetName = createRequest.getName();

        try
        {
            final Asset newAsset;
            //If create asset request contains configuration properties then create the asset with the specified
            //properties in the message.
            if (createRequest.getPropertiesCount() > 0)
            {
                newAsset = m_AssetDirectoryService.createAsset(productType, assetName, SharedMessageUtils
                        .convertListSimpleTypesMapEntrytoMapStringObject(createRequest.getPropertiesList())); 
            }
            else
            {
                newAsset = m_AssetDirectoryService.createAsset(productType, assetName);
            }
            
            final CreateAssetResponseData response = CreateAssetResponseData.newBuilder().
                setInfo(SharedMessageUtils.createFactoryObjectInfoMessage(newAsset)).build();

            m_MessageFactory.createAssetDirectoryServiceResponseMessage(request, 
                    AssetDirectoryServiceMessageType.CreateAssetResponse, response).queue(channel);
        }
        catch (final AssetException e)
        {
            m_Logging.error(e, "Cannot add asset of type %s to directory.", productType);
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.ASSET_ERROR, 
                    GENERIC_ERR_MSG + e.getMessage()).queue(channel);
        }
        return createRequest;
    }
/**
     * Method responsible for handling a remote request for creating and adding an asset to the directory.
     * @param message
     *      create asset request message containing the fully qualified class name of the asset to be created
     * @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 
     */
Method responsible for handling a remote request for creating and adding an asset to the directory.
Method responsible for handling a remote request for creating and adding an asset to the directory .
private Message createAsset(final AssetDirectoryServiceNamespace message, final TerraHarvestMessage request, 
            final RemoteChannel channel)throws IOException
    {
        final CreateAssetRequestData createRequest = CreateAssetRequestData.parseFrom(message.getData());
        final String productType = createRequest.getProductType();
        final String assetName = createRequest.getName();
        try
        {
            final Asset newAsset;
            if (createRequest.getPropertiesCount() > 0)
            {
                newAsset = m_AssetDirectoryService.createAsset(productType, assetName, SharedMessageUtils
                        .convertListSimpleTypesMapEntrytoMapStringObject(createRequest.getPropertiesList())); 
            }
            else
            {
                newAsset = m_AssetDirectoryService.createAsset(productType, assetName);
            }
            final CreateAssetResponseData response = CreateAssetResponseData.newBuilder().
                setInfo(SharedMessageUtils.createFactoryObjectInfoMessage(newAsset)).build();
            m_MessageFactory.createAssetDirectoryServiceResponseMessage(request, 
                    AssetDirectoryServiceMessageType.CreateAssetResponse, response).queue(channel);
        }
        catch (final AssetException e)
        {
            m_Logging.error(e, "Cannot add asset of type %s to directory.", productType);
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.ASSET_ERROR, 
                    GENERIC_ERR_MSG + e.getMessage()).queue(channel);
        }
        return createRequest;
    }
private Message createAsset ( final AssetDirectoryServiceNamespace message , final TerraHarvestMessage request , final RemoteChannel channel ) throws IOException { final CreateAssetRequestData createRequest = CreateAssetRequestData . parseFrom ( message . getData ( ) ) ; final String productType = createRequest . getProductType ( ) ; final String assetName = createRequest . getName ( ) ; try { final Asset newAsset ; if ( createRequest . getPropertiesCount ( ) > 0 ) { newAsset = m_AssetDirectoryService . createAsset ( productType , assetName , SharedMessageUtils . convertListSimpleTypesMapEntrytoMapStringObject ( createRequest . getPropertiesList ( ) ) ) ; } else { newAsset = m_AssetDirectoryService . createAsset ( productType , assetName ) ; } final CreateAssetResponseData response = CreateAssetResponseData . newBuilder ( ) . setInfo ( SharedMessageUtils . createFactoryObjectInfoMessage ( newAsset ) ) . build ( ) ; m_MessageFactory . createAssetDirectoryServiceResponseMessage ( request , AssetDirectoryServiceMessageType . CreateAssetResponse , response ) . queue ( channel ) ; } catch ( final AssetException e ) { m_Logging . error ( e , "Cannot add asset of type %s to directory." , productType ) ; m_MessageFactory . createBaseErrorMessage ( request , ErrorCode . ASSET_ERROR , GENERIC_ERR_MSG + e . getMessage ( ) ) . queue ( channel ) ; } return createRequest ; }
Method responsible for handling a remote request for creating and adding an asset to the directory.
Method responsible for handling a remote request for creating and adding an asset to the directory .
//If create asset request contains configuration properties then create the asset with the specified //properties in the message.