mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/messaging/MessageSenderImpl.java
private EncryptType determineEncryptionLevel(final int destId, final TerraHarvestPayload payload)
    {
        final Namespace namespace = payload.getNamespace();
        if (m_RemoteSystemEncryption == null && namespace != Namespace.EncryptionInfo)
        {
            throw new IllegalStateException(String.format("The message for Namespace %s cannot be queued without the " 
                    + "encryption type included because there is not a RemoteSystemEncryption service available.", 
                        namespace));
        }
        else if (namespace == Namespace.EncryptionInfo)
        {
            return EncryptType.NONE;
        }
        
        final EncryptType sysEncryptType = 
                EnumConverter.convertEncryptionModeToEncryptType(m_RemoteSettings.getEncryptionMode());
        final EncryptType remoteEncryptType = m_RemoteSystemEncryption.getEncryptType(destId);
        if (remoteEncryptType == null)
        {
            throw new IllegalArgumentException(String.format("Encryption type is not known for system with id 0x%08X", 
                    destId));
        }
        
        if (sysEncryptType.getNumber() < remoteEncryptType.getNumber())
        {
            return remoteEncryptType;
        }

        return sysEncryptType;
    }
/**
     * Method that checks the encryption level of the remote system the message being sent to versus the local system 
     * and returns the highest encryption level of the two or none if the message belongs to the 
     * {@link Namespace#EncryptionInfo}.
     * 
     * @param destId
     *      ID of the system the message is being sent to.
     * @param payload
     *      {@link TerraHarvestPayload} that the message is sending. Used to determine if the namespace of the message
     *      is of the encryption info type.
     * @return
     *      {@link EncryptType} that represents the local system encryption level.
     */
Method that checks the encryption level of the remote system the message being sent to versus the local system
and returns the highest encryption level of the two or none if the message belongs to the
Namespace#EncryptionInfo.

@param destId
ID of the system the message is being sent to.
@param payload
TerraHarvestPayload that the message is sending. Used to determine if the namespace of the message
is of the encryption info type.
@return
EncryptType that represents the local system encryption level.
Method that checks the encryption level of the remote system the message being sent to versus the local system and returns the highest encryption level of the two or none if the message belongs to the Namespace#EncryptionInfo . @param destId ID of the system the message is being sent to . @param payload TerraHarvestPayload that the message is sending . Used to determine if the namespace of the message is of the encryption info type . @return EncryptType that represents the local system encryption level .
private EncryptType determineEncryptionLevel(final int destId, final TerraHarvestPayload payload)
    {
        final Namespace namespace = payload.getNamespace();
        if (m_RemoteSystemEncryption == null && namespace != Namespace.EncryptionInfo)
        {
            throw new IllegalStateException(String.format("The message for Namespace %s cannot be queued without the " 
                    + "encryption type included because there is not a RemoteSystemEncryption service available.", 
                        namespace));
        }
        else if (namespace == Namespace.EncryptionInfo)
        {
            return EncryptType.NONE;
        }
        final EncryptType sysEncryptType = 
                EnumConverter.convertEncryptionModeToEncryptType(m_RemoteSettings.getEncryptionMode());
        final EncryptType remoteEncryptType = m_RemoteSystemEncryption.getEncryptType(destId);
        if (remoteEncryptType == null)
        {
            throw new IllegalArgumentException(String.format("Encryption type is not known for system with id 0x%08X", 
                    destId));
        }
        if (sysEncryptType.getNumber() < remoteEncryptType.getNumber())
        {
            return remoteEncryptType;
        }
        return sysEncryptType;
    }
private EncryptType determineEncryptionLevel ( final int destId , final TerraHarvestPayload payload ) { final Namespace namespace = payload . getNamespace ( ) ; if ( m_RemoteSystemEncryption == null && namespace != Namespace . EncryptionInfo ) { throw new IllegalStateException ( String . format ( "The message for Namespace %s cannot be queued without the " + "encryption type included because there is not a RemoteSystemEncryption service available." , namespace ) ) ; } else if ( namespace == Namespace . EncryptionInfo ) { return EncryptType . NONE ; } final EncryptType sysEncryptType = EnumConverter . convertEncryptionModeToEncryptType ( m_RemoteSettings . getEncryptionMode ( ) ) ; final EncryptType remoteEncryptType = m_RemoteSystemEncryption . getEncryptType ( destId ) ; if ( remoteEncryptType == null ) { throw new IllegalArgumentException ( String . format ( "Encryption type is not known for system with id 0x%08X" , destId ) ) ; } if ( sysEncryptType . getNumber ( ) < remoteEncryptType . getNumber ( ) ) { return remoteEncryptType ; } return sysEncryptType ; }
Method that checks the encryption level of the remote system the message being sent to versus the local system
 and returns the highest encryption level of the two or none if the message belongs to the
 {@link Namespace#EncryptionInfo}.
Method that checks the encryption level of the remote system the message being sent to versus the local system and returns the highest encryption level of the two or none if the message belongs to the { @link Namespace#EncryptionInfo } .