public static String getLoggedInUserName() { String userName = ""; if (CarbonContext.getCurrentContext().getTenantId() != 0) { userName = CarbonContext.getCurrentContext().getUsername() + "@" + CarbonContext.getCurrentContext().getTenantDomain(); } else { userName = CarbonContext.getCurrentContext().getUsername(); } return userName.trim(); }
public String[] getAnalyzerXMLs() throws AnalyzerException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); List<String> analyzerSeqXML = Utils.getEngine().getAnalyzerSeqXMLs(tenantId); return analyzerSeqXML.toArray(new String[analyzerSeqXML.size()]); }
public String[] getAnalyzerXMLs() throws AnalyzerException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); List<String> analyzerSeqXML = Utils.getEngine().getAnalyzerSeqXMLs(tenantId); return analyzerSeqXML.toArray(new String[analyzerSeqXML.size()]); }
public static Map<String, String> getConnectionParameters() throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); return getConnectionParameters(tenantId); }
public CloudService[] retrieveCloudServiceInfo() throws Exception { try { if (CarbonContext.getCurrentContext().getCache(null).containsKey(CLOUD_SERVICE)) { return (CloudService[]) CarbonContext.getCurrentContext() .getCache(null).get(CLOUD_SERVICE); } } catch (Exception ignored) { // TODO: this exception needs not be handled, but the situation which leads to this // exception needs to be. } CloudService[] cloudServices = stub.retrieveCloudServiceInfo(); CarbonContext.getCurrentContext().getCache(null).put(CLOUD_SERVICE, cloudServices); return cloudServices; }
private Registry getRegistry() throws RegistryException { RegistryService registryService = LightWeightEventBrokerComponent.getRegistryService(); Registry registry = registryService.getConfigSystemRegistry(CarbonContext.getCurrentContext().getTenantId()); return registry; }
public String getAnalyzerXML(String analyzerSeqName) throws AnalyzerException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); return Utils.getEngine().getAnalyzerSeqXML(tenantId, analyzerSeqName); }
public String getAnalyzerXML(String analyzerSeqName) throws AnalyzerException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); return Utils.getEngine().getAnalyzerSeqXML(tenantId, analyzerSeqName); }
public void saveCloudServicesActivity(String[] activeServiceNames) throws Exception { CloudService[] cloudServices = (CloudService[]) CarbonContext.getCurrentContext().getCache(null).get(CLOUD_SERVICE); for (CloudService cloudService : cloudServices) { for (String activeService : activeServiceNames) { if (cloudService.getName().equals(activeService)) { cloudService.setActive(true); break; } else { cloudService.setActive(false); } } } stub.saveCloudServicesActivity(activeServiceNames); } }
tenantId = CarbonContext.getCurrentContext().getTenantId();
public String getDataSourceTypeOfTable(String tableName) throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); MetaDataManager metaDataManager = MetaDataManager.getInstance(); TableConfiguration configuration = metaDataManager.getTableMetaData(tenantId, tableName); DataSourceType type = configuration.getDataSourceType(); return type.getName() + ":" + type.isManuallyIndexed(); }
public String getDataSourceTypeOfTable(String tableName) throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); MetaDataManager metaDataManager = MetaDataManager.getInstance(); TableConfiguration configuration = metaDataManager.getTableMetaData(tenantId, tableName); DataSourceType type = configuration.getDataSourceType(); return type.getName() + ":" + type.isManuallyIndexed(); }
tenantId = CarbonContext.getCurrentContext().getTenantId();
private Map<String, String> getConnectionParameters() throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); Map<String, String> credentials = org.wso2.carbon.bam.core.utils.Utils. getConnectionParameters(tenantId); if (!credentialsValid(credentials)) { throw new ConfigurationException("Credentials invalid or not supplied yet.."); } // Initialize meta data related tables before doing meta data operations try { CassandraStoreFactory.getInstance().getDataStore(credentials); } catch (StoreException e) { throw new ConfigurationException("Unable to initialize meta data store.."); } return credentials; }
private Map<String, String> getConnectionParameters() throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); Map<String, String> credentials = org.wso2.carbon.bam.core.utils.Utils. getConnectionParameters(tenantId); if (!credentialsValid(credentials)) { throw new ConfigurationException("Credentials invalid or not supplied yet.."); } // Initialize meta data related tables before doing meta data operations try { CassandraStoreFactory.getInstance().getDataStore(credentials); } catch (StoreException e) { throw new ConfigurationException("Unable to initialize meta data store.."); } return credentials; }
public TableDTO getSingleTableMetaData(String tableName) throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); getConnectionParameters(); // Call this to initialize meta data store MetaDataManager metaDataManager = MetaDataManager.getInstance(); TableConfiguration configuration = metaDataManager.getTableMetaData(tenantId, tableName); TableDTO tableDTO = new TableDTO(); tableDTO.setTableName(configuration.getTableName()); if (configuration.getColumns() != null) { tableDTO.setColumns(configuration.getColumns().toArray(new String[]{})); } tableDTO.setDataSourceType(configuration.getDataSourceType().getName()); return tableDTO; }
public TableDTO getSingleTableMetaData(String tableName) throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); getConnectionParameters(); // Call this to initialize meta data store MetaDataManager metaDataManager = MetaDataManager.getInstance(); TableConfiguration configuration = metaDataManager.getTableMetaData(tenantId, tableName); TableDTO tableDTO = new TableDTO(); tableDTO.setTableName(configuration.getTableName()); if (configuration.getColumns() != null) { tableDTO.setColumns(configuration.getColumns().toArray(new String[]{})); } tableDTO.setDataSourceType(configuration.getDataSourceType().getName()); return tableDTO; }
public Map<String, String> getIndexesOfRecord(Record record, String indexName) throws IndexingException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); IndexConfiguration configuration; try { MetaDataManager metaDataManager = MetaDataManager.getInstance(); configuration = metaDataManager.getIndexMetaData(null, indexName); } catch (ConfigurationException e) { throw new IndexingException("Unable to fetch index meta data..", e); } DataSourceType type = configuration.getDataSourceType(); switch (type) { case CASSANDRA: IndexingStrategy strategy = new CassandraIndexingStrategy(); return strategy.getIndexValuesOfRecord(record, configuration); default: throw new IndexingException("Unknown data source type " + type.getName() + ".."); } }
public boolean deleteTask(String analyzerXML) throws AnalyzerException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); try { UserRegistry configSystemRegistry = Utils.getRegistryService().getConfigSystemRegistry(tenantId);
public boolean configureConnectionParameters(String userName, String password) throws ConfigurationException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); try { UserRegistry configSystemRegistry = ServiceHolder.getRegistryService().