Пример #1
0
 @SuppressWarnings("boxing")
 private static void sendOpenSubscriptionRequest(
     IDatabaseCommands commands, long id, SubscriptionConnectionOptions options)
     throws SubscriptionException {
   try (HttpJsonRequest request =
       commands.createRequest(
           HttpMethods.POST,
           String.format(
               "/subscriptions/open?id=%d&connection=%s", id, options.getConnectionId()))) {
     request.write(options.toRavenObject().toString());
     request.executeRequest();
   } catch (Exception e) {
     SubscriptionException subscriptionException = tryGetSubscriptionException(e);
     if (subscriptionException != null) {
       throw subscriptionException;
     }
     throw e;
   }
 }