Store.

@param request       the request
@param response      the response
@param wctx          the wctx
@param service       the service
@param configuration the configuration
975120
public void store(final HttpServletRequest request, final HttpServletResponse response,
                      final String wctx, final Service service, final WsFederationConfiguration configuration) {
        val session = new HashMap<String, Object>();
        session.put(CasProtocolConstants.PARAMETER_SERVICE + '-' + wctx, service);
        val methods = request.getParameter(CasProtocolConstants.PARAMETER_METHOD);
        if (StringUtils.isNotBlank(methods)) {
            session.put(CasProtocolConstants.PARAMETER_METHOD + '-' + wctx, methods);
        }
        val locale = request.getAttribute(this.localParamName);
        if (locale != null) {
            session.put(this.localParamName + '-' + wctx, locale);
        }
        val theme = request.getAttribute(this.themeParamName);
        if (theme != null) {
            session.put(this.themeParamName + '-' + wctx, theme);
        }

        val cookieValue = serializeSessionValues(session);
        val cookieGen = configuration.getCookieGenerator();
        cookieGen.addCookie(request, response, cookieValue);
    }
667328
private void addRequiredParametersToRequest(HttpPost request) {
        parameters.put("Action", operationName);
        parameters.put("Version", serviceEndpoint.version);
        parameters.put("Timestamp", MwsUtl.getFormattedTimestamp());
        parameters.put("AWSAccessKeyId", connection.getAwsAccessKeyId());
        String signature = MwsUtl.signParameters(serviceEndpoint.uri,
                connection.getSignatureVersion(),
                connection.getSignatureMethod(), parameters,
                connection.getAwsSecretKeyId());
        parameters.put("Signature", signature);
        List<NameValuePair> parameterList = new ArrayList<NameValuePair>();
        for (Entry<String, String> entry : parameters.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            if (!(key == null || key.equals("") || value == null || value
                    .equals(""))) {
                parameterList.add(new BasicNameValuePair(key, value));
            }
        }
        try {
            request.setEntity(new UrlEncodedFormEntity(parameterList, "UTF-8"));
        } catch (Exception e) {
            throw MwsUtl.wrap(e);
        }
    }
611926
protected void setSslConfig(ServiceReference<SSLConfiguration> service) {
        String id = (String) service.getProperty(SSL_CFG_ID);
        sslConfigs.putReference(id, service);

        // any options that needed this id need to refresh... 
        for (SSLChannelOptions options : sslOptions.values()) {
            options.updateRegistration(bContext, sslConfigs);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "setSslConfig", "id=" + id, service);
        }
    }
1064813
@Override
    public void service(ServletRequest req, ServletResponse res)
                    throws ServletException, IOException {

        HttpServletRequest request;
        HttpServletResponse response;

        try {
            request = (HttpServletRequest) req;
            if (collaborator != null) {
                ComponentMetaData componentMetaData = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
                request = new JaxWsHttpServletRequestAdapter(request, collaborator, componentMetaData);
            }
            response = (HttpServletResponse) res;
        } catch (ClassCastException e) {
            throw new ServletException("Unrecognized HTTP request or response object", e);
        }

        String method = request.getMethod();
        if (KNOWN_HTTP_VERBS.contains(method)) {
            super.service(request, response);
        } else {
            handleRequest(request, response);
        }
    }
315993
private CompletableFuture<ExecuteResponse> execute(ExecuteRequest request) {
    return getService(request).thenCompose(service -> service.execute(request));
  }
153213
protected ServerOperation<HttpClientResponse<O>> requestToOperation(final HttpClientRequest<I> request, final ClientConfig rxClientConfig) {
        Preconditions.checkNotNull(request);
        
        return new ServerOperation<HttpClientResponse<O>>() {
            final AtomicInteger count = new AtomicInteger(0);
            
            @Override
            public Observable<HttpClientResponse<O>> call(Server server) {
                HttpClient<I,O> rxClient = getOrCreateRxClient(server);
                setHostHeader(request, server.getHost());
                
                Observable<HttpClientResponse<O>> o;
                if (rxClientConfig != null) {
                    o = rxClient.submit(request, rxClientConfig);
                } 
                else {
                    o = rxClient.submit(request);
                }
                
                return o.concatMap(new Func1<HttpClientResponse<O>, Observable<HttpClientResponse<O>>>() {
                    @Override
                    public Observable<HttpClientResponse<O>> call(HttpClientResponse<O> t1) {
                        if (t1.getStatus().code()/100 == 4 || t1.getStatus().code()/100 == 5)
                            return responseToErrorPolicy.call(t1, backoffStrategy.call(count.getAndIncrement()));
                        else
                            return Observable.just(t1);
                    }
                });
            }
        };
    }
870117
public RequestCtx makeRequestCtx(String request)
            throws MelcoeXacmlException {
        RequestCtx reqCtx = null;
        try {
            ByteArrayInputStream is =
                    new ByteArrayInputStream(request.getBytes());
            reqCtx = BasicRequestCtx.getInstance(is);
        } catch (ParsingException pe) {
            throw new MelcoeXacmlException("Error parsing response.", pe);
        }
        return reqCtx;
    }
511291
@Override
	public void serviceRequest(final Request request) {

		// Get trigger id
		String triggerId = request.getParameter(WServlet.AJAX_TRIGGER_PARAM_NAME);
		if (triggerId == null) {
			throw new SystemException("No AJAX trigger id to on request");
		}

		// Find the Component for this trigger
		ComponentWithContext trigger = WebUtilities.getComponentById(triggerId,
				true);
		if (trigger == null) {
			throw new SystemException("No component found for AJAX trigger " + triggerId + ".");
		}
		WComponent triggerComponent = trigger.getComponent();

		// Check for an internal AJAX request (if client has flagged it as internal)
		boolean internal = request.getParameter(WServlet.AJAX_TRIGGER_INTERNAL_PARAM_NAME) != null;

		AjaxOperation ajaxOperation = null;
		if (internal) {
			if (!(triggerComponent instanceof AjaxInternalTrigger)) {
				throw new SystemException("AJAX trigger [" + triggerId + "] does not support internal actions.");
			}
			// Create internal operation
			ajaxOperation = new AjaxOperation(triggerId);
		} else {
			// Check for a registered AJAX operation
			ajaxOperation = AjaxHelper.getAjaxOperation(triggerId);

			// Override registered operation if it is a GET and trigger supports Internal AJAX
			// TODO This is only required until all components start using the Internal param flag
			if (ajaxOperation != null && "GET".equals(request.getMethod()) && triggerComponent instanceof AjaxInternalTrigger) {
				// Create internal operation
				ajaxOperation = new AjaxOperation(triggerId);
			}
		}

		// If no operation registered, check if the trigger supports internal AJAX then assume it is an Internal Action
		if (ajaxOperation == null && trigger.getComponent() instanceof AjaxInternalTrigger) {
			// Create internal operation
			ajaxOperation = new AjaxOperation(triggerId);
		}

		// No Valid operation
		if (ajaxOperation == null) {
			throw new SystemException("No AJAX operation has been registered for trigger " + triggerId + ".");
		}

		// Set current operation
		AjaxHelper.setCurrentOperationDetails(ajaxOperation, trigger);

		// Process Service Request
		super.serviceRequest(request);
	}
376028
@SuppressWarnings({ "rawtypes", "unchecked" })
  public static void deploy(URI storeUri, DeployableConfigSource confgSource, String version) throws Exception {

    ServiceLoader<ConfigStoreFactory> loader = ServiceLoader.load(ConfigStoreFactory.class);

    for (ConfigStoreFactory storeFactory : loader) {

      log.info("Found ConfigStore with scheme : " + storeFactory.getScheme());

      if (storeUri.getScheme().equals(storeFactory.getScheme())) {

        log.info("Using ConfigStore with scheme : " + storeFactory.getScheme());

        ConfigStore configStore = storeFactory.createConfigStore(storeUri);

        if (configStore instanceof Deployable<?>) {

          ((Deployable) configStore).deploy(new FsDeploymentConfig(confgSource, version));

        } else {
          log.error(String.format("Deployment failed. The store %s does not implement %s", storeFactory.getClass(),
              Deployable.class.getName()));
        }
      }
    }
  }
144536
function(service) {

		// If the service doesn't exist
		service = service || this.settings.default_service;

		if (!service || !(service in this.services)) {
			return null;
		}

		return this.utils.store(service) || null;
	}
417637
public Observable<Service> addService(final AddServiceRequest request) {
        LOGGER.debug("Got instructed to add Service {}, to Node {}", request.type(), request.hostname());
        return nodeBy(request.hostname()).addService(request);
    }
907155
@Override
	public void serviceRequest(final Request request) {
		// Get window id off the request
		windowId = request.getParameter(WWindow.WWINDOW_REQUEST_PARAM_KEY);

		if (windowId == null) {
			super.serviceRequest(request);
		} else {
			// Get the window component
			ComponentWithContext target = WebUtilities.getComponentById(windowId, true);
			if (target == null) {
				throw new SystemException("No window component for id " + windowId);
			}

			// Setup the Environment on the context
			UIContext uic = UIContextHolder.getCurrentPrimaryUIContext();
			Environment originalEnvironment = uic.getEnvironment();
			uic.setEnvironment(new EnvironmentDelegate(originalEnvironment, windowId, target));

			if (attachWindow) {
				attachUI(target.getComponent());
			}
			UIContextHolder.pushContext(target.getContext());
			try {
				super.serviceRequest(request);
			} finally {
				uic.setEnvironment(originalEnvironment);
				UIContextHolder.popContext();
			}
		}
	}
395003
public void initialize(final ByteBuf responseContent, final ResponseStatus responseStatus,
        final CouchbaseRequest request) {
        this.requestID = "";
        this.clientContextID = ""; //initialize to empty string instead of null as it is optional on the wire
        this.sentResponse = false;
        this.response = null;
        this.status = responseStatus;
        this.responseContent = responseContent;
        this.currentRequest = request;

        queryRowObservable = UnicastAutoReleaseSubject.create(ttl, TimeUnit.MILLISECONDS, scheduler);
        queryErrorObservable = UnicastAutoReleaseSubject.create(ttl, TimeUnit.MILLISECONDS, scheduler);
        queryStatusObservable = AsyncSubject.create();
        queryInfoObservable = UnicastAutoReleaseSubject.create(ttl, TimeUnit.MILLISECONDS, scheduler);
        querySignatureObservable = UnicastAutoReleaseSubject.create(ttl, TimeUnit.MILLISECONDS, scheduler);
        queryProfileInfoObservable = UnicastAutoReleaseSubject.create(ttl, TimeUnit.MILLISECONDS, scheduler);

        parser.initialize(responseContent);
        initialized = true;
    }
1305111
public boolean preHandle(HttpServletRequest request,
                             HttpServletResponse response, Object handler) throws Exception {

        String queryString = request.getQueryString() == null ? "" : request.getQueryString();

        if (ConfigurationService.getInstance().isValid()
                || request.getServletPath().startsWith("/configuration")
                || request.getServletPath().startsWith("/resources")
                || queryString.contains("requestFromConfiguration=true")) {
            return true;
        } else {
            response.sendRedirect("configuration");
            return false;
        }
    }
278139
@Override
  public boolean service(RequestBaratine request)
  {
    /*
    try {
      _service.open((WebRequest) request);
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }
    */

    ServiceWebSocket<T, S> service = _factory.apply(request);

    WebSocketManager wsManager = request.webApp().wsManager();
    WebSocketBaratineImpl<T,S> ws
      = new WebSocketBaratineImpl<>(wsManager, service, _type);
    
    try {
      if (ws.handshake(request)) {
        return true;
      }
      else {
        log.fine("WebSocket handshake failed for " + request);
        return false;
      }
    } catch (Throwable e) {
      log.log(Level.WARNING, e.toString(), e);
      e.printStackTrace();
      
      request.fail(e);
      
      return true;
    }
    //request.flush();
  }
1101076
@Override
  public void request(DeployService2Impl<I> deploy, 
                      Result<I> result)
  {
    result.ok(deploy.get());
  }
1368617
@SuppressWarnings("unchecked")
    private void storeETag(HttpHost host, String file, HttpResponse response)
            throws IOException {
        //get ETag header
        Header etagHdr = response.getFirstHeader("ETag");
        if (etagHdr == null) {
            if (!quiet) {
                project.getLogger().warn("Server response does not include an "
                        + "entity tag (ETag).");
            }
            return;
        }
        String etag = etagHdr.getValue();

        //handle weak ETags
        if (isWeakETag(etag)) {
            if (useETag.displayWarningForWeak && !quiet) {
                project.getLogger().warn("Weak entity tag (ETag) encountered. "
                        + "Please make sure you want to compare resources based on "
                        + "weak ETags. If yes, set the 'useETag' flag to \"all\", "
                        + "otherwise set it to \"strongOnly\".");
            }
            if (!useETag.useWeakETags) {
                //do not save weak etags
                return;
            }
        }

        //create directory for cached etags file
        File parent = getCachedETagsFile().getParentFile();
        if (parent != null) {
            parent.mkdirs();
        }

        //read existing cached etags file
        Map<String, Object> cachedETags = readCachedETags();

        //create new entry in cached ETags file
        Map<String, String> etagMap = new LinkedHashMap<String, String>();
        etagMap.put("ETag", etag);

        String uri = host.toURI();
        Map<String, Object> hostMap = (Map<String, Object>)cachedETags.get(uri);
        if (hostMap == null) {
            hostMap = new LinkedHashMap<String, Object>();
            cachedETags.put(uri, hostMap);
        }
        hostMap.put(file, etagMap);

        //write cached ETags file
        String cachedETagsContents = JsonOutput.toJson(cachedETags);
        PrintWriter writer = new PrintWriter(getCachedETagsFile(), "UTF-8");
        try {
            writer.write(cachedETagsContents);
            writer.flush();
        } finally {
            writer.close();
        }
    }