mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/comms/LinkLayerMessageService.java
private Message isAvailable(final LinkLayerNamespace linkLayerMessage, final TerraHarvestMessage request, 
            final RemoteChannel channel) throws InvalidProtocolBufferException
    {
        final IsAvailableRequestData isAvailableRequest = IsAvailableRequestData.parseFrom(linkLayerMessage.getData());
        
        final String address = isAvailableRequest.getAddress();
        
        try
        {
            final LinkLayer requestedLinkLayer = CustomCommUtility.getLinkLayerByUuid(
                    m_CommsService, isAvailableRequest.getUuid());
            
            final Address linkAddress = m_AddressManagerService.getOrCreateAddress(address);
            
            final IsAvailableResponseData response = IsAvailableResponseData.newBuilder().
                setAvailable(requestedLinkLayer.isAvailable(linkAddress)).
                setUuid(isAvailableRequest.getUuid()).build();
        
            m_MessageFactory.createLinkLayerResponseMessage(request, LinkLayerMessageType.IsAvailableResponse, 
                    response).queue(channel);
        }
        catch (final CCommException e)
        {
            m_Logging.error(e, "IsAvailable: Cannot get or create address.");
            
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CCOMM_ERROR, 
                   "Custom comms error when checking if address was available: " + e.getMessage()).queue(channel);
        }
        
        return isAvailableRequest;
    }
/**
     * Check to see if an address is reachable from the specified link layer.
     * @param linkLayerMessage
     *      request message containing the specific link layer the user wants.
     * @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 InvalidProtocolBufferException
     *      message being parsed is invalid in some way
     */
Check to see if an address is reachable from the specified link layer.
@param linkLayerMessage
request message containing the specific link layer the user wants.
@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 InvalidProtocolBufferException
message being parsed is invalid in some way
Check to see if an address is reachable from the specified link layer . @param linkLayerMessage request message containing the specific link layer the user wants . @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 InvalidProtocolBufferException message being parsed is invalid in some way
private Message isAvailable(final LinkLayerNamespace linkLayerMessage, final TerraHarvestMessage request, 
            final RemoteChannel channel) throws InvalidProtocolBufferException
    {
        final IsAvailableRequestData isAvailableRequest = IsAvailableRequestData.parseFrom(linkLayerMessage.getData());
        final String address = isAvailableRequest.getAddress();
        try
        {
            final LinkLayer requestedLinkLayer = CustomCommUtility.getLinkLayerByUuid(
                    m_CommsService, isAvailableRequest.getUuid());
            final Address linkAddress = m_AddressManagerService.getOrCreateAddress(address);
            final IsAvailableResponseData response = IsAvailableResponseData.newBuilder().
                setAvailable(requestedLinkLayer.isAvailable(linkAddress)).
                setUuid(isAvailableRequest.getUuid()).build();
            m_MessageFactory.createLinkLayerResponseMessage(request, LinkLayerMessageType.IsAvailableResponse, 
                    response).queue(channel);
        }
        catch (final CCommException e)
        {
            m_Logging.error(e, "IsAvailable: Cannot get or create address.");
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CCOMM_ERROR, 
                   "Custom comms error when checking if address was available: " + e.getMessage()).queue(channel);
        }
        return isAvailableRequest;
    }
private Message isAvailable ( final LinkLayerNamespace linkLayerMessage , final TerraHarvestMessage request , final RemoteChannel channel ) throws InvalidProtocolBufferException { final IsAvailableRequestData isAvailableRequest = IsAvailableRequestData . parseFrom ( linkLayerMessage . getData ( ) ) ; final String address = isAvailableRequest . getAddress ( ) ; try { final LinkLayer requestedLinkLayer = CustomCommUtility . getLinkLayerByUuid ( m_CommsService , isAvailableRequest . getUuid ( ) ) ; final Address linkAddress = m_AddressManagerService . getOrCreateAddress ( address ) ; final IsAvailableResponseData response = IsAvailableResponseData . newBuilder ( ) . setAvailable ( requestedLinkLayer . isAvailable ( linkAddress ) ) . setUuid ( isAvailableRequest . getUuid ( ) ) . build ( ) ; m_MessageFactory . createLinkLayerResponseMessage ( request , LinkLayerMessageType . IsAvailableResponse , response ) . queue ( channel ) ; } catch ( final CCommException e ) { m_Logging . error ( e , "IsAvailable: Cannot get or create address." ) ; m_MessageFactory . createBaseErrorMessage ( request , ErrorCode . CCOMM_ERROR , "Custom comms error when checking if address was available: " + e . getMessage ( ) ) . queue ( channel ) ; } return isAvailableRequest ; }
Check to see if an address is reachable from the specified link layer.
Check to see if an address is reachable from the specified link layer .