/*
 * 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;

import static com.b2international.snowowl.core.ApplicationContext.getServiceForClass;
import static com.b2international.snowowl.datastore.BranchPathUtils.createMainPath;

import com.b2international.snowowl.datastore.ContentAvailabilityInfoProvider;

/**
 * {@link ContentAvailabilityInfoProvider} for SNOMED&nbsp;CT.
 *
 */
public class SnomedAvailabilityInfoProvider implements ContentAvailabilityInfoProvider {

	@Override
	public boolean isAvailable() {
		return getServiceForClass(SnomedTerminologyBrowser.class).isTerminologyAvailable(createMainPath());
	}

	@Override
	public String getRepositoryUuid() {
		return SnomedDatastoreActivator.REPOSITORY_UUID;
	}

}
@@ -675,38 +675,62 @@
 astore;%0A%0Aimport 
-static
+java.util.Collections;%0A%0Aimport
  com.b2internati
@@ -769,27 +769,63 @@
 text
-.getServiceForClass
+;%0Aimport com.b2international.snowowl.core.branch.Branch
 ;%0Aim
@@ -833,15 +833,8 @@
 ort 
-static 
 com.
@@ -871,427 +871,695 @@
 ore.
-BranchPathUtils.createMainPath;%0A%0Aimport com.b2international.snowowl.datastore.ContentAvailabilityInfoProvider;%0A%0A/**%0A * %7B@link ContentAvailabilityInfoProvider%7D for SNOMED&nbsp;CT.%0A *%0A */%0Apublic class SnomedAvailabilityInfoProvider implements ContentAvailabilityInfoProvider %7B%0A%0A%09@Override%0A%09public boolean isAvailable() %7B%0A%09%09return getServiceForClass(SnomedTerminologyBrowser.class).isTerminologyAvailable(createMainPath())
+ContentAvailabilityInfoProvider;%0Aimport com.b2international.snowowl.eventbus.IEventBus;%0Aimport com.b2international.snowowl.snomed.SnomedConstants.Concepts;%0Aimport com.b2international.snowowl.snomed.datastore.request.SnomedRequests;%0A%0A/**%0A * %7B@link ContentAvailabilityInfoProvider%7D for SNOMED&nbsp;CT.%0A *%0A */%0Apublic class SnomedAvailabilityInfoProvider implements ContentAvailabilityInfoProvider %7B%0A%0A%09@Override%0A%09public boolean isAvailable() %7B%0A%09%09return SnomedRequests.prepareSearchConcept()%0A%09%09%09%09.setLimit(0)%0A%09%09%09%09.setComponentIds(Collections.singleton(Concepts.ROOT_CONCEPT))%0A%09%09%09%09.build(Branch.MAIN_PATH)%0A%09%09%09%09.executeSync(ApplicationContext.getServiceForClass(IEventBus.class)).getTotal() %3E 0
 ;%0A%09%7D

use requests in SnomedAvailabilityInfoProvider