// Path: core/src/main/java/org/camunda/connect/spi/ConnectorInvocation.java
// public interface ConnectorInvocation {
// 
//   /**
//    * The underlying raw request.
//    * @return the raw request as executed by the connector
//    */
//   public Object getTarget();
// 
//   /**
//    * <p>The connector request as created through the API. Accessing the request from an
//    * interceptor may be useful for setting additional properties on the raw request
//    * (returned by {@link #getTarget()}) that are not supported by the connector.</p>
//    *
//    * <p>NOTE: setting parameters on the request (via) {@link ConnectorRequest#setRequestParameter(String, Object)}
//    * will not have any effects once the request is executed.</p>
//    *
//    * @return the connector request
//    */
//   public ConnectorRequest<?> getRequest();
// 
//   /**
//    * Makes the request proceed through the interceptor chain.
//    * {@link ConnectorRequestInterceptor} implementations are responsible for
//    * calling this method on the invocation.
//    *
//    * @return the result of the invocation.
//    * @throws Exception
//    */
//   public Object proceed() throws Exception;
// 
// }
// 
// Path: core/src/main/java/org/camunda/connect/spi/ConnectorRequestInterceptor.java
// public interface ConnectorRequestInterceptor {
// 
//   /**
//    * <p>Intercept and handle the actual invocation. An implementation of this method *must*
//    * call <code>invocation.proceed();</code> and return the result:</p>
//    *
//    * <pre>
//    *  public Object handleInvocation(ConnectorInvocation invocation) throws Exception {
//    *    // do something before the request
//    *    try {
//    *      Object result = invocation.proceed();
//    *      // do something after a successful request
//    *      return result;
//    *    } catch(Exception e) {
//    *      // do something after a failed request
//    *      throw e;
//    *    }
//    *  }
//    * </pre>
//    *
//    * <p>This may be useful for "management" use cases such as logging, failure tracking etc... and
//    * modifying the Thread context of the request thread (Security Context, Transactions, ...).</p>
//    *
//    * <p>It is also possible for an implementation to access and modify the low level "raw" request
//    * object before it is executed by the connector:</p>
//    * <pre>
//    *  public Object handleInvocation(ConnectorInvocation invocation) throws Exception {
//    *    Object rawRequest = invocation.getTarget();
//    *    // cast rawRequest to the low-level connector implementation object and work with it.
//    *
//    *    // finally
//    *    return invocation.proceed();
//    *  }
//    * </pre>
//    *
//    * @param invocation the invocation
//    * @return the result of the invocation
//    * @throws Exception
//    */
//   Object handleInvocation(ConnectorInvocation invocation) throws Exception;
// 
// }
// 
// Path: core/src/main/java/org/camunda/connect/spi/ConnectorRequest.java
// public interface ConnectorRequest<R extends ConnectorResponse> {
// 
//   /**
//    * Provides the named input parameters of the request.
//    *
//    * @param params the named input parameters of the request.
//    */
//   void setRequestParameters(Map<String, Object> params);
// 
//   /**
//    * Provides a named input parameters to the request.
//    * @param name the name of the parameter
//    * @param value the value of the parameter
//    */
//   void setRequestParameter(String name, Object value);
// 
//   /**
//    * Returns the map of request parameters
//    * @return the map of request parameters
//    */
//   Map<String, Object> getRequestParameters();
// 
//   /**
//    * Returns the value of a request parameter
//    * @param name the name of the request parameter
//    * @return the value of the request parameter of 'null' if the parameter is not set.
//    */
//   <V> V getRequestParameter(String name);
// 
//   /**
//    * Execute the request. Once a request is configured with all input
//    * parameters, it can be executed.
//    *
//    * @return the return value of the request.
//    */
//   R execute();
// 
// }


import org.camunda.connect.spi.ConnectorInvocation;
import org.camunda.connect.spi.ConnectorRequestInterceptor;
import org.camunda.connect.spi.ConnectorRequest;
/*
 * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
 * under one or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information regarding copyright
 * ownership. Camunda licenses this file to you under the Apache License,
 * Version 2.0; 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.camunda.connect.impl;


/**
 * <p>
 *   A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
 *   and the raw request ({@link #getTarget()}) for debugging purpose.
 * </p>
 *
 * <p>
 *   The boolean constructor flag determines whether the request invocation should be continued
 *   or aborted after this interceptor. Also it is possible to add a response object which
 *   will returned without further passing the interceptor chain;
 * </p>
 *
 * @author Sebastian Menski
 */
public class DebugRequestInterceptor implements ConnectorRequestInterceptor {

  protected Object response;
  protected boolean proceed;

  private ConnectorRequest<?> request;
  private Object target;

// Path: core/src/main/java/org/camunda/connect/spi/ConnectorInvocation.java
// public interface ConnectorInvocation {
// 
//   /**
//    * The underlying raw request.
//    * @return the raw request as executed by the connector
//    */
//   public Object getTarget();
// 
//   /**
//    * <p>The connector request as created through the API. Accessing the request from an
//    * interceptor may be useful for setting additional properties on the raw request
//    * (returned by {@link #getTarget()}) that are not supported by the connector.</p>
//    *
//    * <p>NOTE: setting parameters on the request (via) {@link ConnectorRequest#setRequestParameter(String, Object)}
//    * will not have any effects once the request is executed.</p>
//    *
//    * @return the connector request
//    */
//   public ConnectorRequest<?> getRequest();
// 
//   /**
//    * Makes the request proceed through the interceptor chain.
//    * {@link ConnectorRequestInterceptor} implementations are responsible for
//    * calling this method on the invocation.
//    *
//    * @return the result of the invocation.
//    * @throws Exception
//    */
//   public Object proceed() throws Exception;
// 
// }
// 
// Path: core/src/main/java/org/camunda/connect/spi/ConnectorRequestInterceptor.java
// public interface ConnectorRequestInterceptor {
// 
//   /**
//    * <p>Intercept and handle the actual invocation. An implementation of this method *must*
//    * call <code>invocation.proceed();</code> and return the result:</p>
//    *
//    * <pre>
//    *  public Object handleInvocation(ConnectorInvocation invocation) throws Exception {
//    *    // do something before the request
//    *    try {
//    *      Object result = invocation.proceed();
//    *      // do something after a successful request
//    *      return result;
//    *    } catch(Exception e) {
//    *      // do something after a failed request
//    *      throw e;
//    *    }
//    *  }
//    * </pre>
//    *
//    * <p>This may be useful for "management" use cases such as logging, failure tracking etc... and
//    * modifying the Thread context of the request thread (Security Context, Transactions, ...).</p>
//    *
//    * <p>It is also possible for an implementation to access and modify the low level "raw" request
//    * object before it is executed by the connector:</p>
//    * <pre>
//    *  public Object handleInvocation(ConnectorInvocation invocation) throws Exception {
//    *    Object rawRequest = invocation.getTarget();
//    *    // cast rawRequest to the low-level connector implementation object and work with it.
//    *
//    *    // finally
//    *    return invocation.proceed();
//    *  }
//    * </pre>
//    *
//    * @param invocation the invocation
//    * @return the result of the invocation
//    * @throws Exception
//    */
//   Object handleInvocation(ConnectorInvocation invocation) throws Exception;
// 
// }
// 
// Path: core/src/main/java/org/camunda/connect/spi/ConnectorRequest.java
// public interface ConnectorRequest<R extends ConnectorResponse> {
// 
//   /**
//    * Provides the named input parameters of the request.
//    *
//    * @param params the named input parameters of the request.
//    */
//   void setRequestParameters(Map<String, Object> params);
// 
//   /**
//    * Provides a named input parameters to the request.
//    * @param name the name of the parameter
//    * @param value the value of the parameter
//    */
//   void setRequestParameter(String name, Object value);
// 
//   /**
//    * Returns the map of request parameters
//    * @return the map of request parameters
//    */
//   Map<String, Object> getRequestParameters();
// 
//   /**
//    * Returns the value of a request parameter
//    * @param name the name of the request parameter
//    * @return the value of the request parameter of 'null' if the parameter is not set.
//    */
//   <V> V getRequestParameter(String name);
// 
//   /**
//    * Execute the request. Once a request is configured with all input
//    * parameters, it can be executed.
//    *
//    * @return the return value of the request.
//    */
//   R execute();
// 
// }


// Path: core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java
import org.camunda.connect.spi.ConnectorInvocation;
import org.camunda.connect.spi.ConnectorRequestInterceptor;
import org.camunda.connect.spi.ConnectorRequest;

/*
 * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
 * under one or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information regarding copyright
 * ownership. Camunda licenses this file to you under the Apache License,
 * Version 2.0; 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.camunda.connect.impl;


/**
 * <p>
 *   A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
 *   and the raw request ({@link #getTarget()}) for debugging purpose.
 * </p>
 *
 * <p>
 *   The boolean constructor flag determines whether the request invocation should be continued
 *   or aborted after this interceptor. Also it is possible to add a response object which
 *   will returned without further passing the interceptor chain;
 * </p>
 *
 * @author Sebastian Menski
 */
public class DebugRequestInterceptor implements ConnectorRequestInterceptor {

  protected Object response;
  protected boolean proceed;

  private ConnectorRequest<?> request;
  private Object target;

  public DebugRequestInterceptor() {