Package org.rhq.enterprise.server.system

Examples of org.rhq.enterprise.server.system.SystemManagerLocal


            settings = globalPermissions.contains(Permission.MANAGE_SETTINGS);
            bundle = globalPermissions.contains(Permission.MANAGE_BUNDLE);
            isSuperuser = LookupUtil.getAuthorizationManager().isSystemSuperuser(user);
        }

        SystemManagerLocal systemManager = LookupUtil.getSystemManager();
        isDebugMode = systemManager.isDebugModeEnabled();
        isExperimental = systemManager.isExperimentalFeaturesEnabled();
    }
View Full Code Here


*/
@Test
public class SystemSettingsValidatorTest extends JMockTest {

    public void testValidatorCallsSystemManager() {
        final SystemManagerLocal systemManager = context.mock(SystemManagerLocal.class);
       
        SystemSettingsValidator validator = new SystemSettingsValidator(systemManager);
       
        final Properties settings = new Properties();
        settings.put("A", "a");
View Full Code Here

    public TimeZone getTimeZone() {
        return TimeZone.getDefault();
    }

    public boolean isDebugModeEnabled() {
        SystemManagerLocal systemManager = LookupUtil.getSystemManager();
        return Boolean.valueOf(systemManager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord())
            .getProperty(RHQConstants.EnableDebugMode));
    }
View Full Code Here

        return Boolean.valueOf(systemManager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord())
            .getProperty(RHQConstants.EnableDebugMode));
    }

    public boolean isExperimentalFeaturesEnabled() {
        SystemManagerLocal systemManager = LookupUtil.getSystemManager();
        return Boolean.valueOf(systemManager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord())
            .getProperty(RHQConstants.EnableExperimentalFeatures));
    }
View Full Code Here

    private RssFeedParser parser = new RssFeedParser();

    private final Log log = LogFactory.getLog(this.getClass());

    public void initialize(Configuration configuration) throws Exception {
        SystemManagerLocal systemManager = LookupUtil.getSystemManager();
        Subject overlord = LookupUtil.getSubjectManager().getOverlord();
        SystemSettings settings = systemManager.getSystemSettings(overlord);
        url = safeGetConfigurationProperty("url", configuration);

        if (url == null) {
            throw new IllegalArgumentException("url cannot be null");
        }
View Full Code Here

                    actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
                        "admin.role.LdapGroupFilterMessage"));
                    saveErrors(request, actionMessages);
                } else if (cause instanceof LdapCommunicationException) {
                    ActionMessages actionMessages = new ActionMessages();
                    SystemManagerLocal manager = LookupUtil.getSystemManager();
                    Properties options = manager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord());
                    String providerUrl = options.getProperty(RHQConstants.LDAPUrl, "(unavailable)");
                    actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
                        "admin.role.LdapCommunicationMessage", providerUrl));
                    saveErrors(request, actionMessages);
                }
            }
        } catch (LdapFilterException lce) {
            ActionMessages actionMessages = new ActionMessages();
            actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("admin.role.LdapGroupFilterMessage"));
            saveErrors(request, actionMessages);
        } catch (LdapCommunicationException lce) {
            ActionMessages actionMessages = new ActionMessages();
            SystemManagerLocal manager = LookupUtil.getSystemManager();
            Properties options = manager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord());
            String providerUrl = options.getProperty(RHQConstants.LDAPUrl, "(unavailable)");
            actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("admin.role.LdapCommunicationMessage",
                providerUrl));
            saveErrors(request, actionMessages);
        }
View Full Code Here

     *
     * @exception JspException if the scripting variable can not be found or if there is an error processing the tag
     */
    public final int doStartTag() throws JspException {
        try {
            SystemManagerLocal systemManager = LookupUtil.getSystemManager();

            log.trace("getting CAM config property [" + prop + "]");
            Properties conf = systemManager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord());
            String propVal = conf.getProperty(prop);

            if (value != null) {
                setScopedVariable(new Boolean(propVal.equals(value)));
            } else {
View Full Code Here

public class EditConfigPrepAction extends TilesAction {
    @Override
    public ActionForward execute(ComponentContext context, ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
        SystemConfigForm cForm = (SystemConfigForm) form;
        SystemManagerLocal systemManager = LookupUtil.getSystemManager();
        cForm.loadConfigProperties(systemManager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord()));

        return null;
    }
View Full Code Here

        }

        Subject whoami = WebUtility.getSubject(request);
        SystemConfigForm cForm = (SystemConfigForm) form;
        ServletContext ctx = getServlet().getServletContext();
        SystemManagerLocal systemManager = LookupUtil.getSystemManager();

        if (cForm.isOkClicked()) {
            try {
                log.trace("Getting config");
                Properties props = cForm.saveConfigProperties(systemManager.getSystemConfiguration(LookupUtil
                    .getSubjectManager().getOverlord()));

                log.trace("Setting config");
                if (LookupUtil.getAuthorizationManager().isSystemSuperuser(whoami)
                    && request.getParameter("debug") != null) {
                    /*
                     * if the superuser is logged in and the "debug" url parameter is present,
                     * validation will be skipped to enable special administration functions
                     * that might violate the standard restrictions
                     */
                    systemManager.setSystemConfiguration(whoami, props, true);
                } else {
                    systemManager.setSystemConfiguration(whoami, props, false);
                }

                log.trace("Restarting config service");

                systemManager.reconfigureSystem(whoami);

                if (cForm.getLdapEnabled() != null) {
                    // cache in servlet context
                    ctx.setAttribute(AttrConstants.JAAS_PROVIDER_CTX_ATTR, RHQConstants.LDAPJAASProvider);
                } else {
View Full Code Here

    private final static Logger log = Logger.getLogger(Config.class);

    private final SystemSettings settings;

    public Config() {
        SystemManagerLocal systemManager = LookupUtil.getSystemManager();
        settings = systemManager.getUnmaskedSystemSettings(false);
    }
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.system.SystemManagerLocal

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.