Package org.wso2.carbon.registry.core.service

Examples of org.wso2.carbon.registry.core.service.RegistryService


                CarbonAuthenticationUtil.onFailedAdminLogin(httpSess, username, -1, remoteAddress,
                        "Data");
                return false;
            }

            RegistryService registryService = WebSealAuthBEDataHolder.getInstance().getRegistryService();
            RealmService realmService = WebSealAuthBEDataHolder.getInstance().getRealmService();

            String tenantDomain = UserCoreUtil.getTenantDomain(realmService, username);
            username = UserCoreUtil.getTenantLessUsername(username);
View Full Code Here


     * @throws org.wso2.carbon.registry.core.exceptions.RegistryException if the registry cannot be accessed
     */
    public static UserRegistry getRegistry(int tenantId) throws RegistryException {
        String registryType = getRegistryType();

        RegistryService registryService = ServiceReferenceHolder.getRegistryService();
        if (DeploymentSynchronizerConstants.REGISTRY_TYPE_LOCAL_REPOSITORY.equals(registryType)) {
            return registryService.getLocalRepository(tenantId);
        } else if (DeploymentSynchronizerConstants.REGISTRY_TYPE_GOVERNANCE.equals(registryType)) {
            return registryService.getGovernanceSystemRegistry(tenantId);
        } else {
            return registryService.getConfigSystemRegistry(tenantId);
        }
    }
View Full Code Here

                CarbonAuthenticationUtil.onFailedAdminLogin(httpSess, username, -1, remoteAddress,
                        "Data");
                return false;
            }

            RegistryService registryService = SSOAuthBEDataHolder.getInstance().getRegistryService();
            RealmService realmService = SSOAuthBEDataHolder.getInstance().getRealmService();

            String tenantDomain = UserCoreUtil.getTenantDomain(realmService, username);
            username = UserCoreUtil.getTenantLessUsername(username);
View Full Code Here

                // Unable to call #handleAuthenticationCompleted since there is no way to determine
                // tenantId without knowing the username.
                return false;
            }

            RegistryService registryService = SAML2SSOAuthBEDataHolder.getInstance().getRegistryService();
            RealmService realmService = SAML2SSOAuthBEDataHolder.getInstance().getRealmService();
            String tenantDomain = UserCoreUtil.getTenantDomain(realmService, username);
            int tenantId = realmService.getTenantManager().getTenantId(tenantDomain);
            handleAuthenticationStarted(tenantId);
            boolean isSignatureValid = validateSignature(response, tenantDomain);
View Full Code Here

     */
    public static X509CredentialImpl getX509CredentialImplForTenant(String domainName)
            throws SAML2SSOAuthenticatorException {

        int tenantID = 0;
        RegistryService registryService = SAML2SSOAuthBEDataHolder.getInstance().getRegistryService();
        RealmService realmService = SAML2SSOAuthBEDataHolder.getInstance().getRealmService();

        // get the tenantID
        if (domainName != null) {
            try {
                tenantID = realmService.getTenantManager().getTenantId(domainName);
            } catch (org.wso2.carbon.user.api.UserStoreException e) {
                String errorMsg = "Error getting the TenantID for the domain name";
                log.error(errorMsg, e);
                throw new SAML2SSOAuthenticatorException(errorMsg, e);
            }
        }

        KeyStoreManager keyStoreManager = null;
        try {
            // get an instance of the corresponding Key Store Manager instance
            keyStoreManager = KeyStoreManager.getInstance(registryService.getGovernanceSystemRegistry(tenantID));
        } catch (RegistryException e) {
            String errorMsg = "Error getting a KeyStore Manager instance.";
            log.error(errorMsg, e);
            throw new SAML2SSOAuthenticatorException(errorMsg, e);
        }
View Full Code Here

        String serverURL = CarbonUIUtil.getServerURL(serverConfig);
        String indexPageURL = CarbonUIUtil.getIndexPageURL(serverConfig);
        if (indexPageURL == null) {
            indexPageURL = "/carbon/admin/index.jsp";
        }
        RegistryService registryService = getRegistryService();
        Registry registry = registryService.getLocalRepository();

        UIBundleDeployer uiBundleDeployer = new UIBundleDeployer();
        UIResourceRegistry uiResourceRegistry = new UIResourceRegistry();
        uiResourceRegistry.initialize(bundleContext);
        uiResourceRegistry.setDefaultUIResourceProvider(
View Full Code Here

            return Response.status(Response.Status.UNAUTHORIZED).header("WWW-Authenticate", "Basic").
                    type(MediaType.APPLICATION_JSON).entity(Utils.buildMessage("Username/Password cannot be null")).build();
        }
        try {
            RealmService realmService = ServiceHolder.getRealmService();
            RegistryService registryService = ServiceHolder.getRegistryService();
            String tenantDomain = MultitenantUtils.getTenantDomain(username);
            int tenantId = realmService.getTenantManager().getTenantId(tenantDomain);

            UserRealm userRealm = AnonymousSessionUtil.getRealmByTenantDomain(registryService, realmService, tenantDomain);
            if (userRealm == null) {
View Full Code Here

        return realmService;
    }

    public static RegistryService getRegistryService() {
        PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
        RegistryService registryService = (RegistryService) carbonContext.getOSGiService(RegistryService.class);
        return registryService;
    }
View Full Code Here

        return resourceData;
    }

    private static UserRegistry getRegistry(String username, String password) throws ScriptException {
        UserRegistry registry;
        RegistryService registryService = RegistryHostObjectContext.getRegistryService();

        String tDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(false);

        try {
            int tId = RegistryHostObjectContext.getRealmService().getTenantManager().getTenantId(tDomain);
            registry = registryService.getGovernanceUserRegistry(username, password, tId);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
        if (registry == null) {
View Full Code Here

        return registry;
    }

    private static UserRegistry getRegistry(String username) throws ScriptException {
        UserRegistry registry;
        RegistryService registryService = RegistryHostObjectContext.getRegistryService();

        String tDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(false);

        try {
            int tId = RegistryHostObjectContext.getRealmService().getTenantManager().getTenantId(tDomain);
            registry = registryService.getGovernanceUserRegistry(username, tId);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
        if (registry == null) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.service.RegistryService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.