mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/mp/MissionProgrammingMessageService.java
private Message loadParameters(final TerraHarvestMessage request, final MissionProgrammingNamespace message,
            final RemoteChannel channel) 
            throws IOException
    {
        //get the parameter data
        final LoadParametersRequestData params = LoadParametersRequestData.parseFrom(message.getData());
        try
        {
            //convert the data to a MissionProgramTemplate            
            final MissionProgramParameters parameters = 
                (MissionProgramParameters)m_Converter.convertToJaxb(params.getParameters());
            m_Manager.loadParameters(parameters);
            //if all of the above is successful send response, message is null as there is no data
            m_MessageFactory.createMissionProgrammingResponseMessage(request, 
                    MissionProgrammingMessageType.LoadParametersResponse, null).queue(channel);
        }
        catch (final ObjectConverterException exception) 
        {
            //if the jaxb converter was unable to create an object
            final String errorDesc = "Failed to create parameters object from message. ";
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CONVERTER_ERROR,
                errorDesc + exception.getMessage()).queue(channel);
            m_Logging.error(exception, errorDesc);
        }
        catch (final PersistenceFailedException exception)
        {
            //if the jaxb converter was unable to create an object
            final String errorDesc = "Failed to persist parameters from message. ";
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.PERSIST_ERROR,
                    errorDesc + exception.getMessage()).queue(channel);
            m_Logging.error(exception, errorDesc);
        }
        return params;
    }
/**
     * Add parameters and a schedule to {@link MissionProgramManager}.
     * 
     * @param request
     *     full request message
     * @param message
     *    message that includes parameters, a schedule, and the name of the template to use
     * @param channel
     *      channel to use for sending a response
     * @throws IOException
     *    if the response fails to be sent
     * @return
     *      the data message for this request 
     */
Add parameters and a schedule to  MissionProgramManager.


Add parameters and a schedule to MissionProgramManager .
private Message loadParameters(final TerraHarvestMessage request, final MissionProgrammingNamespace message,
            final RemoteChannel channel) 
            throws IOException
    {
        final LoadParametersRequestData params = LoadParametersRequestData.parseFrom(message.getData());
        try
        {
            final MissionProgramParameters parameters = 
                (MissionProgramParameters)m_Converter.convertToJaxb(params.getParameters());
            m_Manager.loadParameters(parameters);
            m_MessageFactory.createMissionProgrammingResponseMessage(request, 
                    MissionProgrammingMessageType.LoadParametersResponse, null).queue(channel);
        }
        catch (final ObjectConverterException exception) 
        {
            final String errorDesc = "Failed to create parameters object from message. ";
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.CONVERTER_ERROR,
                errorDesc + exception.getMessage()).queue(channel);
            m_Logging.error(exception, errorDesc);
        }
        catch (final PersistenceFailedException exception)
        {
            final String errorDesc = "Failed to persist parameters from message. ";
            m_MessageFactory.createBaseErrorMessage(request, ErrorCode.PERSIST_ERROR,
                    errorDesc + exception.getMessage()).queue(channel);
            m_Logging.error(exception, errorDesc);
        }
        return params;
    }
private Message loadParameters ( final TerraHarvestMessage request , final MissionProgrammingNamespace message , final RemoteChannel channel ) throws IOException { final LoadParametersRequestData params = LoadParametersRequestData . parseFrom ( message . getData ( ) ) ; try { final MissionProgramParameters parameters = ( MissionProgramParameters ) m_Converter . convertToJaxb ( params . getParameters ( ) ) ; m_Manager . loadParameters ( parameters ) ; m_MessageFactory . createMissionProgrammingResponseMessage ( request , MissionProgrammingMessageType . LoadParametersResponse , null ) . queue ( channel ) ; } catch ( final ObjectConverterException exception ) { final String errorDesc = "Failed to create parameters object from message. " ; m_MessageFactory . createBaseErrorMessage ( request , ErrorCode . CONVERTER_ERROR , errorDesc + exception . getMessage ( ) ) . queue ( channel ) ; m_Logging . error ( exception , errorDesc ) ; } catch ( final PersistenceFailedException exception ) { final String errorDesc = "Failed to persist parameters from message. " ; m_MessageFactory . createBaseErrorMessage ( request , ErrorCode . PERSIST_ERROR , errorDesc + exception . getMessage ( ) ) . queue ( channel ) ; m_Logging . error ( exception , errorDesc ) ; } return params ; }
Add parameters and a schedule to {@link MissionProgramManager}.
Add parameters and a schedule to { @link MissionProgramManager } .
//get the parameter data //convert the data to a MissionProgramTemplate             //if all of the above is successful send response, message is null as there is no data //if the jaxb converter was unable to create an object //if the jaxb converter was unable to create an object