<commit_before>package com.distelli.europa.ajax;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;

import com.distelli.europa.clients.*;
import com.distelli.europa.db.*;
import com.distelli.europa.models.*;
import com.distelli.gcr.*;
import com.distelli.gcr.auth.*;
import com.distelli.gcr.models.*;
import com.distelli.persistence.*;
import com.distelli.webserver.*;
import com.google.inject.Singleton;
import org.eclipse.jetty.http.HttpMethod;
import lombok.extern.log4j.Log4j;
import javax.inject.Inject;
import com.distelli.europa.util.PermissionCheck;
import com.distelli.europa.EuropaRequestContext;

@Log4j
@Singleton
public class NewPipeline extends AjaxHelper<EuropaRequestContext>
{
    @Inject
    private PipelineDb _db;
    @Inject
    protected PermissionCheck _permissionCheck;

    public NewPipeline()
    {
        this.supportedHttpMethods.add(HTTPMethod.POST);
    }

    public Object get(AjaxRequest ajaxRequest, EuropaRequestContext requestContext)
    {
        _permissionCheck.check(ajaxRequest.getOperation(), requestContext);

        String domain = requestContext.getOwnerDomain();
        String name = ajaxRequest.getParam("name", true);
        PageIterator pageIterator = new PageIterator().pageSize(100);

        Pipeline pipeline = Pipeline.builder()
                                    .domain(domain)
                                    .name(name)
                                    .build();

        _db.createPipeline(pipeline);

        return _db.listByDomain(domain, pageIterator);
    }
}<commit_msg>NewPipeline AjaxHelper returns the pipeline that was created<commit_after>package com.distelli.europa.ajax;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;

import com.distelli.europa.clients.*;
import com.distelli.europa.db.*;
import com.distelli.europa.models.*;
import com.distelli.gcr.*;
import com.distelli.gcr.auth.*;
import com.distelli.gcr.models.*;
import com.distelli.persistence.*;
import com.distelli.webserver.*;
import com.google.inject.Singleton;
import org.eclipse.jetty.http.HttpMethod;
import lombok.extern.log4j.Log4j;
import javax.inject.Inject;
import com.distelli.europa.util.PermissionCheck;
import com.distelli.europa.EuropaRequestContext;

@Log4j
@Singleton
public class NewPipeline extends AjaxHelper<EuropaRequestContext>
{
    @Inject
    private PipelineDb _db;
    @Inject
    protected PermissionCheck _permissionCheck;

    public NewPipeline()
    {
        this.supportedHttpMethods.add(HTTPMethod.POST);
    }

    public Object get(AjaxRequest ajaxRequest, EuropaRequestContext requestContext)
    {
        _permissionCheck.check(ajaxRequest.getOperation(), requestContext);

        String domain = requestContext.getOwnerDomain();
        String name = ajaxRequest.getParam("name", true);
        PageIterator pageIterator = new PageIterator().pageSize(100);

        Pipeline pipeline = Pipeline.builder()
                                    .domain(domain)
                                    .name(name)
                                    .build();
        _db.createPipeline(pipeline);
        return pipeline;
    }
}
{'fraction_non_alphanumeric': 0.10096004955094456, 'fraction_numerical': 0.0037163208423660575, 'mean_word_length': 3.141025641025641, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '673728', 'n_tokens_mistral': 937, 'n_tokens_neox': 914, 'n_words': 176}