mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/RemoteLinkLayerUtils.java
public static CreateLinkLayerResponseData createLinkCommLayer(final String linkName, final String linkClass, 
        final UUID phyUuid, final Socket socket) throws IOException, InterruptedException
    {
        //listener
        MessageListener listener = new MessageListener(socket);
        
        //---Create a link layer associated with the physical link---
        // request data to create a new link layer
        CreateLinkLayerRequestData.Builder createLinkLayerRequestMessage = CreateLinkLayerRequestData.newBuilder().
                setLinkLayerProductType(linkClass).
                setLinkLayerName(linkName);
                
        if (phyUuid != null)
        {
            createLinkLayerRequestMessage.setPhysicalLinkUuid(phyUuid);
        }
        
        // create terra harvest message
        TerraHarvestMessage createLinkLayerMessage = TestCustomCommsNamespace.createCustomCommsMessage(
                CustomCommsMessageType.CreateLinkLayerRequest, createLinkLayerRequestMessage.build());

        // send out message
        createLinkLayerMessage.writeDelimitedTo(socket.getOutputStream());

        CustomCommsNamespace createLinkLayerResponse = (CustomCommsNamespace)listener.waitForMessage(
                Namespace.CustomComms, CustomCommsMessageType.CreateLinkLayerResponse, TIME_OUT);
        return CreateLinkLayerResponseData.parseFrom(createLinkLayerResponse.getData());
    }
/**
     * Create a link comms layer.
     * @param linkName
     *      the name to be assigned to the LinkLayer
     * @param linkClass
     *      the type of the LinkLayer that should be created
     * @param phyUuid
     *      the UUID of the PhysicalLink that will belong to the LinkLayer
     * @param socket
     *      the socket to use for communications to the controller
     * @return
     *     the response message from creating the layer
     */
Create a link comms layer.
Create a link comms layer .
public static CreateLinkLayerResponseData createLinkCommLayer(final String linkName, final String linkClass, 
        final UUID phyUuid, final Socket socket) throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        CreateLinkLayerRequestData.Builder createLinkLayerRequestMessage = CreateLinkLayerRequestData.newBuilder().
                setLinkLayerProductType(linkClass).
                setLinkLayerName(linkName);
        if (phyUuid != null)
        {
            createLinkLayerRequestMessage.setPhysicalLinkUuid(phyUuid);
        }
        TerraHarvestMessage createLinkLayerMessage = TestCustomCommsNamespace.createCustomCommsMessage(
                CustomCommsMessageType.CreateLinkLayerRequest, createLinkLayerRequestMessage.build());
        createLinkLayerMessage.writeDelimitedTo(socket.getOutputStream());
        CustomCommsNamespace createLinkLayerResponse = (CustomCommsNamespace)listener.waitForMessage(
                Namespace.CustomComms, CustomCommsMessageType.CreateLinkLayerResponse, TIME_OUT);
        return CreateLinkLayerResponseData.parseFrom(createLinkLayerResponse.getData());
    }
public static CreateLinkLayerResponseData createLinkCommLayer ( final String linkName , final String linkClass , final UUID phyUuid , final Socket socket ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; CreateLinkLayerRequestData . Builder createLinkLayerRequestMessage = CreateLinkLayerRequestData . newBuilder ( ) . setLinkLayerProductType ( linkClass ) . setLinkLayerName ( linkName ) ; if ( phyUuid != null ) { createLinkLayerRequestMessage . setPhysicalLinkUuid ( phyUuid ) ; } TerraHarvestMessage createLinkLayerMessage = TestCustomCommsNamespace . createCustomCommsMessage ( CustomCommsMessageType . CreateLinkLayerRequest , createLinkLayerRequestMessage . build ( ) ) ; createLinkLayerMessage . writeDelimitedTo ( socket . getOutputStream ( ) ) ; CustomCommsNamespace createLinkLayerResponse = ( CustomCommsNamespace ) listener . waitForMessage ( Namespace . CustomComms , CustomCommsMessageType . CreateLinkLayerResponse , TIME_OUT ) ; return CreateLinkLayerResponseData . parseFrom ( createLinkLayerResponse . getData ( ) ) ; }
Create a link comms layer.
Create a link comms layer .
//listener //---Create a link layer associated with the physical link--- // request data to create a new link layer // create terra harvest message // send out message