/**
  * NotPrimaryServerException constructor.
  *
  * @param ServerInterface $primaryServer
  */
 public function __construct(ServerInterface $primaryServer)
 {
     parent::__construct(sprintf('Server is not primary of this object. Redirect to given Server "%s:%s".', $primaryServer->getHost(), $primaryServer->getPort()));
     $this->primaryServer = $primaryServer;
 }
Example #2
0
 public function fetch($hash, $class, ServerInterface $server)
 {
     $route = $this->router->generate('get_object', array('hash' => $hash, 'class' => $class));
     $response = $this->client->get($server->getUrl($route));
     return $response->getBody()->getContents();
 }