Process a legacy V1 request (single item)
@param hyperionContext The context
330414
protected void processLegacyRequest(HyperionContext hyperionContext)
    {
        EndpointRequest request = hyperionContext.getEndpointRequest();
        EndpointResponse response = hyperionContext.getEndpointResponse();

        ApiVersionPlugin<ApiObject<Serializable>,PersistentObject<Serializable>,Serializable> apiVersionPlugin = hyperionContext.getVersionPlugin();
        EntityPlugin plugin = hyperionContext.getEntityPlugin();

        PersistenceContext persistenceContext = buildPersistenceContext(hyperionContext);

        Set<String> fieldSet = persistenceContext.getRequestedFields();
        if(fieldSet != null)
            fieldSet.add("id");

        RequestContext<ApiObject<Serializable>> requestContext = null;
        try
        {
            requestContext = marshaller.unmarshallWithContext(request.getInputStream(), apiVersionPlugin.getApiClass());
        }
        catch (MarshallingException e)
        {
            throw new BadRequestException(messageSource.getErrorMessage(ERROR_READING_REQUEST, hyperionContext.getLocale(),
                    e.getMessage()),e);
        }
        ApiObject clientObject = requestContext.getRequestObject();

        List<Serializable> ids = convertIds(hyperionContext, plugin);
        if(ids.size() != 1)
            throw new BadRequestException(messageSource.getErrorMessage(ERROR_SINGLE_ID_REQUIRED,hyperionContext.getLocale()));

        persistenceContext.setProvidedFields(requestContext.getProvidedFields());

        ApiObject saved = (ApiObject) plugin.getPersistenceOperations().updateItems(
                Collections.singletonList(clientObject),
                persistenceContext).get(0);

        processChangeEvents(hyperionContext,persistenceContext);

        response.setResponseCode(200);
        hyperionContext.setResult(saved);
    }
1065623
public void processRequestAck(long tick, long dmeVersion)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "processRequestAck",
        new Object[] { Long.valueOf(tick), Long.valueOf(dmeVersion)});

    // Only consider non-stale request acks
    if (dmeVersion >= _latestDMEVersion)
    {
      _targetStream.setCursor(tick);
      TickRange tickRange = _targetStream.getNext();

      // Make sure that we still have a Q/G
      if (tickRange.type == TickRange.Requested)
      {
        AIRequestedTick airt = (AIRequestedTick) tickRange.value;

        // serialize with get repetition and request timeouts
        synchronized (airt)
        {
          // Set the request timer to slow, but only if it is not already slowed
          if (!airt.isSlowed())
          {
            _eagerGetTOM.removeTimeoutEntry(airt);
            airt.setSlowed(true);
            airt.setAckingDMEVersion(dmeVersion);
            long to = airt.getTimeout();
            if (to > 0  || to == _mp.getCustomProperties().get_infinite_timeout())
            {
              _slowedGetTOM.addTimeoutEntry(airt);
            }
          }
        }
      }
      else
      {
        // This can happen if the request ack got in too late and the Q/G was timed out and rejected
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "processRequestAck");
  }
720356
private void handleRequest(ByteBuf request, ChannelHandlerContext context) {
    NettyConnection connection = getConnection(context.channel());
    if (connection != null) {
      connection.handleRequest(request);
    }
  }
1105375
def process_request(self, request):
        
        if self._is_enabled():
            self._cache.set(self.guid_key, six.text_type(uuid4()))
            log_prefix = self._log_prefix(u"Before", request)
            self._cache.set(self.memory_data_key, self._memory_data(log_prefix))
288833
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        List<FileItem> items;
        // Parse the request
        try {
            items = upload.parseRequest(request);
        } catch (FileUploadException e) {
            throw new ServletException(e);
        }

        String repository = getParameter(items, REPOSITORY_NAME_PARAMETER);
        String incBinaries = getParameter(items, INCLUDE_BINARY_PARAMETER);
        String reindexOnFinish = getParameter(items, REINDEX_ON_FINISH_PARAMETER);

        RestoreParams params = new RestoreParams();
        params.setIncludeBinaries(Boolean.valueOf(incBinaries));
        params.setReindexOnFinish(Boolean.valueOf(reindexOnFinish));
        
        InputStream in = getStream(items);

        File dir = new File(tempDir.getAbsolutePath() + File.pathSeparator + 
                Long.toString(System.currentTimeMillis()));
        
        FileUtil.unzip(in, dir.getAbsolutePath());
        Connector connector = (Connector) request.getSession().getAttribute(REPOSITORY_CONNECTOR);

        try {
            connector.find(repository).restore(dir.getAbsolutePath(), params);
        } catch (Exception e) {
            throw new ServletException(e);
        }

        String uri = request.getContextPath()
                + String.format(DESTINATION_URL, repository);
        response.sendRedirect(uri);
    }
1321032
public void init(HttpOutboundServiceContext sc, BNFHeaders hdrs) {
        // for requests, we don't care about the validation
        setHeaderValidation(false);
        setOwner(sc);
        setBinaryParseState(HttpInternalConstants.PARSING_BINARY_VERSION);
        if (null != hdrs) {
            hdrs.duplicate(this);
        }
        setVersion(getServiceContext().getHttpConfig().getOutgoingVersion());
    }
477008
public static ProcessRetrieveResponse checkRequestParameter(
			HttpServletRequest request, ServletContext context) {
		ProcessRetrieveResponse response = new ProcessRetrieveResponse(context);
		Integer numItems = checkNumItems(request, response);
		String term = checkTerm(request, response);
		if (term == null) {
			return response;
		}
		SuggestTree index = checkIndexName(request, response, context);
		if (index == null) {
			response.addError(RetrieveStatusCodes.NO_INDEX_AVAILABLE);
			return response;
		}
		retrieveSuggestions(request, response, index, term, numItems);
		return response;
	}
1235593
private <T> T execute(UriComponentsBuilder uriTemplate, HttpMethod method,
			MultiValueMap<String, String> requestData, Class<T> responseType) throws EtcdException {
		long startTimeMillis = System.currentTimeMillis();
		int retry = -1;

		ResourceAccessException lastException = null;
		do {
			lastException = null;

			URI uri = uriTemplate.buildAndExpand(locations[locationIndex]).toUri();

			RequestEntity<MultiValueMap<String, String>> requestEntity = new RequestEntity<>(requestData, null, method,
					uri);

			try {
				ResponseEntity<T> responseEntity = template.exchange(requestEntity, responseType);
				return responseEntity.getBody();
			} catch (HttpStatusCodeException e) {
				EtcdError error = null;
				try {
					error = responseConverter.getObjectMapper().readValue(e.getResponseBodyAsByteArray(),
							EtcdError.class);
				} catch (IOException ex) {
					error = null;
				}
				throw new EtcdException(error, "Failed to execute " + requestEntity + ".", e);
			} catch (ResourceAccessException e) {
				log.debug("Failed to execute " + requestEntity + ", retrying if possible.", e);

				if (locationIndex == locations.length - 1) {
					locationIndex = 0;
				} else {
					locationIndex++;
				}
				lastException = e;
			}
		} while (retry <= retryCount && System.currentTimeMillis() - startTimeMillis < retryDuration);

		if (lastException != null) {
			throw lastException;
		} else {
			return null;
		}
	}
747827
protected void requestElementUpdate (String name, int index, Object value, Object oldValue)
    {
        requestElementUpdate(name, index, value, oldValue, Transport.DEFAULT);
    }
998534
public T execute(HyperionClient client)
    {
        EntityList<T> entityResponse = client.update(build());
        List<T> entries = entityResponse.getEntries();
        return entries.size() == 0 ? null : entries.get(0);
    }
566268
private Mono<AuthenticationResult> acquireAccessTokenFromRefreshToken(String resource, String refreshToken, boolean isMultipleResourceRefreshToken) {
        String authorityUrl = this.environment().activeDirectoryEndpoint() + this.domain();
        ExecutorService executor = Executors.newSingleThreadExecutor();
        Mono<AuthenticationResult> authMono = Mono.defer(() -> {
            AuthenticationContext context;
            try {
                context = new AuthenticationContext(authorityUrl, false, executor);
            } catch (MalformedURLException mue) {
                throw Exceptions.propagate(mue);
            }
            if (proxy() != null) {
                context.setProxy(proxy());
            }
            return Mono.create(callback -> context.acquireTokenByRefreshToken(
                    refreshToken,
                    clientId(),
                    resource,
                    Util.authenticationDelegate(callback)));
        });
        return authMono.doFinally(s -> executor.shutdown());
    }
1278543
public static RequestContextV1 get() {
        RequestContextV1 ret = CURRENT_CONTEXT.get();

        if (ret == null) {
            ret = new RequestContextV1();
            CURRENT_CONTEXT.set(ret);
        }

        return ret;
    }
165606
@Override
    public void process(HttpServerResponse vertxResponse, ContainerResponse jerseyResponse) {
        Object obj = jerseyResponse.getRequestContext().getProperty(RequestProcessor.LAST_BYTE_TIMER_CONTEXT);
        if (obj instanceof Timer.Context) {
            Timer.Context context = (Timer.Context) obj;
            context.stop();
        }
    }
86809
private void processInternal( HttpServletRequest request, HttpServletResponse response )
            throws IOException, ServletException
    {
        //
        // First wrap the request with an object that contains request-scoped values that our runtime uses.  This
        // is faster than sticking everything into attributes on the request (then basically reading from a HashMap).
        //
        request = PageFlowRequestWrapper.wrapRequest( request );

        String uri = InternalUtils.getDecodedServletPath( request );
        ServletContext servletContext = getServletContext();

        // The ServletContainerAdapter reference may have been lost during serialization/deserialization.
        if (_servletContainerAdapter == null) {
            _servletContainerAdapter = AdapterManager.getServletContainerAdapter( servletContext );
        }

        //
        // Allow the container to do a security check on forwarded requests, if that feature is enabled.
        //
        if ( LegacySettings.get( servletContext ).shouldDoSecureForwards()
             && PageFlowRequestWrapper.get( request ).isForwardedRequest() )
        {
            //
            // In some situations (namely, in scoped requests under portal), the initial
            // security check may not have been done for the request URI.  In this case, a redirect
            // to https may happen during checkSecurity().
            //
            if ( _servletContainerAdapter.doSecurityRedirect( uri, request, response ) )
            {
                if ( LOG.isDebugEnabled() )
                    LOG.debug( "checkSecurity() caused a redirect.  Ending processing for this request "
                               + '(' + uri + ')' );

                return;
            }
        }

        //
        // If we've come in on a forced redirect due to security constraints, look for request attrs
        // that we put into the session.
        //
        String hash = request.getParameter( REDIRECT_REQUEST_ATTRS_PARAM );
        if ( hash != null )
        {
            HttpSession session = request.getSession( false );

            if ( session != null )
            {
                String carryoverAttrName = makeRedirectedRequestAttrsKey( uri, hash );
                Map attrs = ( Map ) session.getAttribute( carryoverAttrName );
                session.removeAttribute( carryoverAttrName );

                if ( attrs != null )
                {
                    for ( Iterator i = attrs.entrySet().iterator(); i.hasNext(); )
                    {
                        Map.Entry entry = ( Map.Entry ) i.next();

                        String attrName = ( String ) entry.getKey();
                        if ( request.getAttribute( attrName ) == null )
                        {
                            request.setAttribute( attrName, entry.getValue() );
                        }
                    }
                }
            }
        }

        //
        // The requested action can be overridden by a request parameter.  In this case, we parse the action from
        // the request parameter and forward to a URI constructed from it.  If this happens, just return.
        //
        if ( processActionOverride( request, response ) ) return;

        //
        // Process any direct request for a page flow by forwarding to its "begin" action.
        //
        if ( processPageFlowRequest( request, response, uri ) ) return;

        //
        // Get the FlowController for this request (page flow or shared flow), and cache it in the request.
        //
        String flowControllerClassName = InternalUtils.getFlowControllerClassName( moduleConfig );

        if ( flowControllerClassName == null &&
             ! ( moduleConfig instanceof AutoRegisterActionServlet.MissingRootModuleControllerConfig ) )
        {
            //
            // If this isn't a blank module initialized in place of a missing root PageFlowController, emit a warning
            // about the missing controllerClass property.
            //
            if(LOG.isWarnEnabled())
                LOG.warn( "Struts module " + moduleConfig.getPrefix() + " is configured to use " + getClass().getName()
                    + " as the request processor, but the <controller> element does not contain a <set-property>"
                    + " for \"controllerClass\".  Page Flow actions in this module may not be handled correctly." );
        }

        //
        // Look up or create the appropriate SharedFlowControllers if they don't exist.
        //
        if ( LOG.isInfoEnabled() )
            LOG.info( "Attempting to instantiate SharedFlowControllers for request " + request.getRequestURI() );

        FlowController currentFlowController = null;

        try
        {
            RequestContext requestContext = new RequestContext( request, response );
            Map/*< String, SharedFlowController >*/ sharedFlows =
                    _flowControllerFactory.getSharedFlowsForRequest( requestContext );

            /* todo: why are the shared flow / global app objects loaded for data binding here? */
            ImplicitObjectUtil.loadSharedFlow( request, sharedFlows );
            ImplicitObjectUtil.loadGlobalApp( request, PageFlowUtils.getGlobalApp( request ) );

            if ( flowControllerClassName != null )
            {
                currentFlowController = getFlowController( requestContext, flowControllerClassName );
                PageFlowRequestWrapper.get( request ).setCurrentFlowController( currentFlowController );
            }
            else
            {
                PageFlowRequestWrapper.get( request ).setCurrentFlowController( null );
            }
        }
        catch ( ClassNotFoundException e )
        {
            LOG.error( "Could not find FlowController class " + flowControllerClassName, e );
            ServletUtils.throwServletException(e);
        }
        catch ( InstantiationException e )
        {
            LOG.error( "Could not instantiate FlowController of type " + flowControllerClassName, e );
            ServletUtils.throwServletException(e);
        }
        catch ( IllegalAccessException e )
        {
            LOG.error( "Could not instantiate FlowController of type " + flowControllerClassName, e );
            ServletUtils.throwServletException(e);
        }

        //
        // Get the page flow for this request.
        //
        PageFlowController jpf = PageFlowUtils.getCurrentPageFlow( request, getServletContext() );

        //
        // Remove any current JavaServer Faces backing bean.  We have "left" any JSF page and are now processing a
        // Page Flow action.
        //
        InternalUtils.removeCurrentFacesBackingBean( request, servletContext );

        //
        // Set up implicit objects used by the expression language in simple actions and in declarative validation.
        //
        ImplicitObjectUtil.loadImplicitObjects( request, response, servletContext, jpf );

        try
        {
            super.process( request, response );
        }
        catch ( UnhandledException unhandledException )
        {
            // If we get here, then we've already tried to find an exception handler.  Just throw.
            rethrowUnhandledException( unhandledException );
        }
        catch ( ServletException servletEx )
        {
            // If a ServletException escapes out of any of the processing methods, let the current FlowController handle it.
            if ( ! handleException( servletEx, currentFlowController, request, response ) )
                throw servletEx;
        }
        catch ( IOException ioe )
        {
            // If an IOException escapes out of any of the processing methods, let the current FlowController handle it.
            if ( ! handleException( ioe, currentFlowController, request, response ) )
                throw ioe;
        }
        catch ( Throwable th )
        {
            // If a Throwable escapes out of any of the processing methods, let the current FlowController handle it.
            if ( ! handleException( th, currentFlowController, request, response ) )
            {
                if ( th instanceof Error )
                    throw ( Error ) th;
                ServletUtils.throwServletException(th);
            }
        }
    }
481683
public T execute(HyperionClient client)
    {
        EntityList<T> response = client.create(build());
        List<T> entries = response.getEntries();
        return entries.size() == 0 ? null : entries.get(0);
    }
782994
void process(ByteChannel sock, AutoBuffer ab) throws IOException {
        int requestType = ab.get1();
        switch (requestType) {
            case CREATE_FRAME:
                ExternalFrameWriterBackend.handleWriteToChunk(sock, ab);
                break;
            case DOWNLOAD_FRAME:
                ExternalFrameReaderBackend.handleReadingFromChunk(sock, ab);
                break;
        }
    }
763522
public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
        for (Entry<String, String> param : headerParams.entrySet()) {
            reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
        }
        for (Entry<String, String> header : defaultHeaderMap.entrySet()) {
            if (!headerParams.containsKey(header.getKey())) {
                reqBuilder.header(header.getKey(), parameterToString(header.getValue()));
            }
        }
    }