/*
 * Copyright (c) 2016 Open Baton (http://www.openbaton.org)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package org.openbaton.nfvo.common.configuration;

public class RabbitConfiguration {

  public static final String QUEUE_DURABLE = "true";
  public static final String QUEUE_AUTODELETE = "true";
  public static final String QUEUE_NAME_MANAGER_REGISTER = "nfvo.manager.handling";
  public static final String QUEUE_NAME_VNFM_CORE_ACTIONS = "vnfm.nfvo.actions";
  public static final String QUEUE_NAME_VNFM_CORE_ACTIONS_REPLY = "vnfm.nfvo.actions.reply";
  public static final String QUEUE_NAME_EVENT_REGISTER = "nfvo.event.register";
  public static final String QUEUE_NAME_EVENT_UNREGISTER = "nfvo.event.unregister";
  public static final String EXCHANGE_NAME_OPENBATON = "openbaton-exchange";
  public static final String EXCHANGE_TYPE_OPENBATON = "topic";
  public static final String EXCHANGE_DURABLE_OPENBATON = "true";

  //  /**
  //   * Extension of Spring-AMQP's {@link ConditionalRejectingErrorHandler.DefaultExceptionStrategy}.
  //   * It regards a {@link JsonSyntaxException}, which may appear while demarshalling a message from a
  //   * queue, as fatal and drops it. Otherwise the message would be sent back to the queue resulting
  //   * in an infinite loop.
  //   */
  //  private class HandleJsonSyntaxExceptionStrategy implements FatalExceptionStrategy {
  //
  //    private Logger log = LoggerFactory.getLogger(this.getClass());
  //
  //    @Override
  //    public boolean isFatal(Throwable t) {
  //      if (t instanceof ListenerExecutionFailedException
  //          && (t.getCause() instanceof MessageConversionException
  //              || t.getCause() instanceof JsonSyntaxException)) {
  //        log.error(
  //            "Fatal message conversion error; message rejected; "
  //                + "it will be dropped or routed to a dead letter exchange, if so configured: "
  //                + ((ListenerExecutionFailedException) t).getFailedMessage(),
  //            t);
  //        return true;
  //      }
  //      return false;
  //    }
  //  }
}

@@ -1452,1171 +1452,6 @@
 %22;%0A%0A
-  //  /**%0A  //   * Extension of Spring-AMQP's %7B@link ConditionalRejectingErrorHandler.DefaultExceptionStrategy%7D.%0A  //   * It regards a %7B@link JsonSyntaxException%7D, which may appear while demarshalling a message from a%0A  //   * queue, as fatal and drops it. Otherwise the message would be sent back to the queue resulting%0A  //   * in an infinite loop.%0A  //   */%0A  //  private class HandleJsonSyntaxExceptionStrategy implements FatalExceptionStrategy %7B%0A  //%0A  //    private Logger log = LoggerFactory.getLogger(this.getClass());%0A  //%0A  //    @Override%0A  //    public boolean isFatal(Throwable t) %7B%0A  //      if (t instanceof ListenerExecutionFailedException%0A  //          && (t.getCause() instanceof MessageConversionException%0A  //              %7C%7C t.getCause() instanceof JsonSyntaxException)) %7B%0A  //        log.error(%0A  //            %22Fatal message conversion error; message rejected; %22%0A  //                + %22it will be dropped or routed to a dead letter exchange, if so configured: %22%0A  //                + ((ListenerExecutionFailedException) t).getFailedMessage(),%0A  //            t);%0A  //        return true;%0A  //      %7D%0A  //      return false;%0A  //    %7D%0A  //  %7D%0A
 %7D%0A

clean leftover commented code