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

org.opentcs.access.rmi.services.RemoteRouterServiceProxy 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 java.util.Map;
import java.util.Set;
import org.opentcs.access.KernelRuntimeException;
import org.opentcs.components.kernel.services.RouterService;
import org.opentcs.data.TCSObjectReference;
import org.opentcs.data.model.Path;
import org.opentcs.data.model.Point;
import org.opentcs.data.model.TCSResourceReference;
import org.opentcs.data.model.Vehicle;
import org.opentcs.data.order.Route;

/**
 * The default implementation of the router service.
 * Delegates method invocations to the corresponding remote service.
 */
class RemoteRouterServiceProxy
    extends
      AbstractRemoteServiceProxy
    implements
      RouterService {

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

  @Override
  public void updateRoutingTopology(Set> refs)
      throws KernelRuntimeException {
    checkServiceAvailability();

    try {
      getRemoteService().updateRoutingTopology(getClientId(), refs);
    }
    catch (RemoteException ex) {
      throw findSuitableExceptionFor(ex);
    }
  }

  @Override
  public Map, Route> computeRoutes(
      TCSObjectReference vehicleRef,
      TCSObjectReference sourcePointRef,
      Set> destinationPointRefs,
      Set> resourcesToAvoid
  )
      throws KernelRuntimeException {
    checkServiceAvailability();

    try {
      return getRemoteService().computeRoutes(
          getClientId(),
          vehicleRef,
          sourcePointRef,
          destinationPointRefs,
          resourcesToAvoid
      );
    }
    catch (RemoteException ex) {
      throw findSuitableExceptionFor(ex);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy