Examples of SubjectManagerLocal


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

    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        BundleManagerLocal bundleManager = LookupUtil.getBundleManager();
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();

        Subject overlord = subjectManager.getOverlord();

        PageList<BundleDeployment> deployments = bundleManager.findBundleDeploymentsByCriteria(overlord,
            getCriteriaFromContext(context));

        if (deployments.size() > 0) {
View Full Code Here

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

                    log.error("Failed to delete obsolete plugin file [" + pluginFile + "].");
                }
            } else {
                // now attempt to register the plugin. "dbPlugin" will be the new updated plugin; but if
                // the scanned plugin does not obsolete the current plugin, then dbPlugin will be the old, still valid, plugin.
                SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
                ServerPlugin dbPlugin = serverPluginsManager.registerServerPlugin(subjectManager.getOverlord(), plugin,
                    pluginFile);
                log.info("Registered server plugin [" + dbPlugin.getName() + "], version " + dbPlugin.getVersion());
            }
        } catch (Exception e) {
            log.error("Failed to register server plugin file [" + pluginFile + "]", e);
View Full Code Here

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

        return (DriftServerPluginFacet) getServerPluginComponent(pluginName);
    }

    private Properties getSysConfig() {
        SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();
        SystemManagerLocal systemMgr = LookupUtil.getSystemManager();

        return systemMgr.getSystemConfiguration(subjectMgr.getOverlord());
    }
View Full Code Here

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

     * @throws Exception if there is an error in the sync
     */
    private void sync(String repoName) throws InterruptedException {
        log.debug("Syncing repo [" + repoName + "]...");

        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
        RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();

        // Note that we will keep calling getOverlord on this subject manager - the overlord
        // has a very short session lifespan so we need to keep asking for a new one, due to
        // the possibility that some of the methods we call here take longer than its lifespan
        Subject overlord;

        overlord = subjectManager.getOverlord();
        List<Repo> repoList = repoManager.getRepoByName(repoName);

        if (repoList.size() != 1) {
            throw new RuntimeException("Unexpected number of repos found for name [" + repoName + "]. " + "Found ["
                + repoList.size() + "] repos");
View Full Code Here

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

            throw jobExecutionException;
        }
    }

    private void syncImportedRepos(ContentSource contentSource) throws InterruptedException {
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
        final Subject overlord = subjectManager.getOverlord();
        final RepoCriteria repoCriteria = new RepoCriteria();
        repoCriteria.addFilterContentSourceIds(contentSource.getId());
        repoCriteria.addFilterCandidate(false);

        final RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();
View Full Code Here

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

     */
    private ContentSource synchronizeAndLoad(String contentSourceName, String contentSourceTypeName) throws Exception {
        // note that we will keep calling getOverlord on this subject manager - the overlord
        // has a very short session lifespan so we need to keep asking for a new one, due to the possibility
        // that some of the methods we call here take longer than the overlord's lifespan
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
        Subject overlord;
        ContentSourceManagerLocal contentManager = LookupUtil.getContentSourceManager();
        ContentSource contentSource;

        overlord = subjectManager.getOverlord();
        contentSource = contentManager
            .getContentSourceByNameAndType(overlord, contentSourceName, contentSourceTypeName);

        if (contentSource == null) {
            throw new Exception("Sync job was asked to sync an unknown content source: " + contentSourceName + "|"
View Full Code Here

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

        ContentSourceManagerLocal contentSourceManager = LookupUtil.getContentSourceManager();

        ContentProvider provider = getIsolatedContentProvider(contentSourceId);
        ContentSourceSyncResults results = null;
        SubjectManagerLocal subjMgr = LookupUtil.getSubjectManager();
        Subject overlord = subjMgr.getOverlord();

        // append to this as we go along, building a status report
        StringBuilder progress = new StringBuilder();

        try {
View Full Code Here

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

     */
    public boolean synchronizeRepo(int repoId) {
        log.debug("synchronizeRepo() :: start");

        RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();

        Subject overlord = subjectManager.getOverlord();

        // Load the repo to sync
        Repo repo = repoManager.getRepo(overlord, repoId);
        if (repo == null) {
            throw new IllegalArgumentException("Invalid repository with id [" + repoId + "] specified for sync.");
View Full Code Here

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

    }

    private SyncTracker updateSyncStatus(SyncTracker tracker, ContentSyncStatus status)
        throws InterruptedException {
        RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal();
        SubjectManagerLocal subjMgr = LookupUtil.getSubjectManager();
        Subject overlord = subjMgr.getOverlord();
        int repoId = tracker.getRepoId();
        RepoSyncResults cancelCheck = repoManager.getMostRecentSyncResults(overlord, repoId);
        if (cancelCheck.getStatus() == ContentSyncStatus.CANCELLING) {
            throw new InterruptedException();
        }
View Full Code Here

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

            throw new JobExecutionException(error, e, false);
        } finally {
            // clean up our temporary session by logging out of it
            try {
                if (loggedInSubject != null) {
                    SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();
                    subjectMgr.logout(loggedInSubject);
                }
            } catch (Exception e) {
                log.debug("Failed to log out of temporary resource operation session - will be cleaned up during session purge later: "
                    + ThrowableUtil.getAllMessages(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.