<commit_before>package ca.corefacility.bioinformatics.irida.repositories.remote.impl;

import java.net.URI;
import java.util.List;

import javax.ws.rs.core.UriBuilder;

import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;

import ca.corefacility.bioinformatics.irida.model.RemoteAPI;
import ca.corefacility.bioinformatics.irida.repositories.remote.GenericRemoteRepository;
import ca.corefacility.bioinformatics.irida.repositories.remote.model.resource.ListResourceWrapper;
import ca.corefacility.bioinformatics.irida.repositories.remote.model.resource.RemoteResource;
import ca.corefacility.bioinformatics.irida.repositories.remote.model.resource.ResourceWrapper;
import ca.corefacility.bioinformatics.irida.repositories.remote.resttemplate.OAuthTokenRestTemplate;
import ca.corefacility.bioinformatics.irida.service.RemoteAPITokenService;

/**
 * Remote repository to request from remote IRIDA instances using OAuth2
 * 
 * @author <NAME> <<EMAIL>>
 *
 * @param <Type>
 *            The type of object to be stored in this repository (extends
 *            {@link RemoteResource})
 */
public abstract class GenericRemoteRepositoryImpl<Type extends RemoteResource> implements GenericRemoteRepository<Type> {

	// relative URI to the resource collection
	private String relativeURI;
	// service storing api tokens for communication with the remote services
	private RemoteAPITokenService tokenService;

	// type references for the resources being read by this repository
	protected ParameterizedTypeReference<ListResourceWrapper<Type>> listTypeReference;
	protected ParameterizedTypeReference<ResourceWrapper<Type>> objectTypeReference;

	/**
	 * Create a new repository with the given rest template and object params<commit_msg>Added final to the paramaterized type references<commit_after>package ca.corefacility.bioinformatics.irida.repositories.remote.impl;

import java.net.URI;
import java.util.List;

import javax.ws.rs.core.UriBuilder;

import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;

import ca.corefacility.bioinformatics.irida.model.RemoteAPI;
import ca.corefacility.bioinformatics.irida.repositories.remote.GenericRemoteRepository;
import ca.corefacility.bioinformatics.irida.repositories.remote.model.resource.ListResourceWrapper;
import ca.corefacility.bioinformatics.irida.repositories.remote.model.resource.RemoteResource;
import ca.corefacility.bioinformatics.irida.repositories.remote.model.resource.ResourceWrapper;
import ca.corefacility.bioinformatics.irida.repositories.remote.resttemplate.OAuthTokenRestTemplate;
import ca.corefacility.bioinformatics.irida.service.RemoteAPITokenService;

/**
 * Remote repository to request from remote IRIDA instances using OAuth2
 * 
 * @author <NAME> <<EMAIL>>
 *
 * @param <Type>
 *            The type of object to be stored in this repository (extends
 *            {@link RemoteResource})
 */
public abstract class GenericRemoteRepositoryImpl<Type extends RemoteResource> implements GenericRemoteRepository<Type> {

	// relative URI to the resource collection
	private String relativeURI;
	// service storing api tokens for communication with the remote services
	private RemoteAPITokenService tokenService;

	// type references for the resources being read by this repository
	final protected ParameterizedTypeReference<ListResourceWrapper<Type>> listTypeReference;
	final protected ParameterizedTypeReference<ResourceWrapper<Type>> objectTypeReference;

	/**
	 * Create a new repository with the given rest template and object params
{'fraction_non_alphanumeric': 0.07653734494589602, 'fraction_numerical': 0.0005278437582475588, 'mean_word_length': 6.137476459510358, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '4050552', 'n_tokens_mistral': 1011, 'n_tokens_neox': 954, 'n_words': 239}