mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/asset/AssetMessageService.java
private Message performBit(final AssetNamespace message, final TerraHarvestMessage request, 
        final RemoteChannel channel) throws IOException
    {
        final PerformBitRequestData bitRequest = PerformBitRequestData.parseFrom(message.getData());
        
        if (bitRequest.getStatusObservationFormat() != RemoteTypesGen.LexiconFormat.Enum.NATIVE)
        {
            throw new UnsupportedOperationException(
                    String.format("Lexicon format %s is not valid for perform BIT status observations", 
                            bitRequest.getStatusObservationFormat())); 
        }
        
        final Asset asset = m_AssetDirectoryService.getAssetByUuid(SharedMessageUtils.
                    convertProtoUUIDtoUUID(bitRequest.getUuid()));
 
        final Observation statusObs = asset.performBit();
        try
        {
            final PerformBitResponseData response = PerformBitResponseData.newBuilder()
                .setAssetUuid(bitRequest.getUuid())
                .setStatusObservationNative(
                        (ObservationGen.Observation)m_Converter.convertToProto(statusObs))
                .build();

            m_MessageFactory.createAssetResponseMessage(request, AssetMessageType.PerformBitResponse,
                response).queue(channel);
        }
        catch (final ObjectConverterException e)
        {
            m_Logging.error(e, "Cannot convert the status to a proto message after performing BIT for asset [%s].", 
                    asset.getName());
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CONVERTER_ERROR, 
                    GENERIC_ERR_MSG + e.getMessage()).queue(channel);
        } 
        return bitRequest;
    }
/**
     * Method responsible for performing a Built-In Test (BIT) on an asset based on the asset UUID contained
     * in the request message.  The summary of the BIT is contained in the response message.   
     * @param message
     *      perform BIT request message containing the UUID of the asset status to be queried
     * @param request
     *      entire remote message for the request
     * @param channel
     *    the channel that was used to send request
     * @return
     *      the data message for this request
     * @throws IOException
     *      if message cannot be parsed or if response message cannot be sent
     */
Method responsible for performing a Built-In Test (BIT) on an asset based on the asset UUID contained
in the request message.  The summary of the BIT is contained in the response message.
Method responsible for performing a Built - In Test ( BIT ) on an asset based on the asset UUID contained in the request message . The summary of the BIT is contained in the response message .
private Message performBit(final AssetNamespace message, final TerraHarvestMessage request, 
        final RemoteChannel channel) throws IOException
    {
        final PerformBitRequestData bitRequest = PerformBitRequestData.parseFrom(message.getData());
        if (bitRequest.getStatusObservationFormat() != RemoteTypesGen.LexiconFormat.Enum.NATIVE)
        {
            throw new UnsupportedOperationException(
                    String.format("Lexicon format %s is not valid for perform BIT status observations", 
                            bitRequest.getStatusObservationFormat())); 
        }
        final Asset asset = m_AssetDirectoryService.getAssetByUuid(SharedMessageUtils.
                    convertProtoUUIDtoUUID(bitRequest.getUuid()));
        final Observation statusObs = asset.performBit();
        try
        {
            final PerformBitResponseData response = PerformBitResponseData.newBuilder()
                .setAssetUuid(bitRequest.getUuid())
                .setStatusObservationNative(
                        (ObservationGen.Observation)m_Converter.convertToProto(statusObs))
                .build();
            m_MessageFactory.createAssetResponseMessage(request, AssetMessageType.PerformBitResponse,
                response).queue(channel);
        }
        catch (final ObjectConverterException e)
        {
            m_Logging.error(e, "Cannot convert the status to a proto message after performing BIT for asset [%s].", 
                    asset.getName());
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CONVERTER_ERROR, 
                    GENERIC_ERR_MSG + e.getMessage()).queue(channel);
        } 
        return bitRequest;
    }
private Message performBit ( final AssetNamespace message , final TerraHarvestMessage request , final RemoteChannel channel ) throws IOException { final PerformBitRequestData bitRequest = PerformBitRequestData . parseFrom ( message . getData ( ) ) ; if ( bitRequest . getStatusObservationFormat ( ) != RemoteTypesGen . LexiconFormat . Enum . NATIVE ) { throw new UnsupportedOperationException ( String . format ( "Lexicon format %s is not valid for perform BIT status observations" , bitRequest . getStatusObservationFormat ( ) ) ) ; } final Asset asset = m_AssetDirectoryService . getAssetByUuid ( SharedMessageUtils . convertProtoUUIDtoUUID ( bitRequest . getUuid ( ) ) ) ; final Observation statusObs = asset . performBit ( ) ; try { final PerformBitResponseData response = PerformBitResponseData . newBuilder ( ) . setAssetUuid ( bitRequest . getUuid ( ) ) . setStatusObservationNative ( ( ObservationGen . Observation ) m_Converter . convertToProto ( statusObs ) ) . build ( ) ; m_MessageFactory . createAssetResponseMessage ( request , AssetMessageType . PerformBitResponse , response ) . queue ( channel ) ; } catch ( final ObjectConverterException e ) { m_Logging . error ( e , "Cannot convert the status to a proto message after performing BIT for asset [%s]." , asset . getName ( ) ) ; m_MessageFactory . createBaseErrorMessage ( request , ErrorCode . CONVERTER_ERROR , GENERIC_ERR_MSG + e . getMessage ( ) ) . queue ( channel ) ; } return bitRequest ; }
Method responsible for performing a Built-In Test (BIT) on an asset based on the asset UUID contained
 in the request message.
Method responsible for performing a Built - In Test ( BIT ) on an asset based on the asset UUID contained in the request message .