Tabnine Logo
IServerInterceptor.incomingRequestPreHandled
Code IndexAdd Tabnine to your IDE (free)

How to use
incomingRequestPreHandled
method
in
ca.uhn.fhir.rest.server.interceptor.IServerInterceptor

Best Java code snippets using ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.incomingRequestPreHandled (Showing top 6 results out of 315)

origin: jamesagnew/hapi-fhir

/**
 * This method may be invoked by user code to notify interceptors that a nested
 * operation is being invoked which is denoted by this request details.
 */
public void notifyIncomingRequestPreHandled(RestOperationTypeEnum theOperationType) {
  RequestDetails requestDetails = getRequestDetails();
  if (requestDetails == null) {
    return;
  }
  IRestfulServerDefaults server = requestDetails.getServer();
  if (server == null) {
    return;
  }
  List<IServerInterceptor> interceptors = server.getInterceptors();
  for (IServerInterceptor next : interceptors) {
    next.incomingRequestPreHandled(theOperationType, this);
  }
}
origin: jamesagnew/hapi-fhir

protected final Object invokeServerMethod(IRestfulServer<?> theServer, RequestDetails theRequest, Object[] theMethodParams) {
  // Handle server action interceptors
  RestOperationTypeEnum operationType = getRestOperationType(theRequest);
  if (operationType != null) {
    for (IServerInterceptor next : theServer.getInterceptors()) {
      ActionRequestDetails details = new ActionRequestDetails(theRequest);
      populateActionRequestDetailsForInterceptor(theRequest, details, theMethodParams);
      next.incomingRequestPreHandled(operationType, details);
    }
  }
  // Actually invoke the method
  try {
    Method method = getMethod();
    return method.invoke(getProvider(), theMethodParams);
  } catch (InvocationTargetException e) {
    if (e.getCause() instanceof BaseServerResponseException) {
      throw (BaseServerResponseException) e.getCause();
    }
    throw new InternalErrorException("Failed to call access method: " + e.getCause(), e);
  } catch (Exception e) {
    throw new InternalErrorException("Failed to call access method: " + e.getCause(), e);
  }
}
origin: jamesagnew/hapi-fhir

public void notifyInterceptors(RestOperationTypeEnum theOperationType, ActionRequestDetails theRequestDetails) {
  if (theRequestDetails.getId() != null && theRequestDetails.getId().hasResourceType() && isNotBlank(theRequestDetails.getResourceType())) {
    if (theRequestDetails.getId().getResourceType().equals(theRequestDetails.getResourceType()) == false) {
      throw new InternalErrorException(
        "Inconsistent server state - Resource types don't match: " + theRequestDetails.getId().getResourceType() + " / " + theRequestDetails.getResourceType());
    }
  }
  if (theRequestDetails.getUserData().get(PROCESSING_SUB_REQUEST) == Boolean.TRUE) {
    theRequestDetails.notifyIncomingRequestPreHandled(theOperationType);
  }
  List<IServerInterceptor> interceptors = getConfig().getInterceptors();
  for (IServerInterceptor next : interceptors) {
    next.incomingRequestPreHandled(theOperationType, theRequestDetails);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-server

/**
 * This method may be invoked by user code to notify interceptors that a nested
 * operation is being invoked which is denoted by this request details.
 */
public void notifyIncomingRequestPreHandled(RestOperationTypeEnum theOperationType) {
  RequestDetails requestDetails = getRequestDetails();
  if (requestDetails == null) {
    return;
  }
  IRestfulServerDefaults server = requestDetails.getServer();
  if (server == null) {
    return;
  }
  List<IServerInterceptor> interceptors = server.getInterceptors();
  for (IServerInterceptor next : interceptors) {
    next.incomingRequestPreHandled(theOperationType, this);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-server

protected final Object invokeServerMethod(IRestfulServer<?> theServer, RequestDetails theRequest, Object[] theMethodParams) {
  // Handle server action interceptors
  RestOperationTypeEnum operationType = getRestOperationType(theRequest);
  if (operationType != null) {
    for (IServerInterceptor next : theServer.getInterceptors()) {
      ActionRequestDetails details = new ActionRequestDetails(theRequest);
      populateActionRequestDetailsForInterceptor(theRequest, details, theMethodParams);
      next.incomingRequestPreHandled(operationType, details);
    }
  }
  // Actually invoke the method
  try {
    Method method = getMethod();
    return method.invoke(getProvider(), theMethodParams);
  } catch (InvocationTargetException e) {
    if (e.getCause() instanceof BaseServerResponseException) {
      throw (BaseServerResponseException) e.getCause();
    }
    throw new InternalErrorException("Failed to call access method: " + e.getCause(), e);
  } catch (Exception e) {
    throw new InternalErrorException("Failed to call access method: " + e.getCause(), e);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

public void notifyInterceptors(RestOperationTypeEnum theOperationType, ActionRequestDetails theRequestDetails) {
  if (theRequestDetails.getId() != null && theRequestDetails.getId().hasResourceType() && isNotBlank(theRequestDetails.getResourceType())) {
    if (theRequestDetails.getId().getResourceType().equals(theRequestDetails.getResourceType()) == false) {
      throw new InternalErrorException(
        "Inconsistent server state - Resource types don't match: " + theRequestDetails.getId().getResourceType() + " / " + theRequestDetails.getResourceType());
    }
  }
  if (theRequestDetails.getUserData().get(PROCESSING_SUB_REQUEST) == Boolean.TRUE) {
    theRequestDetails.notifyIncomingRequestPreHandled(theOperationType);
  }
  List<IServerInterceptor> interceptors = getConfig().getInterceptors();
  for (IServerInterceptor next : interceptors) {
    next.incomingRequestPreHandled(theOperationType, theRequestDetails);
  }
}
ca.uhn.fhir.rest.server.interceptorIServerInterceptorincomingRequestPreHandled

Javadoc

Invoked before an incoming request is processed. Note that this method is called after the server has begin preparing the response to the incoming client request. As such, it is not able to supply a response to the incoming request in the way that #incomingRequestPreHandled(RestOperationTypeEnum,ActionRequestDetails) and #incomingRequestPostProcessed(RequestDetails,HttpServletRequest,HttpServletResponse)are.

This method may however throw a subclass of BaseServerResponseException, and processing will be aborted with an appropriate error returned to the client.

Popular methods of IServerInterceptor

  • handleException
    This method is called upon any exception being thrown within the server's request processing code. T
  • incomingRequestPostProcessed
    This method is called just before the actual implementing server method is invoked.
  • incomingRequestPreProcessed
    This method is called before any other processing takes place for each incoming request. It may be u
  • outgoingResponse
    This method is called after the server implementation method has been called, but before any attempt
  • preProcessOutgoingException
    This method is called upon any exception being thrown within the server's request processing code. T
  • processingCompletedNormally
    This method is called after all processing is completed for a request, but only if the request compl

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JComboBox (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now