mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/comms/TransportLayerMessageService.java
private Message isAvailable(final TransportLayerNamespace transportLayerMessage, final TerraHarvestMessage request,
            final RemoteChannel channel) throws InvalidProtocolBufferException
    {
        final IsAvailableRequestData isAvailableRequest = IsAvailableRequestData.parseFrom(
                transportLayerMessage.getData());
        final String address = isAvailableRequest.getAddress();
        
        try
        {
            final TransportLayer requestedTransportLayer = CustomCommUtility.getTransportLayerByUuid(m_CommsService, 
                    isAvailableRequest.getUuid());
            
            final Address transportAddress = m_AddressManagerService.getOrCreateAddress(address);
            
            final IsAvailableResponseData response = IsAvailableResponseData.newBuilder().
                setIsAvailable(requestedTransportLayer.isAvailable(transportAddress)).
                setUuid(isAvailableRequest.getUuid()).build();
            
            m_MessageFactory.createTransportLayerResponseMessage(request, 
                    TransportLayerMessageType.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;
    }
/**
     * Get whether or not an {@link Address} can be reached by the specified {@link TransportLayer}.
     * @param transportLayerMessage
     *      request message containing the specific transport layer to see if an address is available to it.
     * @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
     *      thrown when a message being parsed is invalid in some way
     */
Get whether or not an  Address can be reached by the specified  TransportLayer.
@param transportLayerMessage
request message containing the specific transport layer to see if an address is available to it.
@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
thrown when a message being parsed is invalid in some way
Get whether or not an Address can be reached by the specified TransportLayer . @param transportLayerMessage request message containing the specific transport layer to see if an address is available to it . @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 thrown when a message being parsed is invalid in some way
private Message isAvailable(final TransportLayerNamespace transportLayerMessage, final TerraHarvestMessage request,
            final RemoteChannel channel) throws InvalidProtocolBufferException
    {
        final IsAvailableRequestData isAvailableRequest = IsAvailableRequestData.parseFrom(
                transportLayerMessage.getData());
        final String address = isAvailableRequest.getAddress();
        try
        {
            final TransportLayer requestedTransportLayer = CustomCommUtility.getTransportLayerByUuid(m_CommsService, 
                    isAvailableRequest.getUuid());
            final Address transportAddress = m_AddressManagerService.getOrCreateAddress(address);
            final IsAvailableResponseData response = IsAvailableResponseData.newBuilder().
                setIsAvailable(requestedTransportLayer.isAvailable(transportAddress)).
                setUuid(isAvailableRequest.getUuid()).build();
            m_MessageFactory.createTransportLayerResponseMessage(request, 
                    TransportLayerMessageType.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 TransportLayerNamespace transportLayerMessage , final TerraHarvestMessage request , final RemoteChannel channel ) throws InvalidProtocolBufferException { final IsAvailableRequestData isAvailableRequest = IsAvailableRequestData . parseFrom ( transportLayerMessage . getData ( ) ) ; final String address = isAvailableRequest . getAddress ( ) ; try { final TransportLayer requestedTransportLayer = CustomCommUtility . getTransportLayerByUuid ( m_CommsService , isAvailableRequest . getUuid ( ) ) ; final Address transportAddress = m_AddressManagerService . getOrCreateAddress ( address ) ; final IsAvailableResponseData response = IsAvailableResponseData . newBuilder ( ) . setIsAvailable ( requestedTransportLayer . isAvailable ( transportAddress ) ) . setUuid ( isAvailableRequest . getUuid ( ) ) . build ( ) ; m_MessageFactory . createTransportLayerResponseMessage ( request , TransportLayerMessageType . 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 ; }
Get whether or not an {@link Address} can be reached by the specified {@link TransportLayer}.
Get whether or not an { @link Address } can be reached by the specified { @link TransportLayer } .