mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/RemoteTransportLayerUtils.java
public static CreateTransportLayerResponseData createTransportCommLayer(final String name, final String className, 
            final SharedMessages.UUID uuidOfLinkLayer, final Socket socket) throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        
        // request data to create a new transport layer
        CreateTransportLayerRequestData.Builder requestMessage = CreateTransportLayerRequestData.newBuilder().
                setTransportLayerName(name).
                setTransportLayerProductType(className);
        
        if (uuidOfLinkLayer != null)
        {
            requestMessage.setLinkLayerUuid(uuidOfLinkLayer);
        }
        
        // create terra harvest message
        TerraHarvestMessage message = TestCustomCommsNamespace.
            createCustomCommsMessage(CustomCommsMessageType.CreateTransportLayerRequest, requestMessage.build());
        
        // send out message
        message.writeDelimitedTo(socket.getOutputStream());
        
        // listen for messages for a specific time interval
        CustomCommsNamespace response = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.CreateTransportLayerResponse, TIME_OUT);

        //return the response
        return CreateTransportLayerResponseData.parseFrom(response.getData());
    }
/**
     * Create a transport comms layer.
     * @param name
     *     the name to use for the new transport layer
     * @param className
     *     the type of transport layer to create
     * @param uuidOfLinkLayer
     *     the UUID of the link layer create this transport layer on top of or null if no link layer
     * @param socket
     *     the socket to use for the request
     * @return
     *     the response message from creating the layer
     */
Create a transport comms layer.
Create a transport comms layer .
public static CreateTransportLayerResponseData createTransportCommLayer(final String name, final String className, 
            final SharedMessages.UUID uuidOfLinkLayer, final Socket socket) throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        CreateTransportLayerRequestData.Builder requestMessage = CreateTransportLayerRequestData.newBuilder().
                setTransportLayerName(name).
                setTransportLayerProductType(className);
        if (uuidOfLinkLayer != null)
        {
            requestMessage.setLinkLayerUuid(uuidOfLinkLayer);
        }
        TerraHarvestMessage message = TestCustomCommsNamespace.
            createCustomCommsMessage(CustomCommsMessageType.CreateTransportLayerRequest, requestMessage.build());
        message.writeDelimitedTo(socket.getOutputStream());
        CustomCommsNamespace response = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.CreateTransportLayerResponse, TIME_OUT);
        return CreateTransportLayerResponseData.parseFrom(response.getData());
    }
public static CreateTransportLayerResponseData createTransportCommLayer ( final String name , final String className , final SharedMessages . UUID uuidOfLinkLayer , final Socket socket ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; CreateTransportLayerRequestData . Builder requestMessage = CreateTransportLayerRequestData . newBuilder ( ) . setTransportLayerName ( name ) . setTransportLayerProductType ( className ) ; if ( uuidOfLinkLayer != null ) { requestMessage . setLinkLayerUuid ( uuidOfLinkLayer ) ; } TerraHarvestMessage message = TestCustomCommsNamespace . createCustomCommsMessage ( CustomCommsMessageType . CreateTransportLayerRequest , requestMessage . build ( ) ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; CustomCommsNamespace response = ( CustomCommsNamespace ) listener . waitForMessage ( Namespace . CustomComms , CustomCommsMessageType . CreateTransportLayerResponse , TIME_OUT ) ; return CreateTransportLayerResponseData . parseFrom ( response . getData ( ) ) ; }
Create a transport comms layer.
Create a transport comms layer .
// request data to create a new transport layer // create terra harvest message // send out message // listen for messages for a specific time interval //return the response