protected function getProxyObject(ObjectId $umi, $buildDepth) {
    self::$logger->debug("Get proxy object for: ".$umi);

    // local objects don't have a proxy
    if (strlen($umi->getPrefix()) == 0) {
      return null;
    }

    // check if the proxy object was loaded already
    $proxy = $this->getRegisteredProxyObject($umi, $buildDepth);

    // search the proxy object if requested for the first time
    if (!$proxy) {
      $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
      $isRemoteCapableFacade = ($persistenceFacade instanceof RemoteCapablePersistenceFacadeImpl);
      $oldState = true;
      if ($isRemoteCapableFacade) {
        $oldState = $persistenceFacade->isResolvingProxies();
        $persistenceFacade->setResolveProxies(false);
      }
      $proxy = $persistenceFacade->loadFirstObject($umi->getType(), $buildDepth, [$umi->getType().'.umi' => $umi->toString()]);
      if ($isRemoteCapableFacade) {
        $persistenceFacade->setResolveProxies($oldState);
      }
      if (!$proxy) {
        // the proxy has to be created
        self::$logger->debug("Creating...");
        $proxy = $persistenceFacade->create($umi->getType(), BuildDepth::SINGLE);
        $proxy->setValue('umi', $umi);
        $proxy->save();
      }
      $this->registerProxyObject($umi, $proxy, $buildDepth);
    }
    self::$logger->debug("Proxy oid: ".$proxy->getOID());
    return $proxy;
  }