<commit_before>package pl.softwaremill.common.sqs;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.AmazonSQSClient;
import com.amazonaws.services.sqs.model.GetQueueUrlRequest;
import com.amazonaws.services.sqs.model.GetQueueUrlResult;
import com.amazonaws.services.sqs.model.QueueDoesNotExistException;
import pl.softwaremill.common.sqs.exception.SQSRuntimeException;

import static com.google.common.base.Preconditions.checkNotNull;
import static pl.softwaremill.common.sqs.SQSConfiguration.*;

/**
 * @author <NAME>
 * @since 11/10/12 12:12
 */
public class SQS {

    private final AmazonSQS sqsClient;

    public SQS(AmazonSQS sqsClient) {
        this.sqsClient = sqsClient;
    }

    public SQS() {
        AmazonSQSClient sqsClient = new AmazonSQSClient(new BasicAWSCredentials(AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID),
                new ClientConfiguration().withProtocol(Util.determineProtocol(SQS_SERVER)));
        sqsClient.setEndpoint(SQS_SERVER);

        this.sqsClient = sqsClient;
    }

    public SQS(String server, String accessKey, String secretKey) {
        AmazonSQSClient sqsClient = new AmazonSQSClient(new BasicAWSCredentials(accessKey, secretKey),
                new ClientConfiguration().withProtocol(Util.determineProtocol(server)));
        sqsClient.setEndpoint(server);

        this.sqsClient = sqsClient;<commit_msg>Corrects the SQS class connection credentials.<commit_after>package pl.softwaremill.common.sqs;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.AmazonSQSClient;
import com.amazonaws.services.sqs.model.GetQueueUrlRequest;
import com.amazonaws.services.sqs.model.GetQueueUrlResult;
import com.amazonaws.services.sqs.model.QueueDoesNotExistException;
import pl.softwaremill.common.sqs.exception.SQSRuntimeException;

import static com.google.common.base.Preconditions.checkNotNull;
import static pl.softwaremill.common.sqs.SQSConfiguration.*;

/**
 * @author <NAME>
 * @since 11/10/12 12:12
 */
public class SQS {

    private final AmazonSQS sqsClient;

    public SQS(AmazonSQS sqsClient) {
        this.sqsClient = sqsClient;
    }

    public SQS() {
        AmazonSQSClient sqsClient = new AmazonSQSClient(new BasicAWSCredentials(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY),
                new ClientConfiguration().withProtocol(Util.determineProtocol(SQS_SERVER)));
        sqsClient.setEndpoint(SQS_SERVER);

        this.sqsClient = sqsClient;
    }

    public SQS(String server, String accessKey, String secretKey) {
        AmazonSQSClient sqsClient = new AmazonSQSClient(new BasicAWSCredentials(accessKey, secretKey),
                new ClientConfiguration().withProtocol(Util.determineProtocol(server)));
        sqsClient.setEndpoint(server);

        this.sqsClient = sqsClient;
{'fraction_non_alphanumeric': 0.09256252029879831, 'fraction_numerical': 0.006495615459564794, 'mean_word_length': 4.569620253164557, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7150889', 'n_tokens_mistral': 984, 'n_tokens_neox': 920, 'n_words': 152}