Package org.wso2.carbon.user.api

Examples of org.wso2.carbon.user.api.UserRealm


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

        try {
            int tenantID = 0;
            if (username.contains("@")) {
                tenantID = realmService.getTenantManager().getTenantId(username.substring(username.lastIndexOf("@") + 1));
            }
            UserRealm userRealm = realmService.getTenantUserRealm(tenantID);

            // User not found in the UM
            if (!userRealm.getUserStoreManager().isExistingUser(tenantLessUsername)) {
                throw new AuthenticationException("Invalid User : " + tenantLessUsername, log);
            }

            // Authenticate internal call from another Carbon bundle
            if (password.equals(sharedKeyAccessService.getSharedKey())) {
                return true;
            }

            // Check if the user is authenticated
            return userRealm.getUserStoreManager().authenticate(tenantLessUsername, password);

            // Let the engine know if the user is authenticated or not
        } catch (UserStoreException e) {
            throw new AuthenticationException("User not authenticated for the given username : " + tenantLessUsername, log);
        }
View Full Code Here

            //allow permissions to root topic
            //put the permissions to the user store. here we create the resource name from
            //the topic storage path of the registry.
            //here we allow permissions at each start up since some times user managers
            //may have changed.
            UserRealm userRealm =
                    EventBrokerHolder.getInstance().getRealmService().getTenantUserRealm(EventBrokerHolder.getInstance().getTenantId());
            for (String role : userRealm.getUserStoreManager().getRoleNames()) {
                userRealm.getAuthorizationManager().authorizeRole(
                        role, this.topicStoragePath, EventBrokerConstants.EB_PERMISSION_SUBSCRIBE);
                userRealm.getAuthorizationManager().authorizeRole(
                        role, this.topicStoragePath, EventBrokerConstants.EB_PERMISSION_PUBLISH);

            }
            // we need to create the index here only it is not exists.
            if (!userRegistry.resourceExists(this.indexStoragePath)) {
View Full Code Here

        */
    public Principal getUser(String username) {
        Principal user = null;

        try {
            UserRealm userRealm = getUserRealm(username);

            if ((null != userRealm) && userRealm.getUserStoreManager().isExistingUser(username)) {
                user = new UsernamePrincipal(username);
            }
        } catch (Exception e) {
            logger.error("Error while retrieving RegistryService : " + e.getMessage());
        }
View Full Code Here

            // Authenticate internal call from another Carbon component
            if (password.equals(AuthenticationServiceDataHolder.getInstance().getAccessKey())) {
                isAuthenticated = true;
            } else { // External call
                UserRealm userRealm = getUserRealm(username);

                // Can not find the user realm
                if (null == userRealm) {
                    throw new AccountNotFoundException("Invalid User : " + principal);
                }

                // Get username from tenant username
                int domainNameSeparatorIndex = username.indexOf(DOMAIN_NAME_SEPARATOR);
                if (-1 != domainNameSeparatorIndex) {
                    username = username.substring(0, domainNameSeparatorIndex);
                }

                // User not found in the UM
                if (!userRealm.getUserStoreManager().isExistingUser(username)) {
                    throw new AccountNotFoundException("Invalid User : " + principal);
                }

                // Check if the user is authenticated
                isAuthenticated = userRealm.getUserStoreManager().authenticate(username, password);
            }

            // Let the engine know if the user is authenticated or not
            ((PlainPasswordCallback)passwordCallback).setAuthenticated(isAuthenticated);
        } catch (UserStoreException e) {
View Full Code Here

    public void setPasswordFile(String passwordFile) {
    }

    private UserRealm getUserRealm(String username) {
        UserRealm userRealm = null;

        RealmService realmService = AuthenticationServiceDataHolder.getInstance().getRealmService();
        if (null != realmService) {
            try {
                // Get tenant ID
View Full Code Here

TOP

Related Classes of org.wso2.carbon.user.api.UserRealm

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.