Java Code Examples for org.wso2.carbon.registry.core.service.RegistryService

The following examples show how to use org.wso2.carbon.registry.core.service.RegistryService. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Reference(
         name = "registry.service", 
         service = RegistryService.class,
         cardinality = ReferenceCardinality.MANDATORY, 
         policy = ReferencePolicy.DYNAMIC, 
         unbind = "unsetRegistryService")
protected void setRegistryService(RegistryService registryService) {
    try {
        ClaimManagementServiceDataHolder.getInstance().setRegistryService(registryService);
    } catch (Throwable e) {
        log.error("Failed to get a reference to the Registry Service.", e);
    }
    if (log.isDebugEnabled()) {
        log.debug("RegistryService set in Claim Management bundle");
    }
}
 
Example 2
@Before
public void init() throws RegistryException, UserStoreException {
    System.setProperty(CARBON_HOME, "");
    tenantDomain = "carbon.super";
    applicationId = "1";
    tenantID = tenantID;
    messageContext = TestUtils.getMessageContextWithAuthContext("api", "v1");
    registryServiceHolder = Mockito.mock(RegistryServiceHolder.class);
    registryService = Mockito.mock(RegistryService.class);
    registry = Mockito.mock(UserRegistry.class);
    realmService = Mockito.mock(RealmService.class);
    tenantManager = Mockito.mock(TenantManager.class);
    carbonContext = Mockito.mock(PrivilegedCarbonContext.class);
    throttleDataHolder = Mockito.mock(ThrottleDataHolder.class);
    throttlingPolicyResource = Mockito.mock(Resource.class);
    throttleContext = Mockito.mock(ThrottleContext.class);
    PowerMockito.mockStatic(PrivilegedCarbonContext.class);
    PowerMockito.mockStatic(RegistryServiceHolder.class);
    PowerMockito.when(PrivilegedCarbonContext.getThreadLocalCarbonContext()).thenReturn(carbonContext);
    PowerMockito.when(RegistryServiceHolder.getInstance()).thenReturn(registryServiceHolder);
    PowerMockito.when(registryServiceHolder.getRegistryService()).thenReturn(registryService);
    PowerMockito.when(carbonContext.getOSGiService(RealmService.class, null)).thenReturn(realmService);
    PowerMockito.when(realmService.getTenantManager()).thenReturn(tenantManager);
}
 
Example 3
Source Project: carbon-apimgt   Source File: APIUtilTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testGetOAuthConfigurationFromTenantRegistry () throws Exception{
    final int tenantId = -1234;
    final String property = "AuthorizationHeader";

    ServiceReferenceHolder serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class);
    PowerMockito.mockStatic(ServiceReferenceHolder.class);
    RegistryService registryService = Mockito.mock(RegistryService.class);
    UserRegistry userRegistry = Mockito.mock(UserRegistry.class);
    Resource resource = Mockito.mock(Resource.class);
    Mockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
    Mockito.when(serviceReferenceHolder.getRegistryService()).thenReturn(registryService);
    Mockito.when(registryService.getConfigSystemRegistry(tenantId)).thenReturn(userRegistry);
    Mockito.when(userRegistry.resourceExists(APIConstants.API_TENANT_CONF_LOCATION)).thenReturn(true);
    Mockito.when(userRegistry.get(APIConstants.API_TENANT_CONF_LOCATION)).thenReturn(resource);
    File siteConfFile = new File(Thread.currentThread().getContextClassLoader().
            getResource("tenant-conf.json").getFile());
    String tenantConfValue = FileUtils.readFileToString(siteConfFile);
    Mockito.when(resource.getContent()).thenReturn(tenantConfValue.getBytes());
    JSONParser parser = new JSONParser();
    JSONObject json = (JSONObject) parser.parse(tenantConfValue);
    String authorizationHeader = (String)json.get(property);
    String authHeader = getOAuthConfigurationFromTenantRegistry(tenantId,property);
    Assert.assertEquals(authorizationHeader, authHeader);
}
 
Example 4
Source Project: carbon-apimgt   Source File: AbstractAPIManagerTestCase.java    License: Apache License 2.0 6 votes vote down vote up
@Before
public void init() {
    System.setProperty(CARBON_HOME, "");
    privilegedCarbonContext = Mockito.mock(PrivilegedCarbonContext.class);
    PowerMockito.mockStatic(PrivilegedCarbonContext.class);
    PowerMockito.when(PrivilegedCarbonContext.getThreadLocalCarbonContext()).thenReturn(privilegedCarbonContext);
    PowerMockito.mockStatic(GovernanceUtils.class);
    paginationContext = Mockito.mock(PaginationContext.class);
    PowerMockito.mockStatic(PaginationContext.class);
    PowerMockito.when(PaginationContext.getInstance()).thenReturn(paginationContext);
    apiMgtDAO = Mockito.mock(ApiMgtDAO.class);
    registry = Mockito.mock(Registry.class);
    genericArtifactManager = Mockito.mock(GenericArtifactManager.class);
    registryService = Mockito.mock(RegistryService.class);
    tenantManager = Mockito.mock(TenantManager.class);
    graphQLSchemaDefinition = Mockito.mock(GraphQLSchemaDefinition.class);
    keyManager = Mockito.mock(KeyManager.class);
    PowerMockito.mockStatic(KeyManagerHolder.class);
    PowerMockito.when(KeyManagerHolder.getKeyManagerInstance("carbon.super")).thenReturn(keyManager);
}
 
Example 5
Source Project: carbon-device-mgt   Source File: JWTClientUtil.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Get the jwt details from the registry for tenants.
 *
 * @param tenantId for accesing tenant space.
 * @return the config for tenant
 * @throws RegistryException
 */
public static void addJWTConfigResourceToRegistry(int tenantId, String content)
		throws RegistryException {
	try {
		PrivilegedCarbonContext.startTenantFlow();
		PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(tenantId, true);
		RegistryService registryService = JWTClientExtensionDataHolder.getInstance().getRegistryService();
		if (registryService != null) {
			Registry registry = registryService.getConfigSystemRegistry(tenantId);
			JWTClientUtil.loadTenantRegistry(tenantId);
			if (!registry.resourceExists(TENANT_JWT_CONFIG_LOCATION)) {
				Resource resource = registry.newResource();
				resource.setContent(content.getBytes());
				registry.put(TENANT_JWT_CONFIG_LOCATION, resource);
			}
		}
	} finally {
		PrivilegedCarbonContext.endTenantFlow();
	}
}
 
Example 6
@Before
public void setup() throws IOException {
    System.setProperty("carbon.home", "");
    PowerMockito.mockStatic(ServiceReferenceHolder.class);
    PowerMockito.mockStatic(CarbonContext.class);
    serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class);
    componentContext = Mockito.mock(ComponentContext.class);
    registryService = Mockito.mock(RegistryService.class);
    userRegistry = Mockito.mock(UserRegistry.class);
    resource = Mockito.mock(Resource.class);

    Mockito.when(serviceReferenceHolder.getRegistryService()).thenReturn(registryService);
    PowerMockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
    PowerMockito.when(CarbonContext.getThreadLocalCarbonContext()).thenThrow(IndexOutOfBoundsException.class);
}
 
Example 7
/**
 * sets registry service
 *
 * @param registryService <code>RegistryService</code>
 */
@Reference(
        name = "registry.service",
        service = RegistryService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetRegistryService"
)
protected void setRegistryService(RegistryService registryService) {
    if (log.isDebugEnabled()) {
        log.debug("RegistryService set in Entitlement bundle");
    }
    EntitlementServiceComponent.registryService = registryService;
}
 
Example 8
/**
 * un-sets registry service
 *
 * @param registryService <code>RegistryService</code>
 */
protected void unsetRegistryService(RegistryService registryService) {
    if (log.isDebugEnabled()) {
        log.debug("RegistryService unset in Entitlement bundle");
    }
    EntitlementServiceComponent.registryService = null;
}
 
Example 9
@Before
public void setup() throws IOException {
    PowerMockito.mockStatic(ServiceReferenceHolder.class);
    PowerMockito.mockStatic(FileUtil.class);
    serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class);
    componentContext = Mockito.mock(ComponentContext.class);
    registryService = Mockito.mock(RegistryService.class);
    userRegistry = Mockito.mock(UserRegistry.class);
    resource = Mockito.mock(Resource.class);

    Mockito.when(serviceReferenceHolder.getRegistryService()).thenReturn(registryService);
    PowerMockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
}
 
Example 10
@Reference(
         name = "registry.service", 
         service = org.wso2.carbon.registry.core.service.RegistryService.class, 
         cardinality = ReferenceCardinality.MANDATORY, 
         policy = ReferencePolicy.DYNAMIC, 
         unbind = "unsetRegistryService")
protected void setRegistryService(RegistryService registryService) {
    OIDCAuthFEDataHolder.getInstance().setRegistryService(registryService);
}
 
Example 11
Source Project: carbon-identity   Source File: STSServiceComponent.java    License: Apache License 2.0 5 votes vote down vote up
protected void setRegistryService(RegistryService registryService) {
    if (log.isDebugEnabled()) {
        log.debug("RegistryService set in Carbon STS bundle");
    }
    try {
        STSServiceDataHolder.getInstance().setRegistryService(registryService);
    } catch (Throwable e) {
        log.error("Failed to get a reference to the Registry", e);
    }
}
 
Example 12
/**
 * @param userName
 * @param tenantDomain
 * @return
 * @throws CarbonException
 * @throws UserStoreException
 */
private List<String> getUserRoles(String userName, String tenantDomain) throws CarbonException,
        UserStoreException {

    RegistryService registryService = IdentityProvisionServiceComponent.getRegistryService();
    RealmService realmService = IdentityProvisionServiceComponent.getRealmService();

    UserRealm realm = AnonymousSessionUtil.getRealmByTenantDomain(registryService,
            realmService, tenantDomain);

    UserStoreManager userstore = null;
    userstore = realm.getUserStoreManager();
    String[] newRoles = userstore.getRoleListOfUser(userName);
    return Arrays.asList(newRoles);
}
 
Example 13
Source Project: carbon-device-mgt   Source File: TestUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static RegistryService getRegistryService(Class clazz) throws RegistryException {
    RealmService realmService = new InMemoryRealmService();
    RegistryDataHolder.getInstance().setRealmService(realmService);
    DeviceManagementDataHolder.getInstance().setRealmService(realmService);
    InputStream is = clazz.getClassLoader().getResourceAsStream("carbon-home/repository/conf/registry.xml");
    RegistryContext context = RegistryContext.getBaseInstance(is, realmService);
    context.setSetup(true);
    return context.getEmbeddedRegistryService();
}
 
Example 14
@Reference(
        name = "registry.service",
        service = RegistryService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetRegistryService"
)
protected void setRegistryService(RegistryService registryService) {
    if (log.isDebugEnabled()) {
        log.debug("RegistryService set in Identity ApplicationManagementComponent bundle");
    }
    ApplicationManagementServiceComponentHolder.getInstance().setRegistryService(registryService);
}
 
Example 15
/**
 * @param userName
 * @param tenantDomain
 * @return
 * @throws CarbonException
 * @throws UserStoreException
 */
private Map<String, String> getUserClaims(String userName, String tenantDomain) throws CarbonException,
        UserStoreException {

    Map<String, String> inboundAttributes = new HashMap<>();

    RegistryService registryService = IdentityProvisionServiceComponent.getRegistryService();
    RealmService realmService = IdentityProvisionServiceComponent.getRealmService();

    UserRealm realm = AnonymousSessionUtil.getRealmByTenantDomain(registryService,
            realmService, tenantDomain);

    UserStoreManager userstore = null;
    userstore = realm.getUserStoreManager();
    Claim[] claimArray = null;
    try {
        claimArray = userstore.getUserClaimValues(userName, null);
    } catch (UserStoreException e) {
        if (e.getMessage().contains("UserNotFound")) {
            if (log.isDebugEnabled()) {
                log.debug("User " + userName + " not found in user store");
            }
        } else {
            throw e;
        }
    }
    if (claimArray != null) {
        for (Claim claim : claimArray) {
            inboundAttributes.put(claim.getClaimUri(), claim.getValue());
        }
    }

    return inboundAttributes;
}
 
Example 16
Source Project: carbon-device-mgt   Source File: BaseAPIPublisherTest.java    License: Apache License 2.0 5 votes vote down vote up
private void initServices() throws NoSuchFieldException, IllegalAccessException,
        JWTClientException, UserStoreException, RegistryException {

    IntegrationClientService integrationClientService = Mockito.mock(IntegrationClientServiceImpl.class,
            Mockito.CALLS_REAL_METHODS);
    APIPublisherDataHolder.getInstance().setIntegrationClientService(integrationClientService);
    PublisherClient publisherClient = Mockito.mock(PublisherClient.class, Mockito.CALLS_REAL_METHODS);
    doReturn(publisherClient).when(integrationClientService).getPublisherClient();

    APIIndividualApi api = new MockAPIIndividualApi();
    Field field = PublisherClient.class.getDeclaredField("api");
    field.setAccessible(true);
    field.set(publisherClient, api);

    AccessTokenInfo accessTokenInfo = new AccessTokenInfo();
    final String REQUIRED_SCOPE =
            "apim:api_create apim:api_view apim:api_publish apim:subscribe apim:tier_view apim:tier_manage " +
                    "apim:subscription_view apim:subscription_block";
    accessTokenInfo.setScopes(REQUIRED_SCOPE);

    JWTClientManagerService jwtClientManagerService = Mockito.mock(JWTClientManagerServiceImpl.class,
            Mockito.CALLS_REAL_METHODS);
    JWTClient jwtClient = Mockito.mock(JWTClient.class, Mockito.CALLS_REAL_METHODS);
    doReturn(accessTokenInfo).when(jwtClient).getAccessToken(Mockito.anyString(), Mockito.anyString(),
            Mockito.anyString(), Mockito.anyString());
    doReturn(jwtClient).when(jwtClientManagerService).getJWTClient();

    APIIntegrationClientDataHolder.getInstance().setJwtClientManagerService(jwtClientManagerService);
    RegistryService registryService = this.getRegistryService();
    OSGiDataHolder.getInstance().setRegistryService(registryService);
    JWTClientExtensionDataHolder.getInstance().setRegistryService(registryService);
}
 
Example 17
@Reference(
        name = "registry.service",
        service = RegistryService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetRegistryService"
)
protected void setRegistryService(RegistryService registryService) {
    log.debug("Setting the Registry Service");
    IdentityMgtServiceComponent.registryService = registryService;
}
 
Example 18
@Override
public void write(int tenantId, Properties props, String resourcePath)
        throws IdentityMgtConfigException {

    if(log.isDebugEnabled()) {
        log.debug("Writing data to registry path : " + resourcePath);
    }
    
    RegistryService registry = IdentityMgtServiceComponent.getRegistryService();
    try {
        UserRegistry userReg = registry.getConfigSystemRegistry(tenantId);
        Resource resource = userReg.newResource();
        Set<String> names = props.stringPropertyNames();
        // Only key value pairs exists and no multiple values exists a key.
        for (String keyName : names) {
            List<String> value = new ArrayList<String>();
            String valueStr = props.getProperty(keyName);
            
            if(log.isDebugEnabled()) {
                log.debug("Write key : " + keyName + " value : " + value);
            }
            
            // This is done due to casting to List in JDBCRegistryDao
            value.add(valueStr);
            resource.setProperty(keyName, value);
        }
        userReg.put(resourcePath, resource);

    } catch (RegistryException e) {
        throw new IdentityMgtConfigException(
                "Error occurred while writing data to registry path : " + resourcePath, e);
    }

}
 
Example 19
Source Project: carbon-apimgt   Source File: APIKeyMgtServiceComponent.java    License: Apache License 2.0 5 votes vote down vote up
@Reference(
         name = "registry.service", 
         service = org.wso2.carbon.registry.core.service.RegistryService.class, 
         cardinality = ReferenceCardinality.MANDATORY, 
         policy = ReferencePolicy.DYNAMIC, 
         unbind = "unsetRegistryService")
protected void setRegistryService(RegistryService registryService) {
    APIKeyMgtDataHolder.setRegistryService(registryService);
    if (log.isDebugEnabled()) {
        log.debug("Registry Service is set in the API KeyMgt bundle.");
    }
}
 
Example 20
Source Project: carbon-apimgt   Source File: TestUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static ServiceReferenceHolder mockRegistryAndUserRealm(int tenantId) throws UserStoreException, 
                                                                                                RegistryException {
    ServiceReferenceHolder sh = getServiceReferenceHolder();
    
    RealmService realmService = Mockito.mock(RealmService.class);
    TenantManager tm = Mockito.mock(TenantManager.class);
    
    PowerMockito.when(sh.getRealmService()).thenReturn(realmService);
    PowerMockito.when(realmService.getTenantManager()).thenReturn(tm);
    
    RegistryService registryService = Mockito.mock(RegistryService.class);
    PowerMockito.when(sh.getRegistryService()).thenReturn(registryService);
    
    UserRegistry userReg = Mockito.mock(UserRegistry.class);
    PowerMockito.when(registryService.getGovernanceUserRegistry()).thenReturn(userReg);
    
    UserRegistry systemReg = Mockito.mock(UserRegistry.class);
    PowerMockito.when(registryService.getConfigSystemRegistry()).thenReturn(systemReg);
    
    UserRealm userRealm = Mockito.mock(UserRealm.class);
    UserRealm bootstrapRealm = Mockito.mock(UserRealm.class);
    
    PowerMockito.when(systemReg.getUserRealm()).thenReturn(userRealm);        
    PowerMockito.doNothing().when(ServiceReferenceHolder.class); 
    ServiceReferenceHolder.setUserRealm(userRealm);
    org.wso2.carbon.user.api.UserRealm userR = Mockito.mock(org.wso2.carbon.user.api.UserRealm.class);
    PowerMockito.when(realmService.getTenantUserRealm(-1234)).thenReturn(userR);
    AuthorizationManager authManager = Mockito.mock(AuthorizationManager.class);
    PowerMockito.when(userR.getAuthorizationManager()).thenReturn(authManager);
    PowerMockito.when(realmService.getBootstrapRealm()).thenReturn(bootstrapRealm);
    ServiceReferenceHolder.setUserRealm(bootstrapRealm);

    PowerMockito.when(tm.getTenantId(Matchers.anyString())).thenReturn(tenantId);

    return sh;
}
 
Example 21
Source Project: carbon-commons   Source File: ReportingComponent.java    License: Apache License 2.0 5 votes vote down vote up
public static RegistryService getRegistryService() throws RegistryException {

        if (registryServiceInstance == null) {
            throw new RegistryException("Registry Service instance null");
        }
        return registryServiceInstance;
    }
 
Example 22
protected void unsetRegistryService(RegistryService service) {

        if (log.isDebugEnabled()) {
            log.debug("Deployment synchronizer component unbound from the registry service");
        }
        ServiceReferenceHolder.setRegistryService(null);
    }
 
Example 23
@Reference(
        name = "registry.service",
        service = org.wso2.carbon.registry.core.service.RegistryService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetRegistryService"
)
protected void setRegistryService(RegistryService registryService) {

    this.registryService = registryService;
}
 
Example 24
Source Project: product-ei   Source File: EIMigrationServiceComponent.java    License: Apache License 2.0 5 votes vote down vote up
@Reference(
        name = "registry.service",
        service = org.wso2.carbon.registry.core.service.RegistryService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetRegistryService")
protected void setRegistryService(RegistryService registryService) {
    EIMigrationServiceDataHolder.setRegistryService(registryService);
}
 
Example 25
Source Project: product-ei   Source File: MigrationServiceComponent.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Method to set registry service.
 *
 * @param registryService service to get tenant data.
 */
protected void setRegistryService(RegistryService registryService) {
    if (log.isDebugEnabled()) {
        log.debug("Setting RegistryService to WSO2 EI Config component");
    }
    MigrationServiceDataHolder.setRegistryService(registryService);
}
 
Example 26
protected void setRegistryService(RegistryService registryService) {
    if (log.isDebugEnabled()) {
        log.debug("Setting the RegistryService");
    }
    this.registryService = registryService;
    SecurityServiceHolder.setRegistryService(registryService);
}
 
Example 27
Source Project: attic-stratos   Source File: MockIaasServiceComponent.java    License: Apache License 2.0 5 votes vote down vote up
protected void setRegistryService(RegistryService registryService) {
    if (log.isDebugEnabled()) {
        log.debug("Setting the Registry Service");
    }

    try {
        UserRegistry registry = registryService.getGovernanceSystemRegistry();
        ServiceReferenceHolder.getInstance().setRegistry(registry);
    } catch (RegistryException e) {
        String msg = "Failed when retrieving Governance System Registry.";
        log.error(msg, e);
    }
}
 
Example 28
Source Project: carbon-apimgt   Source File: APIMRegistryServiceImplTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void getConfigRegistryResourceContentTestCase() throws UserStoreException, RegistryException, APIManagementException{
    APIMRegistryServiceImpl apimRegistryService = new APIMRegistryServiceImplWrapper();

    System.setProperty(CARBON_HOME, "");
    PrivilegedCarbonContext privilegedCarbonContext = Mockito.mock(PrivilegedCarbonContext.class);
    PowerMockito.mockStatic(PrivilegedCarbonContext.class);
    PowerMockito.when(PrivilegedCarbonContext.getThreadLocalCarbonContext()).thenReturn(privilegedCarbonContext);
    Mockito.when(privilegedCarbonContext.getTenantDomain()).thenReturn(TENANT_DOMAIN);
    Mockito.when(privilegedCarbonContext.getTenantId()).thenReturn(TENANT_ID);

    RealmService realmService = Mockito.mock(RealmService.class);
    TenantManager tenantManager = Mockito.mock(TenantManager.class);
    RegistryService registryService = Mockito.mock(RegistryService.class);
    UserRegistry registry = Mockito.mock(UserRegistry.class);
    Resource resource = Mockito.mock(Resource.class);

    ServiceReferenceHolder serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class);
    PowerMockito.mockStatic(ServiceReferenceHolder.class);
    Mockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
    Mockito.when(serviceReferenceHolder.getRealmService()).thenReturn(realmService);
    Mockito.when(realmService.getTenantManager()).thenReturn(tenantManager);
    Mockito.when(serviceReferenceHolder.getRegistryService()).thenReturn(registryService);


    Mockito.when(tenantManager.getTenantId(TENANT_DOMAIN)).thenReturn(TENANT_ID);
    Mockito.when(registryService.getConfigSystemRegistry(TENANT_ID)).thenReturn(registry);

    PowerMockito.mockStatic(APIUtil.class);
    APIUtil.loadTenantConf(TENANT_ID);
    Mockito.when(registry.resourceExists("testLocation")).thenReturn(true);
    Mockito.when(registry.get("testLocation")).thenReturn(resource);


    Assert.assertEquals("testContent", apimRegistryService.
            getConfigRegistryResourceContent("test.foo", "testLocation"));

}
 
Example 29
Source Project: carbon-apimgt   Source File: APIKeyMgtDataHolder.java    License: Apache License 2.0 4 votes vote down vote up
public static void setRegistryService(RegistryService registryService) {
    APIKeyMgtDataHolder.registryService = registryService;
}
 
Example 30
Source Project: carbon-commons   Source File: Util.java    License: Apache License 2.0 4 votes vote down vote up
public static RegistryService getRegistryService() {
    return registryService;
}