{@inheritDoc}

@see jcifs.internal.smb2.ServerMessageBlock2#createResponse(jcifs.Configuration,
jcifs.internal.smb2.ServerMessageBlock2)
557019
@Override
    protected Smb2CloseResponse createResponse ( CIFSContext tc, ServerMessageBlock2Request<Smb2CloseResponse> req ) {
        return new Smb2CloseResponse(tc.getConfig(), this.fileId, this.fileName);
    }
272354
private void createDefaultResponse(Route route, String controllerLayout) throws InstantiationException, IllegalAccessException {
           String controllerPath = Router.getControllerPath(route.getController().getClass());
            String template =  controllerPath + "/" + route.getActionName();
            RenderTemplateResponse resp = new RenderTemplateResponse(route.getController().values(), template, RequestContext.getFormat());
            if(!Configuration.getDefaultLayout().equals(controllerLayout)){
                resp.setLayout(controllerLayout);//could be a real layout ot null for no layout
            }
            if(resp.getContentType() == null){
                resp.setContentType(route.getController().getContentType());
            }
            RequestContext.setControllerResponse(resp);
            resp.setTemplateManager(Configuration.getTemplateManager());
    }
481638
@Override
    protected Smb2ChangeNotifyResponse createResponse ( CIFSContext tc, ServerMessageBlock2Request<Smb2ChangeNotifyResponse> req ) {
        return new Smb2ChangeNotifyResponse(tc.getConfig());
    }
1159987
public CreateResponse createFlowConfig(FlowConfig flowConfig, boolean triggerListener) throws FlowConfigLoggedException {
    log.info("[GAAS-REST] Create called with flowGroup " + flowConfig.getId().getFlowGroup() + " flowName " + flowConfig.getId().getFlowName());

    if (flowConfig.hasExplain()) {
      //Return Error if FlowConfig has explain set. Explain request is only valid for v2 FlowConfig.
      return new CreateResponse(new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST, "FlowConfig with explain not supported."));
    }

    FlowSpec flowSpec = createFlowSpecForConfig(flowConfig);
    // Existence of a flow spec in the flow catalog implies that the flow is currently running.
    // If the new flow spec has a schedule we should allow submission of the new flow to accept the new schedule.
    // However, if the new flow spec does not have a schedule, we should allow submission only if it is not running.
    if (!flowConfig.hasSchedule() && this.flowCatalog.exists(flowSpec.getUri())) {
      return new CreateResponse(new ComplexResourceKey<>(flowConfig.getId(), new EmptyRecord()), HttpStatus.S_409_CONFLICT);
    } else {
      this.flowCatalog.put(flowSpec, triggerListener);
      return new CreateResponse(new ComplexResourceKey<>(flowConfig.getId(), new EmptyRecord()), HttpStatus.S_201_CREATED);
    }
  }
85777
public CreateRouteResponseRequest withResponseParameters(java.util.Map<String, ParameterConstraints> responseParameters) {
        setResponseParameters(responseParameters);
        return this;
    }
1135128
public NfsCreateResponse create(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier)
            throws IOException {
        NfsCreateResponse response = getNfs().wrapped_sendCreate(getNfs().makeCreateRequest(createMode,
                getParentFile().getFileHandle(), getName(), attributes, verifier));
        setFileHandle(response.getFileHandle());
        return response;
    }
312954
private function createResponseBuilder(): ResponseBuilder
    {
        $body = $this->streamFactory->createStreamFromFile('php://temp', 'w+b');

        $response = $this->responseFactory
            ->createResponse(200)
            ->withBody($body);

        return new ResponseBuilder($response);
    }
1004963
public <T> HttpResponseHandler<AmazonWebServiceResponse<T>> createResponseHandler(
            JsonOperationMetadata operationMetadata,
            Unmarshaller<T, JsonUnmarshallerContext> responseUnmarshaller) {
        return getSdkFactory().createResponseHandler(operationMetadata, responseUnmarshaller);
    }
802215
@Override
  protected TermsByQueryResponse newResponse(TermsByQueryRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
    int successfulShards = 0;
    int failedShards = 0;
    int numTerms = 0;
    TermsSet[] termsSets = new TermsSet[shardsResponses.length()];
    List<ShardOperationFailedException> shardFailures = null;

    // we check each shard response
    for (int i = 0; i < shardsResponses.length(); i++) {
      Object shardResponse = shardsResponses.get(i);
      if (shardResponse == null) {
        // simply ignore non active shards
      } else if (shardResponse instanceof BroadcastShardOperationFailedException) {
        failedShards++;
        if (shardFailures == null) {
          shardFailures = new ArrayList<>();
        }
        logger.error("Shard operation failed", (BroadcastShardOperationFailedException) shardResponse);
        shardFailures.add(new DefaultShardOperationFailedException((BroadcastShardOperationFailedException) shardResponse));
      } else {
        // on successful shard response, just add to the array or responses so we can process them below
        // we calculate the total number of terms gathered across each shard so we can use it during
        // initialization of the final TermsResponse below (to avoid rehashing during merging)
        TermsByQueryShardResponse shardResp = ((TermsByQueryShardResponse) shardResponse);
        TermsSet terms = shardResp.getTerms();
        termsSets[i] = terms;
        numTerms += terms.size();
        successfulShards++;
      }
    }

    // Merge the responses

    try {
      // NumericTermsSet is responsible for the merge, set size to avoid rehashing on certain implementations.
      long expectedElements = request.expectedTerms() != null ? request.expectedTerms() : numTerms;
      TermsSet termsSet = TermsSet.newTermsSet(expectedElements, request.termsEncoding(), breakerService.getBreaker(CircuitBreaker.REQUEST));

      TermsByQueryResponse rsp;
      try {
        for (int i = 0; i < termsSets.length; i++) {
          TermsSet terms = termsSets[i];
          if (terms != null) {
            termsSet.merge(terms);
            terms.release(); // release the shard terms set and adjust the circuit breaker
            termsSets[i] = null;
          }
        }

        long tookInMillis = System.currentTimeMillis() - request.nowInMillis();

        rsp = new TermsByQueryResponse(termsSet, tookInMillis, shardsResponses.length(), successfulShards, failedShards, shardFailures);
      }
      finally {
        // we can now release the terms set and adjust the circuit breaker, since the TermsByQueryResponse holds an
        // encoded version of the terms set
        termsSet.release();
      }

      return rsp;
    }
    finally { // If something happens, release the terms sets and adjust the circuit breaker
      for (int i = 0; i < termsSets.length; i++) {
        TermsSet terms = termsSets[i];
        if (terms != null) {
          terms.release();
        }
      }
    }
  }
186472
protected function createResponse(BlockContextInterface $blockContext, Response $response = null)
    {
        if (null === $response) {
            $response = new Response();
        }

        // set the ttl from the block instance, this can be changed by the BlockService
        if (($ttl = $blockContext->getBlock()->getTtl()) > 0) {
            $response->setTtl($ttl);
        }

        return $response;
    }
1067373
public Response create(String username, String password, String organization, String email, String phone, String countryCode, String firstName, String lastName) {
        Response op = new Response();
        if (userDAO.hasUser(username) == false) {
            if (userDAO.hasUserWithEmail(email) == false) {
                if (organizationDAO.hasOrganization(organization) == true) {
                    PersistedUser user = new PersistedUser(username, null, Arrays.asList("ROLE_USER"), organization, email, phone, countryCode);
                    user.firstName = firstName;
                    user.lastName = lastName;
                    user.has2FAEnabled = Boolean.parseBoolean(authyEnabled);
                    createPasswordHash(user, password);
                    com.authy.api.User authyUser = client.getUsers().createUser(user.email, user.phone, user.countryCode);
                    user.authProviderId = authyUser.getId();
                    userDAO.create(user);
                    op.setPayload(true);
                    sendAccountVerificationMessage(user, null);
                    notifyOperator(user);
                } else {
                    op.addError(new Error(11));
                }
            } else {
                op.addError(new Error(Error.USER_BY_EMAIL_FOUND));
            }
        } else {
            op.addError(new Error(7));
        }
        return op;
    }
1336479
public static ContinueResponseSender createResponseSender(final HttpServerExchange exchange) throws IOException {
        if (!exchange.isResponseChannelAvailable()) {
            throw UndertowMessages.MESSAGES.cannotSendContinueResponse();
        }
        if(exchange.getAttachment(ALREADY_SENT) != null) {

            return new ContinueResponseSender() {
                @Override
                public boolean send() throws IOException {
                    return true;
                }

                @Override
                public void awaitWritable() throws IOException {

                }

                @Override
                public void awaitWritable(long time, TimeUnit timeUnit) throws IOException {

                }
            };
        }

        HttpServerExchange newExchange = exchange.getConnection().sendOutOfBandResponse(exchange);
        exchange.putAttachment(ALREADY_SENT, true);
        newExchange.setStatusCode(StatusCodes.CONTINUE);
        newExchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, 0);
        final StreamSinkChannel responseChannel = newExchange.getResponseChannel();
        return new ContinueResponseSender() {
            boolean shutdown = false;

            @Override
            public boolean send() throws IOException {
                if (!shutdown) {
                    shutdown = true;
                    responseChannel.shutdownWrites();
                }
                return responseChannel.flush();
            }

            @Override
            public void awaitWritable() throws IOException {
                responseChannel.awaitWritable();
            }

            @Override
            public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException {
                responseChannel.awaitWritable(time, timeUnit);
            }
        };
    }
863196
public static <T> BuiltGenericResponse<T> create(T body, Response rawResponse) {
    ErrorBody errorBody = null;
    int code = rawResponse.getStatus();
    if (code < 200 || code >= 300) {
      errorBody = ErrorBody.fromResponse(rawResponse);
    }

    return new BuiltGenericResponse<T>(body, errorBody, rawResponse);
  }
233376
public CreateDepartmentResponse create(QYDepartment department) {
        BeanUtil.requireNonNull(department, "department is null");
        CreateDepartmentResponse response;
        String url = BASE_API_URL + "cgi-bin/department/create?access_token=#";
        BaseResponse r = executePost(url, department.toJsonString());
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, CreateDepartmentResponse.class);
        return response;
    }
578588
@Override
    public void setResponse(HttpResponseMessage msg) throws IllegalResponseObjectException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "setResponse: " + msg);
        }

        // null message isn't allowed
        if (null == msg) {
            throw new IllegalResponseObjectException("Illegal null message");
        }

        // save new object as our response object
        HttpResponseMessageImpl temp = null;
        try {
            temp = (HttpResponseMessageImpl) msg;
        } catch (ClassCastException cce) {
            // no FFDC required
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Non msg impl passed to setResponse");
            }
            throw new IllegalResponseObjectException("Invalid message provided");
        }

        // possibly clean up any existing response object
        if (null != getMyResponse() && isResponseOwner()) {
            if (!getMyResponse().equals(temp)) {
                getMyResponse().destroy();
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Caller overlaying same message");
                }
            }
        }
        setMyResponse(temp);
        getMyResponse().init(this);
        // moving the response to the inbound side will use the inbound sides
        // configured header change limit
        getMyResponse().setHeaderChangeLimit(getHttpConfig().getHeaderChangeLimit());
        updatePersistence(getMyResponse());

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "setResponse");
        }
    }
856250
@Override
    protected HTTPResponseHandler createHTTPResponseHandler()
    {
        //get property part
        String propertyPart=this.getPropertyPart();
        
        //get configuration
        Map<String,String> configuration=this.getConfiguration();

        //setup configuration
        configuration=new HashMap<String,String>(configuration);

        //modify configuration
        this.updateHTTPResponseHandlerConfiguration(configuration);

        //create handler
        HTTPResponseHandler handler=new JSONHTTPResponseHandler();
        handler.setPropertyPart(propertyPart);
        handler.initialize(configuration);
        
        return handler;
    }
105947
private void setResponse(int statusCode, String statusMessage, String responseBody, Map<String, List<String>> responseHeaders)
    {
        mStatusCode      = statusCode;
        mStatusMessage   = statusMessage;
        mResponseBody    = responseBody;
        mResponseHeaders = responseHeaders;
    }