Example usage for java.lang Boolean valueOf

List of usage examples for java.lang Boolean valueOf

Introduction

In this page you can find the example usage for java.lang Boolean valueOf.

Prototype

public static Boolean valueOf(String s) 

Source Link

Document

Returns a Boolean with a value represented by the specified string.

Usage

From source file:it.geosolutions.geoserver.jms.impl.rest.Controller.java

public void setReadOnly(final boolean set) {
    loader.enable(set);/*  ww w  .  j  av  a  2 s  .  c o  m*/
    config.putConfiguration(ReadOnlyConfiguration.READ_ONLY_KEY, Boolean.valueOf(set).toString());
}

From source file:eu.europa.ec.fisheries.uvms.spatial.service.bean.impl.SpatialInitializerBean.java

protected boolean mustRedeploy() {
    boolean isMustRedploy = false;
    String envVariable = System.getenv().get(PROP_USM_DESCRIPTOR_FORCE_UPDATE);

    if (StringUtils.isNotBlank(envVariable)) {
        log.info(/*from  ww  w .j  a v  a 2s.  com*/
                "You have environment variable {}, which overrides the same configuration in {} of Spatial.ear. The value is {}.",
                PROP_USM_DESCRIPTOR_FORCE_UPDATE, PROP_FILE_NAME, envVariable);
        isMustRedploy = Boolean.valueOf(envVariable);
    } else {
        try {
            Properties moduleConfigs = retrieveModuleConfigs();
            isMustRedploy = Boolean.valueOf(moduleConfigs.getProperty(PROP_USM_DESCRIPTOR_FORCE_UPDATE));
            log.info("{} file contains a configuration {}, with the following value {}", PROP_FILE_NAME,
                    PROP_USM_DESCRIPTOR_FORCE_UPDATE, isMustRedploy);
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            log.info(
                    "No {} file with property {} was configured. The default behavior is to skip USM deployment if application has already been deployed.",
                    PROP_FILE_NAME, PROP_USM_DESCRIPTOR_FORCE_UPDATE);
            //in case we can't retrieve a configuration, the default behavior is skipping redeployment
        }
    }
    return isMustRedploy;
}

From source file:org.activiti.rest.conf.DemoDataConfiguration.java

@PostConstruct
public void init() {

    if (Boolean.valueOf(environment.getProperty("create.demo.users", "true"))) {
        LOGGER.info("Initializing demo groups");
        initDemoGroups();/*from www .j  ava2 s  .  co  m*/
        LOGGER.info("Initializing demo users");
        initDemoUsers();
    }

    if (Boolean.valueOf(environment.getProperty("create.demo.definitions", "true"))) {
        LOGGER.info("Initializing demo process definitions");
        initDemoProcessDefinitions();
    }

    if (Boolean.valueOf(environment.getProperty("create.demo.models", "true"))) {
        LOGGER.info("Initializing demo models");
        initDemoModelData();
    }
}

From source file:org.intalio.tempo.uiframework.actions.TasksAction.java

protected void fillModel(Map model) {
    final UIFWApplicationState state = ApplicationState
            .getCurrentInstance(new HttpServletRequestWrapper(_request));
    final String token = state.getCurrentUser().getToken();
    final String user = state.getCurrentUser().getName();
    if (Boolean.valueOf(_request.getParameter("update")).booleanValue()) {
        try {//from  w  ww  . j a  v a2 s. c  o m
            TasksCollector collector = getTaskCollector(user, token);
            model.put("tasks", collector.retrieveTasks());
        } catch (Exception ex) {
            _errors.add(new ActionError(-1, null, "com_intalio_bpms_workflow_tasks_retrieve_error", null,
                    ActionError.getStackTrace(ex), null, null));
            _log.error("Error while retrieving task list", ex);
        }
    }
    model.put("participantToken", token);
    model.put("currentUser", user);
    model.put("refreshTime", Configuration.getInstance().getRefreshTime());
    model.put("sessionTimeout", Configuration.getInstance().getSessionTimeout());
    BPMS_DESCRIPTOR_PARSER.addBpmsBuildVersionsPropertiesToMap(model);
}

From source file:com.mycompany.projetsportmanager.spring.configuration.DefaultProfileConfiguration.java

/**
 * Returns the Show SQL flag./*from  www.j a  v  a2 s. c o m*/
 * @return the Show SQL flag.
 */
@Bean
public Boolean showSql() {
    return Boolean.valueOf(SportManagerAppResourceBundle.getString("hibernate.showSql"));
}

From source file:com.github.dozermapper.core.classmap.Configuration.java

public Boolean getWildcard() {
    return wildcard != null ? wildcard : Boolean.valueOf(DozerConstants.DEFAULT_WILDCARD_POLICY);
}

From source file:org.training.storefront.forms.address.verification.impl.DefaultAddressVerificationResultHandler.java

@Override
public boolean handleResult(final AddressVerificationResult verificationResult, final AddressData newAddress,
        final Model model, final RedirectAttributes redirectModel, final Errors bindingResult,
        final boolean customerBypass, final String successMsg) {
    if (verificationResult != null) {
        if (isResultUnknown(verificationResult)) {
            // Unknown error. Services are likely down.
            return false;
        }//from  www.  j a va  2  s .  c o m

        if (resultHasSuggestedAddresses(verificationResult)) {
            model.addAttribute("inputAddress", newAddress);
            model.addAttribute("customerBypass", Boolean.valueOf(customerBypass));
            model.addAttribute("suggestedAddresses", verificationResult.getSuggestedAddresses());
            model.addAttribute("saveInAddressBook", Boolean.valueOf(newAddress.isVisibleInAddressBook()));
            return true;
        } else if (resultHasErrors(verificationResult)) {
            addFieldErrorsToBindingResult(verificationResult.getErrors(), bindingResult);
            GlobalMessages.addErrorMessage(model, "address.error.formentry.invalid");
            return true;
        } else {
            // The address was successfully verified by Cybersource. Inform the user and proceed.
            GlobalMessages.addFlashMessage(redirectModel, GlobalMessages.CONF_MESSAGES_HOLDER, successMsg);
            return false;
        }
    }

    return false;
}

From source file:org.sakuli.loader.BeanLoader.java

public static Region loadRegionRectangle(int x, int y, int w, int h, String resumeOnException) {
    logger.debug("Get an new Region object over BeanFactory.");
    return new Region(x, y, w, h, Boolean.valueOf(resumeOnException));
}

From source file:com.aurel.track.util.LdapSynchronizer.java

@Override
public Map handleEvent(Map inputBinding) {
    TSiteBean siteBean = (TSiteBean) inputBinding.get(BINDING_PARAMS.SITEBEAN);
    String ldapURL = siteBean.getLdapServerURL();
    String baseURL = LdapUtil.getBaseURL(ldapURL);
    boolean deactivateUnknown = true;
    Map<String, String> ldapMap = LdapUtil.getLdapMap();
    if (ldapMap != null) {
        try {/*w w w. j  a  va2s . c o m*/
            deactivateUnknown = Boolean.valueOf(ldapMap.get(LdapUtil.LDAP_CONFIG.DEACTIVATE_UNKNOWN));
        } catch (Exception e) {

        }
    }
    /**
     * Format of parameter file is "Group name : ldap URL"
     */
    TScriptsBean scriptsBean = ScriptAdminBL.loadByClassName("LdapSynchronizerParams");
    List<String> lines = new ArrayList<String>();
    if (scriptsBean == null) {
        LOGGER.warn("Could not find the script LdapSynchronizerParams");
    } else {
        String params = scriptsBean.getSourceCode();
        if (params != null) {
            lines = ScriptUtil.getParameterDataLines(params);
        }
    }
    Map<String, TPersonBean> ldapPersonsFromGroups = null;
    Map<String, String> groups = ScriptUtil.getParameterMap("^(.*):\\s*(.*)", "#", lines);
    Map<String, List<String>> groupToMemberReferencesMap = new HashMap<String, List<String>>();
    try {
        Map<String, TPersonBean> ldapGroups = LdapUtil.getLdapGroupsByList(baseURL, siteBean,
                null/*groupAttributeName*/, groupToMemberReferencesMap, groups);
        Map<String, List<TPersonBean>> ldapGroupsToPersons = LdapUtil.getGroupToPersonMaps(baseURL, siteBean,
                ldapGroups, groupToMemberReferencesMap);
        ldapPersonsFromGroups = GroupMemberBL.synchronizeUserListWithGroup(ldapGroupsToPersons);
        if (deactivateUnknown) {
            try {
                LdapUtil.deactivateUsers(ldapPersonsFromGroups);
            } catch (Exception e) {
            }
        }
    } catch (Exception e) {
        // TODO Auto-generated catch block
        LOGGER.error(ExceptionUtils.getStackTrace(e));
    }
    return ldapPersonsFromGroups;
}

From source file:functionaltests.RestSchedulerTest.java

@Test
public void testStartScheduler() throws Exception {
    Scheduler scheduler = getScheduler();
    scheduler.stop();/*from ww w. j a  va2  s . c  o m*/
    String resourceUrl = getResourceUrl("start");
    HttpPut httpPut = new HttpPut(resourceUrl);
    setSessionHeader(httpPut);
    HttpResponse response = executeUriRequest(httpPut);
    assertHttpStatusOK(response);
    assertTrue(Boolean.valueOf(getContent(response)));
    assertTrue(SchedulerStatus.STARTED.equals(scheduler.getStatus()));
}