Creates the underlying {@link CheckAndMutateRowRequest} protobuf.

<p>This method is considered an internal implementation detail and not meant to be used by
applications.
167391
@InternalApi
  public CheckAndMutateRowRequest toProto(RequestContext requestContext) {
    Preconditions.checkState(
        !builder.getTrueMutationsList().isEmpty() || !builder.getFalseMutationsList().isEmpty(),
        "ConditionalRowMutations must have `then` or `otherwise` mutations.");
    String tableName =
        NameUtil.formatTableName(
            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
    return builder
        .setTableName(tableName.toString())
        .setAppProfileId(requestContext.getAppProfileId())
        .build();
  }
756036
@Override
    public ConfigurableRequest createRequest(
            @Nonnull final URI uri,
            @Nonnull final HttpMethod httpMethod) throws IOException {
        HttpRequestBase httpRequest = (HttpRequestBase) createHttpUriRequest(httpMethod, uri);
        return new Request(getHttpClient(), httpRequest, createHttpContext(httpMethod, uri));
    }
248745
public SipServletRequest createRequest(SipServletRequest origRequest,
			boolean sameCallId) {		
		SipServletRequest sipServletRequest = sipFactoryImpl.createRequest(origRequest, sameCallId);
		checkHandler(sipServletRequest);		
		return sipServletRequest;
	}
973099
public final ControlBrowseStatus createNewControlBrowseStatus() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewControlBrowseStatus");
    ControlBrowseStatus msg = null;
    try {
      msg = new ControlBrowseStatusImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewControlBrowseStatus");
    return msg;
  }
1340610
@Override
    public void pushNewRequest(Http2PushBuilder pushBuilder) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "HTTPRequestMessageImpl.pushNewRequest(): pushNewRequest() started " + this);
        }

        //Test to see if this is an HTTP/2 link, and that the client endpoint wants to accept push_promise frames
        if (!isPushSupported()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "HTTPRequestMessageImpl.pushNewRequest(): Push_promise is not client supported, this is not an HTTP/2 connection, or the connection is closing.");
            }
            return;
        }

        // Find the existing H2 connection and stream so we can use them to send the
        // push_promise frame to the client.
        HttpInboundServiceContext isc = (HttpInboundServiceContext) getServiceContext();
        HttpInboundLink link = ((HttpInboundServiceContextImpl) isc).getLink();

        H2HeaderTable h2WriteTable = ((H2HttpInboundLinkWrap) link).muxLink.getWriteTable();

        // Get the request headers from the pushBuilder.
        // Create a headers block to be use for the push_promise and headers frames
        ByteArrayOutputStream ppStream = new ByteArrayOutputStream();

        // path is equal to uri + queryString
        String pbPath = null;
        if (pushBuilder.getPathQueryString() != null) {
            pbPath = pushBuilder.getURI() + pushBuilder.getPathQueryString();
        } else {
            pbPath = pushBuilder.getURI();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "HTTPRequestMessageImpl pbPath = " + pbPath);
        }

        try {
            // If all is well, start encoding, first the method
            ppStream.write(H2Headers.encodeHeader(h2WriteTable, HpackConstants.METHOD, pushBuilder.getMethod(), LiteralIndexType.NOINDEXING));

            // Encode the scheme
            String scheme = new String("https");
            if (!isc.isSecure()) {
                scheme = new String("http");
            }
            ppStream.write(H2Headers.encodeHeader(h2WriteTable, HpackConstants.SCHEME, scheme, LiteralIndexType.NOINDEXING));

            // Encode authority
            // If the :authority header was sent in the request, get the information from there
            // If it was not, use getTargetHost and and getTargetPort to create it
            // If it's still null, we have to bail, since it's a required header in a push_promise frame
            String auth = ((H2HttpInboundLinkWrap) link).muxLink.getAuthority();
            if (null == auth) {
                auth = getTargetHost();
                if (null != auth) {
                    if (0 <= getTargetPort()) {
                        auth = auth + ":" + Integer.toString(getTargetPort());
                    }
                } else {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.exit(tc, "HTTPRequestMessageImpl: Cannot find hostname for required :authority pseudo header");
                    }
                    return;
                }
            }

            ppStream.write(H2Headers.encodeHeader(h2WriteTable, HpackConstants.AUTHORITY, auth, LiteralIndexType.NOINDEXING));

            ppStream.write(H2Headers.encodeHeader(h2WriteTable, HpackConstants.PATH, pbPath, LiteralIndexType.NOINDEXING));

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "HTTPRequestMessageImpl: Method is GET,  scheme is " + scheme + ", auth is " + auth);
            }

            // Encode headers, if any are present
            Set<HeaderField> headerSet = pushBuilder.getHeaders();
            if (headerSet != null) {
                Iterator<HeaderField> hsit = headerSet.iterator();
                HeaderField hf = null;
                while (hsit.hasNext()) {
                    hf = hsit.next();
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "HTTPRequestMessageImpl.getHeaders() " + hf.getName() + " " + hf.asString());
                    }
                    ppStream.write(H2Headers.encodeHeader(h2WriteTable, hf.getName(), hf.asString(), LiteralIndexType.NOINDEXING));

                }
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "HTTPRequestMessageImpl.getHeaders() no headers");
                }
            }

        }
        // Either IOException from write, or CompressionException from encodeHeader
        catch (IOException ioe) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.exit(tc, "HTTPRequestMessageImpl.pushNewRequest(): The attempt to write an HTTP/2 Push Promise frame resulted in an IOException. Exception {0}" + ioe);
            }
            return;
        } catch (CompressionException ce) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "HTTPRequestMessageImpl.pushNewRequest(): The attempt to encode an HTTP/2 Push Promise frame resulted in a CompressionException. Exception {0}" + ce);
            }
            return;
        }

        // Get the next available even numbered promised stream id
        int promisedStreamId = ((H2HttpInboundLinkWrap) link).muxLink.getNextPromisedStreamId();
        // createNewInboundLink creates new:
        // - H2VirtualConnectionImpl
        // - H2HttpInboundLinkWrap
        // - H2StreamProcessor in Idle state
        // It puts the new SP into the SPTable

        H2StreamProcessor promisedSP = ((H2HttpInboundLinkWrap) link).muxLink.createNewInboundLink(promisedStreamId);
        if (promisedSP == null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "pushNewRequest exit; cannot create new push stream -"
                            + " the max number of concurrent streams has already been reached on link: " + link);
            }
            return;
        }
        ((H2HttpInboundLinkWrap) link).setPushPromise(true);
        // Update the promised stream state to Localreserved
        promisedSP.initializePromisedStream();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "HTTPRequestMessageImpl.pushNewRequest(): push_promise stream-id is " + promisedStreamId);
        }

        // Get the existing stream id
        int streamId = ((H2HttpInboundLinkWrap) link).getStreamId();

        // Create the push_promise frame to send to the client
        FramePushPromise pushPromiseFrame = new FramePushPromise(streamId, ppStream.toByteArray(), promisedStreamId, 0, true, false, false);

        // Create a headers frame to send to wc, as if it had come in from the client
        FramePPHeaders headersFrame = new FramePPHeaders(streamId, ppStream.toByteArray());

        // Get the existing stream processor and send the push_promise frame to the client
        H2StreamProcessor existingSP = ((H2HttpInboundLinkWrap) link).muxLink.getStreamProcessor(streamId);
        if (existingSP != null) {
            try {
                existingSP.processNextFrame(pushPromiseFrame, Constants.Direction.WRITING_OUT);
            } catch (Http2Exception e) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                    Tr.exit(tc, "HTTPRequestMessageImpl.pushNewRequest(): processNextFrame threw a ProtocolException " + e);
                }
                return;
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "HTTPRequestMessageImpl.pushNewRequest(): The client connection using stream-id " + streamId + " has been closed, push() was ignored..");
            }
            return;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "HTTPRequestMessageImpl.pushNewRequest(): Push promise frame sent on stream-id " + streamId);
        }

        // Send the headers frame to wc
        promisedSP.sendRequestToWc(headersFrame);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "HTTPRequestMessageImpl.pushNewRequest(): pushNewRequest() exit " + this);
        }

    }
358634
@Override
    public <T extends EventListener> T  createListener(Class<T> classToCreate) throws ServletException {        
        boolean valid = false;
        
        T listener = super.createListener(classToCreate);
        
        for (Class c : validListenerClasses) {
            if (c != null && c.isAssignableFrom(classToCreate)) {
                valid = true;
            }
        }
        
        if (!valid) {
            throw new IllegalArgumentException(nls.getString("exception.occurred.while.creating.listener.instance"));
        }
        
        return listener;
    }
191964
public TrmClientAttachRequest createNewTrmClientAttachRequest() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachRequest");
    TrmClientAttachRequest msg = null;
    try {
      msg = new TrmClientAttachRequestImpl();
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachRequest");
    return msg;
  }
1369826
public CreatePipelineResponse createPipeline(CreatePipelineRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getPipelineName(), 
                "The parameter pipelineName should NOT be null or empty string.");
        checkStringNotEmpty(request.getSourceBucket(), 
                "The parameter sourceBucket should NOT be null or empty string.");
        checkStringNotEmpty(request.getTargetBucket(), 
                "The parameter targetBucket should NOT be null or empty string.");
        if (request.getConfig() == null || request.getConfig().getCapacity() == null) {
            PipelineConfig config = new PipelineConfig();
            config.setCapacity(DEFAULT_PIPELINE_CAPACITY);
            request.setConfig(config);
        }
        InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, PIPELINE);
        
        return invokeHttpClient(internalRequest, CreatePipelineResponse.class);
    }
157798
public JsJmsMessage createJmsMessage() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createJmsMessage");
    JsJmsMessage msg = null;
    try {
      msg = new JsJmsMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createJmsMessage");
    return msg;
  }
779219
@Override
    public synchronized PubSubOutputHandler createPubSubOutputHandler(Neighbour neighbour)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createPubSubOutputHandler", new Object[] { neighbour });

        PubSubOutputHandler handler =
                        _pubSubRealization.createPubSubOutputHandler(neighbour);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createPubSubOutputHandler", handler);

        return handler;
    }
2747
@Override
  public InRequest newInRequest()
  {
    RequestHttp2 request = _freeRequest.allocate();
    
    if (request == null) {
      request = new RequestHttp2(_httpProtocol);
      /*
                                 connTcp(),
                                 _httpContainer,
                                 this);
                                 */
    }
    
    RequestBaratineImpl requestWeb = new RequestBaratineImpl(this,
                                                             request);
    //OutChannelHttp2 stream = request.getStreamOut();
    //stream.init(streamId, _outHttp);
    
    //request.init(this); // , _outHttp);
    
    return request;
  }
328661
@Override
	public HttpRequest createPayloadSendRequest(PayloadData payload, HttpRequest.Listener<HttpRequest> listener) {
		if (payload == null) {
			throw new IllegalArgumentException("Payload is null");
		}

		HttpRequest request = createPayloadRequest(payload);
		request.addListener(listener);
		return request;
	}
522007
public Client<? extends Options, ? extends OptionsBuilder, ? extends RequestBuilder> newClient() {
        if (clientClassName == null) {
            return new DefaultClient();
        } else {
            try {
                return (Client) Thread.currentThread().getContextClassLoader().loadClass(clientClassName).newInstance();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
529084
protected HttpRequestFactory buildHttpRequestFactory() {
		HttpRequestFactory request = this.getGloboDns().getHttpTransport().createRequestFactory(new HttpRequestInitializer() {
			@Override
			public void initialize(HttpRequest request) throws IOException {
				request.setNumberOfRetries(AbstractAPI.this.globoDns.getNumberOfRetries());
				request.setConnectTimeout(AbstractAPI.this.globoDns.getConnectionTimeout());
				request.setReadTimeout(AbstractAPI.this.globoDns.getReadTimeout());
				request.setThrowExceptionOnExecuteError(false);
				request.setParser(parser);
				request.setLoggingEnabled(true);
				request.getHeaders().setUserAgent("GloboDNS-Client");
				request.setCurlLoggingEnabled(true);
				request.setUnsuccessfulResponseHandler(new HttpUnsuccessfulResponseHandler() {
					
					@Override
					public boolean handleResponse(HttpRequest request, HttpResponse response,
							boolean supportsRetry) throws IOException {
						if (response.getStatusCode() == 401) {
							getGloboDns().clearToken();
							
							if (supportsRetry) {
								// only if supports retry I will prepare request with a new token, and ask to retry
								insertAuthenticationHeaders(request);
								return true;
							}
						}
						return false;
					}
				});
				request.setResponseInterceptor(new HttpResponseInterceptor() {
					@Override
					public void interceptResponse(HttpResponse response) throws IOException {
						AbstractAPI.this.interceptResponse(response);
					}
				});
				interceptRequest(request);
			}
		});
		return request;
	}
395807
@Override
    public T create(CreationalContext<T> creationalContext) {
        T instance = getProducer().produce(creationalContext);
        getProducer().inject(instance, creationalContext);

        if (!hasPostConstructCallback || beanManager.isContextActive(RequestScoped.class)) {
            getProducer().postConstruct(instance);
        } else {
            /*
             * CDI-219
             * The request scope is active during @PostConstruct callback of any bean.
             */
            RequestContext context = getUnboundRequestContext();
            try {
                context.activate();
                beanManager.fireRequestContextInitialized(getId());
                getProducer().postConstruct(instance);
            } finally {
                beanManager.fireRequestContextBeforeDestroyed(getId());
                context.invalidate();
                context.deactivate();
                beanManager.fireRequestContextDestroyed(getId());
            }
        }
        return instance;
    }
623639
@Override
    public PmdRuleSet create() {
        final SAXBuilder parser = new SAXBuilder();
        final Document dom;
        try {
            dom = parser.build(source);
        } catch (JDOMException | IOException e) {
            if (messages != null) {
                messages.addErrorText(INVALID_INPUT + " : " + e.getMessage());
            }
            LOG.error(INVALID_INPUT, e);
            return new PmdRuleSet();
        }

        final Element eltResultset = dom.getRootElement();
        final Namespace namespace = eltResultset.getNamespace();
        final PmdRuleSet result = new PmdRuleSet();

        final String name = eltResultset.getAttributeValue("name");
        final Element descriptionElement = getChild(eltResultset, namespace);

        result.setName(name);

        if (descriptionElement != null) {
            result.setDescription(descriptionElement.getValue());
        }

        for (Element eltRule : getChildren(eltResultset, "rule", namespace)) {
            PmdRule pmdRule = new PmdRule(eltRule.getAttributeValue("ref"));
            pmdRule.setClazz(eltRule.getAttributeValue("class"));
            pmdRule.setName(eltRule.getAttributeValue("name"));
            pmdRule.setMessage(eltRule.getAttributeValue("message"));
            parsePmdPriority(eltRule, pmdRule, namespace);
            parsePmdProperties(eltRule, pmdRule, namespace);
            result.addRule(pmdRule);
        }
        return result;
    }
1198310
protected final PrcMatchForeignLineCreate<RS>
    createPutPrcMatchForeignLineCreate() throws Exception {
    PrcMatchForeignLineCreate<RS> proc = new PrcMatchForeignLineCreate<RS>();
    @SuppressWarnings("unchecked")
    PrcEntityCreate<RS, MatchForeignLine, Long> procDlg =
      (PrcEntityCreate<RS, MatchForeignLine, Long>)
        lazyGet(null, PrcEntityCreate.class.getSimpleName());
    proc.setPrcEntityCreate(procDlg);
    //assigning fully initialized object:
    this.processorsMap
      .put(PrcMatchForeignLineCreate.class.getSimpleName(), proc);
    return proc;
  }