mil.dod.th.remote.client.integration/src/mil/dod/th/remote/client/integration/AssetUtils.java
public static UUID createAsset(BundleContext context, String productType, String assetName) throws IOException
    {
        MessageListener listener = new MessageListener(context);
        
        CreateAssetRequestData createAssetRequest = CreateAssetRequestData.newBuilder()
                .setProductType(productType)
                .setName(assetName)
                .build();
        AssetDirectoryServiceNamespace namespace = AssetDirectoryServiceNamespace.newBuilder()
                .setType(AssetDirectoryServiceMessageType.CreateAssetRequest)
                .setData(createAssetRequest.toByteString())
                .build();
        getMsgSenderService(context).sendRequest(SystemConstants.REMOTE_SYS_ID, TerraHarvestPayload.newBuilder()
                .setNamespace(Namespace.AssetDirectoryService)
                .setNamespaceMessage(namespace.toByteString()).build());
        
        CreateAssetResponseData response = listener.waitForMessage(Namespace.AssetDirectoryService, 
                AssetDirectoryServiceMessageType.CreateAssetResponse, 5, TimeUnit.SECONDS);
        return response.getInfo().getUuid();
    }
/**
     * Create an asset through the remote interface.
     */
Create an asset through the remote interface.
Create an asset through the remote interface .
public static UUID createAsset(BundleContext context, String productType, String assetName) throws IOException
    {
        MessageListener listener = new MessageListener(context);
        CreateAssetRequestData createAssetRequest = CreateAssetRequestData.newBuilder()
                .setProductType(productType)
                .setName(assetName)
                .build();
        AssetDirectoryServiceNamespace namespace = AssetDirectoryServiceNamespace.newBuilder()
                .setType(AssetDirectoryServiceMessageType.CreateAssetRequest)
                .setData(createAssetRequest.toByteString())
                .build();
        getMsgSenderService(context).sendRequest(SystemConstants.REMOTE_SYS_ID, TerraHarvestPayload.newBuilder()
                .setNamespace(Namespace.AssetDirectoryService)
                .setNamespaceMessage(namespace.toByteString()).build());
        CreateAssetResponseData response = listener.waitForMessage(Namespace.AssetDirectoryService, 
                AssetDirectoryServiceMessageType.CreateAssetResponse, 5, TimeUnit.SECONDS);
        return response.getInfo().getUuid();
    }
public static UUID createAsset ( BundleContext context , String productType , String assetName ) throws IOException { MessageListener listener = new MessageListener ( context ) ; CreateAssetRequestData createAssetRequest = CreateAssetRequestData . newBuilder ( ) . setProductType ( productType ) . setName ( assetName ) . build ( ) ; AssetDirectoryServiceNamespace namespace = AssetDirectoryServiceNamespace . newBuilder ( ) . setType ( AssetDirectoryServiceMessageType . CreateAssetRequest ) . setData ( createAssetRequest . toByteString ( ) ) . build ( ) ; getMsgSenderService ( context ) . sendRequest ( SystemConstants . REMOTE_SYS_ID , TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . AssetDirectoryService ) . setNamespaceMessage ( namespace . toByteString ( ) ) . build ( ) ) ; CreateAssetResponseData response = listener . waitForMessage ( Namespace . AssetDirectoryService , AssetDirectoryServiceMessageType . CreateAssetResponse , 5 , TimeUnit . SECONDS ) ; return response . getInfo ( ) . getUuid ( ) ; }
Create an asset through the remote interface.
Create an asset through the remote interface .