<commit_before>/*
 * Copyright 2011-2015 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.b2international.snowowl.snomed.datastore.id;

import com.b2international.snowowl.core.terminology.ComponentCategory;
import com.b2international.snowowl.snomed.datastore.id.cis.SctId;
import com.b2international.snowowl.snomed.datastore.id.reservations.Reservation;

/**
 * SNOMED CT Identifier service interface. It is capable of generating valid
 * SNOMED CT Identifiers according to the Technical Implementation Guide.
 * 
 * IDs are generated by defining the {@link ComponentCategory} (the component
 * type we need ID for), and an optional namespace parameter. The returned
 * SNOMED CT ID will have a valid check-digit, partition-identifier, and the
 * optional namespace identifier.
 * 
 * @since 4.0
 * @see www.snomed.org/tig?t=trg_app_sctid
 */
public interface ISnomedIdentifierService extends Reservation {

	/**
	 * Generates a single SNOMED CT ID for the defined {@link ComponentCategory}
	 * with the defined extension namespace.
	 * 
	 * @param namespace
	 *            - the extension namespace to use when generating the ID
	 * @param category
	 *            - the component type to generate ID for
	 * @return a valid SNOMED CT identifier, never <code>null</code>
	 */
	String generate(String namespace, ComponentCategory category);

	/**
	 * Generates a single SNOMED CT ID for the defined {@link ComponentCategory}
	 * with the defined extension namespace.
	 * 
	 * @param namespace
	 *            - the extension namespace to use when generating the ID
	 * @param category
	 *            - the component type to generate ID for
	 * @return a valid SNOMED CT identifier, never <code>null</code>
	 */
	void register(String componentId);

	/**
	 * Reserves a single SNOMED CT ID for the defined {@link ComponentCategory}
	 * with the defined extension namespace.
	 * 
	 * @param namespace
	 *            - the extension namespace to use when generating the ID
	 * @param category
	 *            - the component type to generate ID for
	 * @return a valid SNOMED CT identifier, never <code>null</code>
	 */
	String reserve(String namespace, ComponentCategory category);

	/**
	 * Deprecates the given SNOMED CT ID.
	 * 
	 * @param identifier
	 *            - the identifier to deprecate.
	 */
	void deprecate(String componentId);

	/**
	 * Releases a single SNOMED CT ID.
	 * 
	 * @param identifier
	 *            - the identifier to release.
	 */
	void release(String componentId);

	/**
	 * Publishes a single SNOMED CT ID.
	 * 
	 * @param identifier
	 *            - the identifier to publish.
	 */
	void publish(String componentId);

	/**
	 * Gets the {@link SctId} for the given component ID.
	 * 
	 * @param componentId
	 *            the ID of the component.
	 */
	SctId getSctId(String componentId);

	/**
	 * Checks if the component ID is present in the underlying store.
	 * 
	 * @param componentId
	 *            the ID to check.
	 */
	boolean contains(String componentId);

}<commit_msg>SO-1708 Missing from prev commit.<commit_after>/*
 * Copyright 2011-2015 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.b2international.snowowl.snomed.datastore.id;

import java.util.Collection;

import com.b2international.snowowl.core.terminology.ComponentCategory;
import com.b2international.snowowl.snomed.datastore.id.cis.SctId;
import com.b2international.snowowl.snomed.datastore.id.reservations.Reservation;

/**
 * SNOMED CT Identifier service interface. It is capable of generating valid
 * SNOMED CT Identifiers according to the Technical Implementation Guide.
 * 
 * IDs are generated by defining the {@link ComponentCategory} (the component
 * type we need ID for), and an optional namespace parameter. The returned
 * SNOMED CT ID will have a valid check-digit, partition-identifier, and the
 * optional namespace identifier.
 * 
 * @since 4.0
 * @see www.snomed.org/tig?t=trg_app_sctid
 */
public interface ISnomedIdentifierService extends Reservation {

	/**
	 * Generates a single SNOMED CT ID for the defined {@link ComponentCategory}
	 * with the defined extension namespace.
	 * 
	 * @param namespace
	 *            - the extension namespace to use when generating the ID
	 * @param category
	 *            - the component type to generate ID for
	 * @return a valid SNOMED CT identifier, never <code>null</code>
	 */
	String generate(String namespace, ComponentCategory category);

	/**
	 * Generates a single SNOMED CT ID for the defined {@link ComponentCategory}
	 * with the defined extension namespace.
	 * 
	 * @param namespace
	 *            - the extension namespace to use when generating the ID
	 * @param category
	 *            - the component type to generate ID for
	 * @return a valid SNOMED CT identifier, never <code>null</code>
	 */
	void register(String componentId);

	/**
	 * Reserves a single SNOMED CT ID for the defined {@link ComponentCategory}
	 * with the defined extension namespace.
	 * 
	 * @param namespace
	 *            - the extension namespace to use when generating the ID
	 * @param category
	 *            - the component type to generate ID for
	 * @return a valid SNOMED CT identifier, never <code>null</code>
	 */
	String reserve(String namespace, ComponentCategory category);

	/**
	 * Deprecates the given SNOMED CT ID.
	 * 
	 * @param identifier
	 *            - the identifier to deprecate.
	 */
	void deprecate(String componentId);

	/**
	 * Releases a single SNOMED CT ID.
	 * 
	 * @param identifier
	 *            - the identifier to release.
	 */
	void release(String componentId);

	/**
	 * Publishes a single SNOMED CT ID.
	 * 
	 * @param identifier
	 *            - the identifier to publish.
	 */
	void publish(String componentId);

	/**
	 * Gets the {@link SctId} for the given component ID.
	 * 
	 * @param componentId
	 *            the ID of the component.
	 */
	SctId getSctId(String componentId);

	/**
	 * Checks if the component ID is present in the underlying store.
	 * 
	 * @param componentId
	 *            the ID to check.
	 */
	boolean contains(String componentId);

	Collection<String> bulkGenerate(String namespace, ComponentCategory category, int quantity);

	void bulkRegister(Collection<String> componentIds);

	Collection<String> bulkReserve(String namespace, ComponentCategory category, int quantity);

	void bulkRelease(Collection<String> componentIds);

	void bulkDeprecate(Collection<String> componentIds);

	void bulkPublish(Collection<String> componentIds);

}
{'fraction_non_alphanumeric': 0.0823018172241243, 'fraction_numerical': 0.0057940479325783514, 'mean_word_length': 3.23355629877369, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5534080', 'n_tokens_mistral': 2172, 'n_tokens_neox': 1965, 'n_words': 808}