mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/comms/CustomCommsMessageService.java
private Message createPhysicalLink(final CustomCommsNamespace ccommsMessage, final TerraHarvestMessage request,
        final RemoteChannel channel) throws IOException
    {
        final CreatePhysicalLinkRequestData createPhysicalLink = 
                CreatePhysicalLinkRequestData.parseFrom(ccommsMessage.getData());
        
        final String physicalLinkName = createPhysicalLink.getPhysicalLinkName();
        final PhysicalLinkType.Enum physicalLinkType = createPhysicalLink.getPhysicalLinkType();
        
        try
        {
  
            final PhysicalLink plink = m_CommsService.createPhysicalLink(
                    PhysicalLinkTypeEnumConverter.convertProtoEnumToJava(physicalLinkType), physicalLinkName);
            final CreatePhysicalLinkResponseData.Builder responseBuilder = CreatePhysicalLinkResponseData.newBuilder().
                    setInfo(SharedMessageUtils.createFactoryObjectInfoMessage(plink));
             
            m_MessageFactory.createCustomCommsResponseMessage(request, 
                CustomCommsMessageType.CreatePhysicalLinkResponse, responseBuilder.build()).queue(channel);
        }
        catch (final CCommException e)
        {
            m_Logging.error(e, "CreatePhysicalLink: Cannot create physical link.");
            
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CCOMM_ERROR, 
                            CUSTOM_COMMS_EXCEPTION + e.getMessage()).queue(channel);
        }
        return createPhysicalLink;
    }
/**
     * Method to create a new instance of a physical link and add it to the service.
     * @param ccommsMessage
     *      request message containing the physical link class name, and name for creating a new physical link.
     * @param request
     *      entire remote message for the request
     * @param channel
     *      channel to use for sending a response
     * @return
     *      the data message for this request
     * @throws IOException
     *      if message cannot be parsed or response message cannot be sent
     */
Method to create a new instance of a physical link and add it to the service.
@param ccommsMessage
request message containing the physical link class name, and name for creating a new physical link.
@param request
entire remote message for the request
@param channel
channel to use for sending a response
@return
the data message for this request
@throws IOException
if message cannot be parsed or response message cannot be sent
Method to create a new instance of a physical link and add it to the service . @param ccommsMessage request message containing the physical link class name and name for creating a new physical link . @param request entire remote message for the request @param channel channel to use for sending a response @return the data message for this request @throws IOException if message cannot be parsed or response message cannot be sent
private Message createPhysicalLink(final CustomCommsNamespace ccommsMessage, final TerraHarvestMessage request,
        final RemoteChannel channel) throws IOException
    {
        final CreatePhysicalLinkRequestData createPhysicalLink = 
                CreatePhysicalLinkRequestData.parseFrom(ccommsMessage.getData());
        final String physicalLinkName = createPhysicalLink.getPhysicalLinkName();
        final PhysicalLinkType.Enum physicalLinkType = createPhysicalLink.getPhysicalLinkType();
        try
        {
            final PhysicalLink plink = m_CommsService.createPhysicalLink(
                    PhysicalLinkTypeEnumConverter.convertProtoEnumToJava(physicalLinkType), physicalLinkName);
            final CreatePhysicalLinkResponseData.Builder responseBuilder = CreatePhysicalLinkResponseData.newBuilder().
                    setInfo(SharedMessageUtils.createFactoryObjectInfoMessage(plink));
            m_MessageFactory.createCustomCommsResponseMessage(request, 
                CustomCommsMessageType.CreatePhysicalLinkResponse, responseBuilder.build()).queue(channel);
        }
        catch (final CCommException e)
        {
            m_Logging.error(e, "CreatePhysicalLink: Cannot create physical link.");
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CCOMM_ERROR, 
                            CUSTOM_COMMS_EXCEPTION + e.getMessage()).queue(channel);
        }
        return createPhysicalLink;
    }
private Message createPhysicalLink ( final CustomCommsNamespace ccommsMessage , final TerraHarvestMessage request , final RemoteChannel channel ) throws IOException { final CreatePhysicalLinkRequestData createPhysicalLink = CreatePhysicalLinkRequestData . parseFrom ( ccommsMessage . getData ( ) ) ; final String physicalLinkName = createPhysicalLink . getPhysicalLinkName ( ) ; final PhysicalLinkType . Enum physicalLinkType = createPhysicalLink . getPhysicalLinkType ( ) ; try { final PhysicalLink plink = m_CommsService . createPhysicalLink ( PhysicalLinkTypeEnumConverter . convertProtoEnumToJava ( physicalLinkType ) , physicalLinkName ) ; final CreatePhysicalLinkResponseData . Builder responseBuilder = CreatePhysicalLinkResponseData . newBuilder ( ) . setInfo ( SharedMessageUtils . createFactoryObjectInfoMessage ( plink ) ) ; m_MessageFactory . createCustomCommsResponseMessage ( request , CustomCommsMessageType . CreatePhysicalLinkResponse , responseBuilder . build ( ) ) . queue ( channel ) ; } catch ( final CCommException e ) { m_Logging . error ( e , "CreatePhysicalLink: Cannot create physical link." ) ; m_MessageFactory . createBaseErrorMessage ( request , ErrorCode . CCOMM_ERROR , CUSTOM_COMMS_EXCEPTION + e . getMessage ( ) ) . queue ( channel ) ; } return createPhysicalLink ; }
Method to create a new instance of a physical link and add it to the service.
Method to create a new instance of a physical link and add it to the service .