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

org.opentcs.access.rmi.services.RemoteTransportOrderServiceProxy Maven / Gradle / Ivy

There is a newer version: 6.2.0
Show newest version
/**
 * Copyright (c) The openTCS Authors.
 *
 * This program is free software and subject to the MIT license. (For details,
 * see the licensing information (LICENSE.txt) you should have received with
 * this copy of the software.)
 */
package org.opentcs.access.rmi.services;

import java.rmi.RemoteException;
import org.opentcs.access.KernelRuntimeException;
import org.opentcs.access.to.order.OrderSequenceCreationTO;
import org.opentcs.access.to.order.TransportOrderCreationTO;
import org.opentcs.components.kernel.services.TransportOrderService;
import org.opentcs.data.ObjectExistsException;
import org.opentcs.data.ObjectUnknownException;
import org.opentcs.data.TCSObjectReference;
import org.opentcs.data.model.Vehicle;
import org.opentcs.data.order.OrderSequence;
import org.opentcs.data.order.TransportOrder;

/**
 * The default implementation of the transport order service.
 * Delegates method invocations to the corresponding remote service.
 */
class RemoteTransportOrderServiceProxy
    extends
      RemoteTCSObjectServiceProxy
    implements
      TransportOrderService {

  /**
   * Creates a new instance.
   */
  RemoteTransportOrderServiceProxy() {
  }

  @Override
  public OrderSequence createOrderSequence(OrderSequenceCreationTO to)
      throws KernelRuntimeException {
    checkServiceAvailability();

    try {
      return getRemoteService().createOrderSequence(getClientId(), to);
    }
    catch (RemoteException ex) {
      throw findSuitableExceptionFor(ex);
    }
  }

  @Override
  public TransportOrder createTransportOrder(TransportOrderCreationTO to)
      throws ObjectUnknownException,
        ObjectExistsException,
        KernelRuntimeException {
    checkServiceAvailability();

    try {
      return getRemoteService().createTransportOrder(getClientId(), to);
    }
    catch (RemoteException ex) {
      throw findSuitableExceptionFor(ex);
    }
  }

  @Override
  public void markOrderSequenceComplete(TCSObjectReference ref)
      throws ObjectUnknownException,
        KernelRuntimeException {
    checkServiceAvailability();

    try {
      getRemoteService().markOrderSequenceComplete(getClientId(), ref);
    }
    catch (RemoteException ex) {
      throw findSuitableExceptionFor(ex);
    }
  }

  @Override
  public void updateTransportOrderIntendedVehicle(
      TCSObjectReference orderRef,
      TCSObjectReference vehicleRef
  )
      throws ObjectUnknownException,
        IllegalArgumentException {
    checkServiceAvailability();

    try {
      getRemoteService().updateTransportOrderIntendedVehicle(getClientId(), orderRef, vehicleRef);
    }
    catch (RemoteException ex) {
      throw findSuitableExceptionFor(ex);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy