mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/RemotePhysicalLinkUtils.java
public static CreatePhysicalLinkResponseData createPhysicalCommLayer(
            final CustomCommTypesGen.PhysicalLinkType.Enum type, 
            final String name, final Socket socket) throws IOException
    {
        //listener
        MessageListener listener = new MessageListener(socket);
        
        // request data to create a new physical link
        CreatePhysicalLinkRequestData request = CreatePhysicalLinkRequestData.newBuilder().
                setPhysicalLinkType(type).
                setPhysicalLinkName(name).
                build();
        
        CustomCommsNamespace.Builder customCommsMessage = CustomCommsNamespace.newBuilder().
                setType(CustomCommsMessageType.CreatePhysicalLinkRequest).
                setData(request.toByteString());
        
        TerraHarvestMessage message = TerraHarvestMessageHelper.
                createTerraHarvestMsg(Namespace.CustomComms, customCommsMessage);
        
        message.writeDelimitedTo(socket.getOutputStream());
        
        // listen for messages for a specific time interval        
        CustomCommsNamespace namespaceResponse = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms, 
                        CustomCommsMessageType.CreatePhysicalLinkResponse, TIME_OUT);
        return CreatePhysicalLinkResponseData.parseFrom(namespaceResponse.getData());
    }
/**
     * Create a physical link comms layer.
     * @param type
     *     type of physical link to create
     * @param name
     *     the name to set for the layer
     * @param socket
     *     the socket to use for the request
     * @return
     *     the response message from creating the layer
     */
Create a physical link comms layer.
@param type
type of physical link to create
@param name
the name to set for the layer
@param socket
the socket to use for the request
@return
the response message from creating the layer
Create a physical link comms layer . @param type type of physical link to create @param name the name to set for the layer @param socket the socket to use for the request @return the response message from creating the layer
public static CreatePhysicalLinkResponseData createPhysicalCommLayer(
            final CustomCommTypesGen.PhysicalLinkType.Enum type, 
            final String name, final Socket socket) throws IOException
    {
        MessageListener listener = new MessageListener(socket);
        CreatePhysicalLinkRequestData request = CreatePhysicalLinkRequestData.newBuilder().
                setPhysicalLinkType(type).
                setPhysicalLinkName(name).
                build();
        CustomCommsNamespace.Builder customCommsMessage = CustomCommsNamespace.newBuilder().
                setType(CustomCommsMessageType.CreatePhysicalLinkRequest).
                setData(request.toByteString());
        TerraHarvestMessage message = TerraHarvestMessageHelper.
                createTerraHarvestMsg(Namespace.CustomComms, customCommsMessage);
        message.writeDelimitedTo(socket.getOutputStream());
        CustomCommsNamespace namespaceResponse = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms, 
                        CustomCommsMessageType.CreatePhysicalLinkResponse, TIME_OUT);
        return CreatePhysicalLinkResponseData.parseFrom(namespaceResponse.getData());
    }
public static CreatePhysicalLinkResponseData createPhysicalCommLayer ( final CustomCommTypesGen . PhysicalLinkType . Enum type , final String name , final Socket socket ) throws IOException { MessageListener listener = new MessageListener ( socket ) ; CreatePhysicalLinkRequestData request = CreatePhysicalLinkRequestData . newBuilder ( ) . setPhysicalLinkType ( type ) . setPhysicalLinkName ( name ) . build ( ) ; CustomCommsNamespace . Builder customCommsMessage = CustomCommsNamespace . newBuilder ( ) . setType ( CustomCommsMessageType . CreatePhysicalLinkRequest ) . setData ( request . toByteString ( ) ) ; TerraHarvestMessage message = TerraHarvestMessageHelper . createTerraHarvestMsg ( Namespace . CustomComms , customCommsMessage ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; CustomCommsNamespace namespaceResponse = ( CustomCommsNamespace ) listener . waitForMessage ( Namespace . CustomComms , CustomCommsMessageType . CreatePhysicalLinkResponse , TIME_OUT ) ; return CreatePhysicalLinkResponseData . parseFrom ( namespaceResponse . getData ( ) ) ; }
Create a physical link comms layer.
Create a physical link comms layer .
//listener // request data to create a new physical link // listen for messages for a specific time interval        