Package org.rhq.enterprise.server.auth

Examples of org.rhq.enterprise.server.auth.SubjectManagerLocal


            }
        }
    }

    private Subject getOverlord() {
        SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();
        return subjectMgr.getOverlord();
    }
View Full Code Here


            // its session validated.  If there is ever a case where we pass Subject as the first parameter
            // to an EJB and we do NOT want to validate its session, you need to annotate that EJB
            // method with @ExcludeDefaultInterceptors so we don't call this interceptor.
            if (subject != null) {
                if (subject.getSessionId() != null) {
                    SubjectManagerLocal subject_manager = LookupUtil.getSubjectManager();

                    // isValidSessionId will also update the session's last-access-time
                    if (!subject_manager.isValidSessionId(subject.getSessionId(), subject.getName(), subject.getId())) {
                        // if this happens, it is possible someone is trying to spoof an authenticated user!
                        throw buildPermissionException("The session ID for user [" + subject.getName()
                            + "] is invalid!", invocation_context);
                    }
                } else {
View Full Code Here

            throw new JobExecutionException(error, e, false);
        } finally {
            // clean up our temporary session by logging out of it
            try {
                if (user != null) {
                    SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();
                    subjectMgr.logout(user);
                }
            } catch (Exception e) {
                log.debug("Failed to log out of temporary group operation session - will be cleaned up during session purge later: "
                    + ThrowableUtil.getAllMessages(e));
            }
View Full Code Here

    public boolean getHasContentSources() {
        return getRepo().getContentSources().size() > 0;
    }

    public SelectItem[] getAvailableOwners() {
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
        Subject subject = EnterpriseFacesContextUtility.getSubject();

        SubjectCriteria c = new SubjectCriteria();
        c.addFilterFsystem(false);
        c.addSortName(PageOrdering.ASC);
        PageList<Subject> subjects = subjectManager.findSubjectsByCriteria(subject, c);

        ArrayList<SelectItem> items = new ArrayList<SelectItem>(subjects.size());

        items.add(new SelectItem(null, "--None--"));
View Full Code Here

        if (repo.getOwner().getName() == null) {
            repo.setOwner(null);
        } else if (repo.getOwner().getName().equals(loggedInSubject.getName())) {
            repo.setOwner(loggedInSubject);
        } else {
            SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
            Subject s = subjectManager.getSubjectByName(repo.getOwner().getName());
            repo.setOwner(s);
        }
    }
View Full Code Here

    public void setRepo(Repo newRepo) {
        this.newRepo = newRepo;
    }

    public SelectItem[] getAvailableOwners() {
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
        Subject subject = EnterpriseFacesContextUtility.getSubject();

        SubjectCriteria c = new SubjectCriteria();
        c.addFilterFsystem(false);
        c.addSortName(PageOrdering.ASC);
        PageList<Subject> subjects = subjectManager.findSubjectsByCriteria(subject, c);

        ArrayList<SelectItem> items = new ArrayList<SelectItem>(subjects.size());

        items.add(new SelectItem(null, "--None--"));
View Full Code Here

        if (newRepo.getOwner().getName() == null) {
            newRepo.setOwner(null);
        } else if (newRepo.getOwner().getName().equals(loggedInSubject.getName())) {
            newRepo.setOwner(loggedInSubject);
        } else {
            SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
            Subject s = subjectManager.getSubjectByName(newRepo.getOwner().getName());
            newRepo.setOwner(s);
        }
    }
View Full Code Here

    }

    private void initNewRepo() {
        newRepo = new Repo();

        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();

        //use a copy so that we can modify it without invalidating the user in the session
        Subject currenUserCopy = subjectManager.getSubjectById(EnterpriseFacesContextUtility.getSubject().getId());

        newRepo.setOwner(currenUserCopy);
    }
View Full Code Here

        /*
         * Would be nice to get the resource name, but it is not in the response, so we could bring back the log message
         * that used to be here
         */
        ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();

        int configUpdateId = response.getConfigurationUpdateId();
        ResourceConfigurationUpdate configUpdate = configurationManager.getResourceConfigurationUpdate(
            subjectManager.getOverlord(), configUpdateId);

        if (configUpdate != null) {
            Resource resource = configUpdate.getResource();
            if (resource != null)
                LOG.debug("Resource configuration update [" + configUpdate.getId() + "] for " + resource
View Full Code Here

    }

    @Override
    public void persistUpdatedResourceConfiguration(int resourceId, Configuration resourceConfiguration) {
        ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();

        Subject overlord = subjectManager.getOverlord();
        ResourceConfigurationUpdate update = configurationManager.persistResourceConfigurationUpdateInNewTransaction(
            overlord, resourceId, resourceConfiguration, ConfigurationUpdateStatus.SUCCESS, null, false);

        if (update == null) {
            LOG.debug("Not persisting Configuration " + resourceConfiguration
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.auth.SubjectManagerLocal

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.