mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/messaging/TerraHarvestMessageUtil.java
public static TerraHarvestMessage buildEncryptionErrorResponseMessage(final TerraHarvestMessage request, 
            final EncryptionErrorCode errorCode, final String errorDescription, final EncryptionMode mode)
    {
        //build the data first
        final EncryptionInfoErrorResponseData errorResponseMessage = EncryptionInfoErrorResponseData.newBuilder().
            setError(errorCode).
            setErrorDescription(errorDescription).
            setType(EnumConverter.convertEncryptionModeToEncryptType(mode)).
            build();
        
        // build a base namespace message
        final EncryptionInfoNamespace namespaceMessage = EncryptionInfoNamespace.newBuilder().
                setType(EncryptionInfoMessageType.EncryptionInfoErrorResponse).
                setData(errorResponseMessage.toByteString()).
                build();
        //build a TerraHarvestPayLoad message
        final TerraHarvestPayload payLoad = TerraHarvestPayload.newBuilder().
                setNamespace(Namespace.EncryptionInfo).
                setNamespaceMessage(namespaceMessage.toByteString()).
                build();
        
        // build a terra harvest message
        final TerraHarvestMessage fullMessage = getPartialMessage().
                setSourceId(request.getDestId()).
                // send message back to source
                setDestId(request.getSourceId()).
                setMessageId(request.getMessageId()).
                setTerraHarvestPayload(payLoad.toByteString()).
                build();

        return fullMessage;
    }
/**
     * Creates a terra harvest message for the encryption info error response type. This method should be used for all 
     * encryption errors, as in those specific to the encryption information namespace. These errors are defined by 
     * {@link EncryptionErrorCode}. EncryptionInfo error messages are always sent unencrypted.
     * 
     * @param request
     *      request message that this error response is being sent for
     * @param errorCode
     *      represents the occurrence of a encryption error defined by the TerraHarvestMessage EncryptionErrorCode enum 
     *      type
     * @param errorDescription
     *      field can optionally describe the TerraHarvestMessage error in more detail
     * @param mode
     *      {@link EncryptionMode} of the system
     * @return 
     *      the terra harvest message created
     */
Creates a terra harvest message for the encryption info error response type. This method should be used for all
encryption errors, as in those specific to the encryption information namespace. These errors are defined by
EncryptionErrorCode. EncryptionInfo error messages are always sent unencrypted.


Creates a terra harvest message for the encryption info error response type . This method should be used for all encryption errors as in those specific to the encryption information namespace . These errors are defined by EncryptionErrorCode . EncryptionInfo error messages are always sent unencrypted .
public static TerraHarvestMessage buildEncryptionErrorResponseMessage(final TerraHarvestMessage request, 
            final EncryptionErrorCode errorCode, final String errorDescription, final EncryptionMode mode)
    {
        final EncryptionInfoErrorResponseData errorResponseMessage = EncryptionInfoErrorResponseData.newBuilder().
            setError(errorCode).
            setErrorDescription(errorDescription).
            setType(EnumConverter.convertEncryptionModeToEncryptType(mode)).
            build();
        final EncryptionInfoNamespace namespaceMessage = EncryptionInfoNamespace.newBuilder().
                setType(EncryptionInfoMessageType.EncryptionInfoErrorResponse).
                setData(errorResponseMessage.toByteString()).
                build();
        final TerraHarvestPayload payLoad = TerraHarvestPayload.newBuilder().
                setNamespace(Namespace.EncryptionInfo).
                setNamespaceMessage(namespaceMessage.toByteString()).
                build();
        final TerraHarvestMessage fullMessage = getPartialMessage().
                setSourceId(request.getDestId()).
                setDestId(request.getSourceId()).
                setMessageId(request.getMessageId()).
                setTerraHarvestPayload(payLoad.toByteString()).
                build();
        return fullMessage;
    }
public static TerraHarvestMessage buildEncryptionErrorResponseMessage ( final TerraHarvestMessage request , final EncryptionErrorCode errorCode , final String errorDescription , final EncryptionMode mode ) { final EncryptionInfoErrorResponseData errorResponseMessage = EncryptionInfoErrorResponseData . newBuilder ( ) . setError ( errorCode ) . setErrorDescription ( errorDescription ) . setType ( EnumConverter . convertEncryptionModeToEncryptType ( mode ) ) . build ( ) ; final EncryptionInfoNamespace namespaceMessage = EncryptionInfoNamespace . newBuilder ( ) . setType ( EncryptionInfoMessageType . EncryptionInfoErrorResponse ) . setData ( errorResponseMessage . toByteString ( ) ) . build ( ) ; final TerraHarvestPayload payLoad = TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . EncryptionInfo ) . setNamespaceMessage ( namespaceMessage . toByteString ( ) ) . build ( ) ; final TerraHarvestMessage fullMessage = getPartialMessage ( ) . setSourceId ( request . getDestId ( ) ) . setDestId ( request . getSourceId ( ) ) . setMessageId ( request . getMessageId ( ) ) . setTerraHarvestPayload ( payLoad . toByteString ( ) ) . build ( ) ; return fullMessage ; }
Creates a terra harvest message for the encryption info error response type.
Creates a terra harvest message for the encryption info error response type .
//build the data first // build a base namespace message //build a TerraHarvestPayLoad message // build a terra harvest message // send message back to source