Examples of UserRegistry


Examples of com.ibm.websphere.security.UserRegistry

                    + ", Principal identity: " + System.identityHashCode(principal));
       
        if (principal instanceof WSLCPrincipal) // This code path is hit if this login command handled authentication.
        {
            ContextManager contextManager = ((WSLCPrincipal)principal).getContextManager();
            UserRegistry registry = contextManager.getRegistry(contextManager.getDefaultRealm());
           
            try
            {
                List groups = new ArrayList(registry.getGroupsForUser(principal.getName()));

                groups.retainAll(roles);
              
                // if authorization succeeds, set the user's Subject on this invocation context
                // so that the rest of the Thread is executed in the context of the appropriate Subject
View Full Code Here

Examples of de.iritgo.aktario.framework.user.UserRegistry

    for (Iterator i = queryRegistry.queryIterator("aktera.journal.list.notvisible"); i.hasNext();)
    {
      AkteraQuery query = (AkteraQuery) i.next();
      long userUniqueId = query.getUserUniqueId();
      UserRegistry userRegistry = Server.instance().getUserRegistry();
      User iritgoUser = userRegistry.getUser(userUniqueId);

      if (akteraUserName.equals(iritgoUser.getName()))
      {
        Properties props = new Properties();
View Full Code Here

Examples of net.fortytwo.twitlogic.persistence.UserRegistry

            try {
                //store.dump(System.out);
                dumpTabSeparatedFile(store, new File("/tmp/earthquaketweets.txt"));

                CustomTwitterClient client = new CustomTwitterClient();
                UserRegistry userRegistry = new UserRegistry(client);

                TweetPersister baseStatusHandler = new TweetPersister(store, client);
                TweetDeleter d = new TweetDeleter(store);

                // Create an agent to listen for commands.
                // Also take the opportunity to memoize users we're following.
                TwitLogicAgent agent = new TwitLogicAgent(client);
                Handler<Tweet> statusHandler
                        = userRegistry.createUserRegistryFilter(
                        new CommandListener(agent, baseStatusHandler));

                Set<User> users = new HashSet<User>();
                Set<String> terms = new HashSet<String>();
                terms.add("earthquake");
View Full Code Here

Examples of org.wso2.carbon.registry.core.session.UserRegistry

            String dashboardConfigFile = dashboardDiskRoot + File.separator + "dashboard.xml";
            String gadgetsDiskLocation = dashboardDiskRoot + File.separator + "gadgets";

            // Check whether the system dashboard is already available if not populate
            UserRegistry registry = DashboardPopulatorContext.getRegistry(tenantId);

            // Set permission for annonymous read. We do it here because it should happen always in order
            // to support mounting a remote registry.
            AuthorizationManager accessControlAdmin =
                    registry.getUserRealm().getAuthorizationManager();

            if (!accessControlAdmin.isRoleAuthorized(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                    GadgetPopulator.SYSTEM_GADGETS_PATH, ActionConstants.GET)) {
                accessControlAdmin.authorizeRole(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
                        GadgetPopulator.SYSTEM_GADGETS_PATH, ActionConstants.GET);
            }

            String serverName = CarbonUtils.getServerConfiguration().getFirstProperty("Name");

/*            String serverPrefix = serverName.indexOf("Business Activity Monitor") > -1 ? "bam" : "";

            if (serverName.length() > 0) {
                gadgetsPath = SYSTEM_GADGETS_PATH + "/" + serverPrefix;
            }*/

            if (!registry.resourceExists(REGISTRY_SYSTEM_DASHBOARDS_ROOT + "/" + serverName)) {
                // Creating an OMElement from file
                File dashboardConfigXml = new File(dashboardConfigFile);

                if (dashboardConfigXml.exists()) {
                    FileReader dashboardConfigXmlReader = new FileReader(dashboardConfigXml);

                    // Restoring from file
                    registry.restore(REGISTRY_SYSTEM_DASHBOARDS_ROOT, dashboardConfigXmlReader);

                    log.info("Successfully populated the default Dashboards.");

                } else {
                    log.info("Couldn't find a Dashboard at '" + dashboardConfigFile +
                            "'. Giving up.");
                }

                // Store gadgets
                File gadgetsDir = new File(gadgetsDiskLocation);
                if (gadgetsDir.exists()) {
                    GadgetPopulator.beginFileTansfer(gadgetsDir, tenantId);

                    log.info("Successfully populated the default Gadgets.");
                } else {
                    log.info("Couldn't find contents at '" + gadgetsDiskLocation +
                            "'. Giving up.");
                }
                registry.put(REGISTRY_SYSTEM_DASHBOARDS_ROOT + "/" + serverName, registry.newResource());
            }

        } catch (Exception e) {
            log.debug("Failed to activate Dashboard Populator for Governance bundle ");
        }
View Full Code Here

Examples of org.wso2.carbon.registry.core.session.UserRegistry

        try {

            // Storing the root path for future reference
            String rootPath = rootDirectory.getAbsolutePath();

            UserRegistry registry = DashboardPopulatorContext.getRegistry(tenantId);

            // Creating the default gadget collection resource
            Collection defaultGadgetCollection = registry.newCollection();
            try {
                registry.beginTransaction();
                registry.put(gadgetsPath, defaultGadgetCollection);

                transferDirectoryContentToRegistry(rootDirectory, registry, rootPath, tenantId);
                registry.commitTransaction();
            } catch (Exception e) {
                registry.rollbackTransaction();
                log.error(e.getMessage(), e);
            }


        } catch (DashboardPopulatorException e) {
View Full Code Here

Examples of org.wso2.carbon.registry.core.session.UserRegistry

            gadgetUrl = gadgetUrl.split("path=")[1];
        } else {
            //GS is not hosting this gadget
            return true;
        }
        UserRegistry registry = (UserRegistry) getConfigUserRegistry();
        return registry.getUserRealm().getAuthorizationManager().isUserAuthorized(user, gadgetUrl, ActionConstants.GET);
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.session.UserRegistry

import org.wso2.carbon.registry.core.session.UserRegistry;

public class CustomUIService extends RegistryAbstractAdmin implements ICustomUIService {

    public String getTextContent(String path) throws Exception {
        UserRegistry registry = (UserRegistry)getRootRegistry();
        return GetTextContentUtil.getTextContent(path, registry);
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.session.UserRegistry

        UserRegistry registry = (UserRegistry)getRootRegistry();
        return GetTextContentUtil.getTextContent(path, registry);
    }

    public boolean updateTextContent(String path, String content) throws Exception {
        UserRegistry registry = (UserRegistry)getRootRegistry();
        UpdateTextContentUtil.updateTextContent(path, content, registry);
        return true;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.session.UserRegistry

    }

    public boolean addTextContent(
            String parentPath, String resourceName, String mediaType, String description, String content)
            throws Exception {
        UserRegistry registry = (UserRegistry)getRootRegistry();
        AddTextResourceUtil.addTextResource(parentPath, resourceName, mediaType, description, content, registry);
        return true;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.session.UserRegistry

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        try {
            UserRegistry registry = (UserRegistry) request.getSession().getAttribute(
                            RegistryConstants.ROOT_REGISTRY_INSTANCE);
            String path = request.getParameter("path");
            if (path == null) {
                String msg = "Could not get the resource content. Path is not specified.";
                log.error(msg);
                response.setStatus(400);
                return;
            }

            Resource resource = null;
            try {
                resource = registry.get(path);
            } catch (RegistryException e) {
                String msg = "Error retrieving the resource " + path + ". " + e.getMessage();
                log.error(msg, e);
                throw e;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.