All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ccsds.moims.mo.platform.gps.provider.GetNMEASentenceInteraction Maven / Gradle / Ivy

package org.ccsds.moims.mo.platform.gps.provider;

/**
 * Provider INVOKE interaction class for GPS::getNMEASentence operation.
 */
public class GetNMEASentenceInteraction
{
  private org.ccsds.moims.mo.mal.provider.MALInvoke interaction;
  /**
   * Wraps the provided MAL interaction object with methods for sending responses to an INVOKE interaction from a provider.
   * @param interaction interaction The MAL interaction action object to use.
   */
  public GetNMEASentenceInteraction(org.ccsds.moims.mo.mal.provider.MALInvoke interaction)
  {
    this.interaction = interaction;
  }

  /**
   * Returns the MAL interaction object used for returning messages from the provider.
   * @return The MAL interaction object provided in the constructor.
   */
  public org.ccsds.moims.mo.mal.provider.MALInvoke getInteraction()
  {
    return interaction;
  }

  /**
   * Sends a INVOKE acknowledge to the consumer.
   * @return Returns the MAL message created by the acknowledge.
   * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a problem during the interaction as defined by the MAL specification.
   * @throws org.ccsds.moims.mo.mal.MALException if there is an implementation exception.
   */
  public org.ccsds.moims.mo.mal.transport.MALMessage sendAcknowledgement() throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException
  {
    return interaction.sendAcknowledgement((Object[]) null);
  }

  /**
   * Sends a INVOKE response to the consumer.
   * @param sentence The sentence field shall hold the NMEA sentence.
   * @return Returns the MAL message created by the response.
   * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a problem during the interaction as defined by the MAL specification.
   * @throws org.ccsds.moims.mo.mal.MALException if there is an implementation exception.
   */
  public org.ccsds.moims.mo.mal.transport.MALMessage sendResponse(String sentence) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException
  {
    return interaction.sendResponse((sentence == null) ? null : new org.ccsds.moims.mo.mal.structures.Union(sentence));
  }

  /**
   * Sends an error to the consumer.
   * @param error error The MAL error to send to the consumer.
   * @return Returns the MAL message created by the error.
   * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a problem during the interaction as defined by the MAL specification.
   * @throws org.ccsds.moims.mo.mal.MALException if there is an implementation exception.
   */
  public org.ccsds.moims.mo.mal.transport.MALMessage sendError(org.ccsds.moims.mo.mal.MALStandardError error) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException
  {
    return interaction.sendError(error);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy