mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/comms/LinkLayerMessageService.java
private Message performBIT(final LinkLayerNamespace linkLayerMessage, final TerraHarvestMessage message, 
        final RemoteChannel channel) throws InvalidProtocolBufferException
    {
        //parse request
        final PerformBITRequestData request = PerformBITRequestData.parseFrom(linkLayerMessage.getData());
        
        //response
        final PerformBITResponseData.Builder response = PerformBITResponseData.newBuilder();

        //get the link layer
        try
        {
            final LinkLayer link = CustomCommUtility.getLinkLayerByUuid(m_CommsService, request.getLinkUuid());
            
            //request link to perform its BIT
            final CustomCommsTypes.LinkStatus status = 
                    EnumConverter.convertJavaLinkStatusToProto(link.performBit());
            response.setLinkUuid(request.getLinkUuid()).setPerformBitStatus(status);
        }
        catch (final CCommException e)
        {
            final String errorDesc = String.format("A link layer with UUID [%s] could not perform a BIT because: %s.",
                SharedMessageUtils.convertProtoUUIDtoUUID(request.getLinkUuid()), e.getMessage());
            m_MessageFactory.createBaseErrorMessage(message, ErrorCode.CCOMM_ERROR, errorDesc).queue(channel);

            //log error
            m_Logging.error(e, errorDesc);
            //exit method
            return request;
        }
        //send response
        m_MessageFactory.createLinkLayerResponseMessage(message, LinkLayerMessageType.PerformBITResponse, 
            response.build()).queue(channel);
        
        return request;
    }
/**
     * Handle the request for a link layer to perform a BIT.
     * @param linkLayerMessage
     *     the message that contains the information needed to complete the perform BIT request
     * @param message
     *     the message that the request was contained within
     * @param channel
     *     the channel that the message came through
     * @return
     *     the parsed link layer request
     * @throws InvalidProtocolBufferException 
     *     message being parsed is invalid in some way 
     */
Handle the request for a link layer to perform a BIT.
Handle the request for a link layer to perform a BIT .
private Message performBIT(final LinkLayerNamespace linkLayerMessage, final TerraHarvestMessage message, 
        final RemoteChannel channel) throws InvalidProtocolBufferException
    {
        final PerformBITRequestData request = PerformBITRequestData.parseFrom(linkLayerMessage.getData());
        final PerformBITResponseData.Builder response = PerformBITResponseData.newBuilder();
        try
        {
            final LinkLayer link = CustomCommUtility.getLinkLayerByUuid(m_CommsService, request.getLinkUuid());
            final CustomCommsTypes.LinkStatus status = 
                    EnumConverter.convertJavaLinkStatusToProto(link.performBit());
            response.setLinkUuid(request.getLinkUuid()).setPerformBitStatus(status);
        }
        catch (final CCommException e)
        {
            final String errorDesc = String.format("A link layer with UUID [%s] could not perform a BIT because: %s.",
                SharedMessageUtils.convertProtoUUIDtoUUID(request.getLinkUuid()), e.getMessage());
            m_MessageFactory.createBaseErrorMessage(message, ErrorCode.CCOMM_ERROR, errorDesc).queue(channel);
            m_Logging.error(e, errorDesc);
            return request;
        }
        m_MessageFactory.createLinkLayerResponseMessage(message, LinkLayerMessageType.PerformBITResponse, 
            response.build()).queue(channel);
        return request;
    }
private Message performBIT ( final LinkLayerNamespace linkLayerMessage , final TerraHarvestMessage message , final RemoteChannel channel ) throws InvalidProtocolBufferException { final PerformBITRequestData request = PerformBITRequestData . parseFrom ( linkLayerMessage . getData ( ) ) ; final PerformBITResponseData . Builder response = PerformBITResponseData . newBuilder ( ) ; try { final LinkLayer link = CustomCommUtility . getLinkLayerByUuid ( m_CommsService , request . getLinkUuid ( ) ) ; final CustomCommsTypes . LinkStatus status = EnumConverter . convertJavaLinkStatusToProto ( link . performBit ( ) ) ; response . setLinkUuid ( request . getLinkUuid ( ) ) . setPerformBitStatus ( status ) ; } catch ( final CCommException e ) { final String errorDesc = String . format ( "A link layer with UUID [%s] could not perform a BIT because: %s." , SharedMessageUtils . convertProtoUUIDtoUUID ( request . getLinkUuid ( ) ) , e . getMessage ( ) ) ; m_MessageFactory . createBaseErrorMessage ( message , ErrorCode . CCOMM_ERROR , errorDesc ) . queue ( channel ) ; m_Logging . error ( e , errorDesc ) ; return request ; } m_MessageFactory . createLinkLayerResponseMessage ( message , LinkLayerMessageType . PerformBITResponse , response . build ( ) ) . queue ( channel ) ; return request ; }
Handle the request for a link layer to perform a BIT.
Handle the request for a link layer to perform a BIT .
//parse request //response //get the link layer //request link to perform its BIT //log error //exit method //send response