|
|
|
@ -29,6 +29,7 @@ import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
|
import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
|
|
|
|
|
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
|
|
|
|
import org.wso2.carbon.base.ServerConfiguration;
|
|
|
|
|
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
|
|
|
|
|
import org.wso2.carbon.context.CarbonContext;
|
|
|
|
@ -128,6 +129,8 @@ public class DeviceMgtAPIUtils {
|
|
|
|
|
private static KeyStore trustStore;
|
|
|
|
|
private static char[] keyStorePassword;
|
|
|
|
|
|
|
|
|
|
private static IntegrationClientService integrationClientService;
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
|
|
|
|
|
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
|
|
|
|
@ -297,6 +300,23 @@ public class DeviceMgtAPIUtils {
|
|
|
|
|
return realmService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IntegrationClientService getIntegrationClientService() {
|
|
|
|
|
if (integrationClientService == null) {
|
|
|
|
|
synchronized (DeviceMgtAPIUtils.class) {
|
|
|
|
|
if (integrationClientService == null) {
|
|
|
|
|
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
|
|
|
integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null);
|
|
|
|
|
if (integrationClientService == null) {
|
|
|
|
|
String msg = "IntegrationClientService is not initialized";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new IllegalStateException(msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return integrationClientService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static RegistryService getRegistryService() {
|
|
|
|
|
RegistryService registryService;
|
|
|
|
|
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
|
|
@ -617,6 +637,7 @@ public class DeviceMgtAPIUtils {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to create the Cache that holds the event definition of the device type..
|
|
|
|
|
*
|
|
|
|
|
* @return Cachemanager
|
|
|
|
|
*/
|
|
|
|
|
public static synchronized Cache<String, EventAttributeList> getDynamicEventCache() {
|
|
|
|
|