mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/AssetNamespaceUtils.java
public static CreateAssetResponseData createAsset(Socket socket, String productType, String name, 
            Map<String, Object> properties) throws UnknownHostException, IOException
    {
        MessageListener listener = new MessageListener(socket);
        CreateAssetRequestData.Builder requestBuilder = CreateAssetRequestData.newBuilder().setProductType(productType);
        if (name != null)
        {
            requestBuilder.setName(name);
        }
        if (properties != null)
        {
            requestBuilder.addAllProperties(SharedMessageUtils.convertMapToListSimpleTypesMapEntry(properties));
        }

        TerraHarvestMessage message = createAssetDirSvcNamespaceMessage(
                AssetDirectoryServiceMessageType.CreateAssetRequest, requestBuilder.build());
        message.writeDelimitedTo(socket.getOutputStream());
        
        AssetDirectoryServiceNamespace response = (AssetDirectoryServiceNamespace)listener.waitForMessage(
                Namespace.AssetDirectoryService, AssetDirectoryServiceMessageType.CreateAssetResponse, TIMEOUT);
    
        return CreateAssetResponseData.parseFrom(response.getData());
    }
/**
     * Helper method for creating a single asset.
     * 
     * @param productType
     *      product type of the asset (usually the fully qualified class name)
     * @param name
     *      name to give to the asset, set to null to use default name
     * @param properties
     *      configuration properties to be set for the asset, set to null if no properties should be set
     * @return
     *      Response data containing the PID and UUID of the created asset. 
     */
Helper method for creating a single asset.

@param productType
product type of the asset (usually the fully qualified class name)
@param name
name to give to the asset, set to null to use default name
@param properties
configuration properties to be set for the asset, set to null if no properties should be set
@return
Response data containing the PID and UUID of the created asset.
Helper method for creating a single asset . @param productType product type of the asset ( usually the fully qualified class name ) @param name name to give to the asset set to null to use default name @param properties configuration properties to be set for the asset set to null if no properties should be set @return Response data containing the PID and UUID of the created asset .
public static CreateAssetResponseData createAsset(Socket socket, String productType, String name, 
            Map<String, Object> properties) throws UnknownHostException, IOException
    {
        MessageListener listener = new MessageListener(socket);
        CreateAssetRequestData.Builder requestBuilder = CreateAssetRequestData.newBuilder().setProductType(productType);
        if (name != null)
        {
            requestBuilder.setName(name);
        }
        if (properties != null)
        {
            requestBuilder.addAllProperties(SharedMessageUtils.convertMapToListSimpleTypesMapEntry(properties));
        }
        TerraHarvestMessage message = createAssetDirSvcNamespaceMessage(
                AssetDirectoryServiceMessageType.CreateAssetRequest, requestBuilder.build());
        message.writeDelimitedTo(socket.getOutputStream());
        AssetDirectoryServiceNamespace response = (AssetDirectoryServiceNamespace)listener.waitForMessage(
                Namespace.AssetDirectoryService, AssetDirectoryServiceMessageType.CreateAssetResponse, TIMEOUT);
        return CreateAssetResponseData.parseFrom(response.getData());
    }
public static CreateAssetResponseData createAsset ( Socket socket , String productType , String name , Map < String , Object > properties ) throws UnknownHostException , IOException { MessageListener listener = new MessageListener ( socket ) ; CreateAssetRequestData . Builder requestBuilder = CreateAssetRequestData . newBuilder ( ) . setProductType ( productType ) ; if ( name != null ) { requestBuilder . setName ( name ) ; } if ( properties != null ) { requestBuilder . addAllProperties ( SharedMessageUtils . convertMapToListSimpleTypesMapEntry ( properties ) ) ; } TerraHarvestMessage message = createAssetDirSvcNamespaceMessage ( AssetDirectoryServiceMessageType . CreateAssetRequest , requestBuilder . build ( ) ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; AssetDirectoryServiceNamespace response = ( AssetDirectoryServiceNamespace ) listener . waitForMessage ( Namespace . AssetDirectoryService , AssetDirectoryServiceMessageType . CreateAssetResponse , TIMEOUT ) ; return CreateAssetResponseData . parseFrom ( response . getData ( ) ) ; }
Helper method for creating a single asset.
Helper method for creating a single asset .