@Override public void init(ConfigurationContext configurationContext) { File deployementDir = new File(MultitenantUtils.getAxis2RepositoryPath(CarbonContext.getThreadLocalCarbonContext(). getTenantId()) + AnalyticsEventSinkConstants.DEPLOYMENT_DIR_NAME); if (!deployementDir.exists()) { if (!deployementDir.mkdir()) { log.warn("Unable to create the deployment dir at: " + deployementDir.getPath()); } } }
public String[] getAnalyzerXMLs() throws AnalyzerException { int tenantId = CarbonContext.getCurrentContext().getTenantId(); List<String> analyzerSeqXML = Utils.getEngine().getAnalyzerSeqXMLs(tenantId); return analyzerSeqXML.toArray(new String[analyzerSeqXML.size()]); }
@Override public KeyStoreData[] getKeyStores() throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); boolean isSuperTenant = CarbonContext.getThreadLocalCarbonContext().getTenantId() == MultitenantConstants.SUPER_TENANT_ID; return admin.getKeyStores(isSuperTenant); }
/** * @return * @throws UserAdminException */ public UIPermissionNode getAllUIPermissions() throws UserAdminException { int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); return getUserAdminProxy().getAllUIPermissions(tenantId); }
@Override public void deletePolicy(String policyId) throws EntitlementException { Registry registry = EntitlementServiceComponent. getGovernanceRegistry(CarbonContext.getThreadLocalCarbonContext().getTenantId()); try { if (registry.resourceExists(PDPConstants.ENTITLEMENT_POLICY_VERSION + policyId)) { registry.delete(PDPConstants.ENTITLEMENT_POLICY_VERSION + policyId); } } catch (RegistryException e) { log.error("Error while deleting all versions of policy", e); } }
public SearchResult getFromCache(String key) { SearchResult searchResult = null; int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); IdentityCacheKey cacheKey = new IdentityCacheKey(tenantId, key); Object entry = getValueFromCache(cacheKey); if (entry != null) { searchResult = (SearchResult) entry; } return searchResult; }
public SearchResult getFromCache(String key) { SearchResult searchResult = null; int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); IdentityCacheKey cacheKey = new IdentityCacheKey(tenantId, key); Object entry = getValueFromCache(cacheKey); if (entry != null) { searchResult = (SearchResult) entry; } return searchResult; }
public void initializeTenant() throws EventBrokerException { if (getTenantIDInMemorySubscriptionStorageCache() .get(CarbonContext.getThreadLocalCarbonContext().getTenantId()) == null){ getTenantIDInMemorySubscriptionStorageCache().put( CarbonContext.getThreadLocalCarbonContext().getTenantId(), new SharedMemorySubscriptionStorage()); } } }
@Override public void addTrustStore(String fileData, String filename, String password, String provider, String type) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); admin.addTrustStore(fileData, filename, password, provider, type); }
@Override public String[] getStoreEntries(String keyStoreName) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); return admin.getStoreEntries(keyStoreName); }
@Override public void addKeyStore(String fileData, String filename, String password, String provider, String type, String pvtkeyPass) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); admin.addKeyStore(fileData, filename, password, provider, type, pvtkeyPass); }
@Override public void deleteStore(String keyStoreName) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); admin.deleteStore(keyStoreName); }
public void renewSubscription(Subscription subscription) throws EventBrokerException { SharedMemorySubscriptionStorage inMemorySubscriptionStorage = getTenantIDInMemorySubscriptionStorageCache() .get(CarbonContext.getThreadLocalCarbonContext().getTenantId()); inMemorySubscriptionStorage.renewSubscription(subscription); }
private String[] getStoreEntries(String keyStoreName) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); return admin.getStoreEntries(keyStoreName); }
@Override public void deleteStore(String keyStoreName) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); admin.deleteStore(keyStoreName); }
@Override public void importCertToStore(String fileName, String fileData, String keyStoreName) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); admin.importCertToStore(fileName, fileData, keyStoreName); }
@Override public void addKeyStore(String fileData, String filename, String password, String provider, String type, String pvtkeyPass) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); admin.addKeyStore(fileData, filename, password, provider, type, pvtkeyPass); }
public PaginatedKeyStoreData getPaginatedKeystoreInfo(String keyStoreName, int pageNumber) throws SecurityConfigException { KeyStoreAdmin admin = new KeyStoreAdmin(CarbonContext.getThreadLocalCarbonContext().getTenantId(), getGovernanceSystemRegistry()); return admin.getPaginatedKeystoreInfo(keyStoreName, pageNumber); }
private UserStoreManager getUserStore(String userName) throws UserStoreException { UserStoreManager userStoreManager = IdentityMgtServiceComponent.getRealmService(). getTenantUserRealm(CarbonContext.getThreadLocalCarbonContext().getTenantId()).getUserStoreManager(); if (userName != null && userName.contains(UserCoreConstants.DOMAIN_SEPARATOR)) { String userStoreDomain = getUserStoreDomainName(userName); return ((AbstractUserStoreManager) userStoreManager) .getSecondaryUserStoreManager(userStoreDomain); } else { return userStoreManager; } }
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(); }