Package org.wso2.carbon.user.core.service

Examples of org.wso2.carbon.user.core.service.RealmService


    @Override
    public SVGDimension getDimensions() {
        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing();
            width += getXSpacing();
View Full Code Here


        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new org.wso2.carbon.bpel.ui.bpel2svg.SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing() + getStartIconHeight() + (getYSpacing() / 2);
            width += getXSpacing();
View Full Code Here

    @Override
    public SVGDimension getDimensions() {
        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing() + getStartIconHeight();
            width += getXSpacing();
View Full Code Here

       
    }

    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        try {
            RealmService realmService = IdentitySTSServiceComponent.getRealmService();
            for (int i = 0; i < callbacks.length; i++) {

                if (callbacks[i] instanceof WSPasswordCallback) {
                    WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i];
                    String username = pwcb.getIdentifer();
View Full Code Here

        }
    }

    public boolean authenticateUser(String userName, String password) throws CarbonException,
            UserStoreException {
        RealmService realmService = IdentitySTSServiceComponent.getRealmService();
        RegistryService registryService = IdentitySTSServiceComponent.getRegistryService();
        boolean isAuthenticated = false;
        UserRealm realm = AnonymousSessionUtil.getRealmByUserName(registryService, realmService,
                userName);
        userName = UserCoreUtil.getTenantLessUsername(userName);
View Full Code Here

            domainName = TenantUtils.getDomainNameFromOpenId(openID.getOpenID());
        }
        UserRealm userRealm = IdentityTenantUtil.getRealm(domainName, user);
        Registry registry = IdentityTenantUtil.getRegistry(domainName, user);

        RealmService realmService = IdentityRPServiceComponent.getRealmService();

        if (user != null && userRealm.getUserStoreManager().isExistingUser(user)) {
            this.onUserLogin(user, domainName, httpSess);
            dto.setAuthenticated(true);
            dto.setUserID(user);
            CarbonAuthenticationUtil.onSuccessAdminLogin(httpSess, user,
                                                         realmService.getTenantManager().
                                                                      getTenantId(domainName),
                                                         domainName, "Info card login");
        } else {
            // external parties
            IdentityPersistenceManager persistentManager =
                                                           IdentityPersistenceManager.
                                                                                      getPersistanceManager();
            if (persistentManager.hasSignedUpForOpenId(registry, userRealm, openID.getOpenID())) {
                user = persistentManager.getUserIdForOpenIDSignUp(registry, userRealm,
                                                                  openID.getOpenID());
                if (userRealm.getUserStoreManager().isExistingUser(user)) {
                    CarbonAuthenticationUtil.onSuccessAdminLogin(httpSess,
                                                                 user,
                                                                 realmService.getTenantManager().getTenantId(domainName),
                                                                 domainName,
                                                                 "Info card login");
                    dto.setAuthenticated(true);
                    dto.setUserID(user);
                }
View Full Code Here

            if (username == null) {
                log.error("The username is null");
                throw new Exception("The username is null");
            }

            RealmService realmService = IdentityRPServiceComponent.getRealmService();
            UserRealm userRealm = null;
            Registry registry = null;
            int tenantId = realmService.getTenantManager().getTenantId(domainName);

            if (tenantId == -1) {
                tenantId = this.createTenant(domainName, email, username, firstName, lastName);
            }
View Full Code Here

     * @throws RegistryException if the operation failed.
     */
    public static Registry getSystemRegistry(Registry coreRegistry)
            throws RegistryException {

        RealmService realmService = coreRegistry.getRegistryContext().getRealmService();
        String systemUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;

        if (systemUser.equals(CurrentSession.getUser())) {
            return CurrentSession.getUserRegistry();
        }
View Full Code Here

        return getTenantIdFromDomain(domain);
    }

    private static int getTenantIdFromDomain(String domain) throws RegistryException {
        RegistryContext registryContext = RegistryContext.getBaseInstance();
        RealmService realmService = registryContext.getRealmService();
        if (realmService == null) {
            String msg = "Error in getting the tenant manager. The realm service is not available.";
            log.error(msg);
            throw new RegistryException(msg);
        }
        TenantManager tenantManager = realmService.getTenantManager();
        try {
            return tenantManager.getTenantId(domain);
        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            String msg = "Error in getting the tenant manager.";
            log.error(msg, e);
View Full Code Here

        SecurityManager secMan = System.getSecurityManager();
        if(secMan != null){
           secMan.checkPermission(new ManagementPermission("control"));
        }
        try {
            RealmService realmService = new DefaultRealmService(bundleContext);
            bundleContext.registerService(RealmService.class.getName(), realmService, null);
            DatabaseUtil.logDatabaseConnections();
            UserCoreUtil.setRealmService(realmService);
        } catch (Throwable e) {
            String msg = "Cannot start User Manager Core bundle";
View Full Code Here

TOP

Related Classes of org.wso2.carbon.user.core.service.RealmService

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.