Example usage for java.lang Boolean booleanValue

List of usage examples for java.lang Boolean booleanValue

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public boolean booleanValue() 

Source Link

Document

Returns the value of this Boolean object as a boolean primitive.

Usage

From source file:be.fedict.trust.client.WSSecurityClientHandler.java

public boolean handleMessage(SOAPMessageContext soapMessageContext) {
    Boolean outboundProperty = (Boolean) soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

    SOAPMessage soapMessage = soapMessageContext.getMessage();
    SOAPPart soapPart = soapMessage.getSOAPPart();

    if (false == outboundProperty.booleanValue()) {
        /*/*from  ww w .j a  v a2  s . c  o  m*/
         * Validate incoming WS-Security header if present
         */
        return handleInboundDocument(soapPart, soapMessageContext);
    }

    return true;
}

From source file:com.anite.antelope.zebra.om.AntelopeTaskDefinition.java

/**
 * This is used to filter all tasks by task lists
 * Unlike most of these this defaults to false as it is easier that way!
 * @return/*from  w  w  w.ja v a2s . c  om*/
 */
public boolean getShowInTaskList() {
    Boolean show = getGeneralProperties().getBooleanAsObj(PROP_GET_SHOW_IN_TASK_LIST);
    if (show == null) {
        return true;
    } else {
        return show.booleanValue();
    }
}

From source file:com.aurel.track.screen.dashboard.action.DashboardParamsConfigAction.java

@Override
public void prepare() {
    locale = (Locale) session.get(Constants.LOCALE_KEY);
    Boolean fromAdmin = (Boolean) session.get(DashboardScreenEditAction.DASHBOARD_EDIT_FROM);
    if (fromAdmin == null) {
        fromAdmin = new Boolean(false);
    }//from  ww w  .  java 2 s.  com
    if (fromAdmin.booleanValue()) {
        //set in dashboardAssign
        personBean = DashboardAssignBL
                .loadPersonByKey((Integer) session.get(DashboardScreenEditAction.DASHBOARD_EDIT_PERSON));
        backAction = "dashboardAssign.action";
    } else {
        personBean = (TPersonBean) session.get(Constants.USER_KEY);
        backAction = "cockpit.action";
    }
}

From source file:com.funambol.server.config.ConfigurationTest.java

/**
 * Test of plugin handling//from   ww  w  . j av  a 2  s.  c  o m
 * @throws Exception
 */
public void testPlugin_2() throws Exception {

    Boolean b = (Boolean) PrivateAccessor.getField(Configuration.getConfiguration(),
            "engineComponentsInitialized");

    assertFalse("The engine components should not be initialized", b.booleanValue());

    //
    // engine components not initialized
    //
    PluginHandler pluginHandler = (PluginHandler) PrivateAccessor.getField(Configuration.getConfiguration(),
            "pluginHandler");

    assertNull(pluginHandler);

    //
    // Touching a plugin file, nothing should happen
    //
    File f = new File(Configuration.getConfigPath() + "/com/funambol/server/plugin/dummy-plugin-1.xml");
    if (!f.isFile()) {
        fail("Missing file: " + f);
    }
    assertTrue("Unable to set the last-modified time of the file",
            f.setLastModified(System.currentTimeMillis()));
    // Waiting for automatic change detection
    Thread.sleep(15 * 1000);

    //
    // engine components not initialized
    //
    pluginHandler = (PluginHandler) PrivateAccessor.getField(Configuration.getConfiguration(), "pluginHandler");

    assertNull(pluginHandler);
}

From source file:com.aurel.track.exchange.excel.ExcelFieldMatchAction.java

/**
 * Save the field mappings for the next use
 * @return/*from  www . j  a va2  s  .  co  m*/
 */
public String save() {
    workbook = ExcelFieldMatchBL.loadWorkbook(excelMappingsDirectory, fileName);
    SortedMap<Integer, String> columnIndexToColumNameMap = ExcelFieldMatchBL.getFirstRowHeaders(workbook,
            selectedSheet);
    Map<String, Integer> columNameToFieldIDMap = ExcelFieldMatchBL
            .getColumnNameToFieldIDMap(columnIndexToFieldIDMap, columnIndexToColumNameMap);
    Set<Integer> lastSavedIdentifierFieldIDIsSet = new HashSet<Integer>();
    //add the explicitly selected field identifiers
    if (columnIndexIsIdentifierMap != null) {
        //at least a field was set as unique identifier
        Iterator<Integer> iterator = columnIndexIsIdentifierMap.keySet().iterator();
        while (iterator.hasNext()) {
            Integer columnIndex = iterator.next();
            Integer fieldID = columnIndexToFieldIDMap.get(columnIndex);
            Boolean isIdentifier = columnIndexIsIdentifierMap.get(columnIndex);
            if ((isIdentifier != null && isIdentifier.booleanValue())) {
                lastSavedIdentifierFieldIDIsSet.add(fieldID);
            }
        }
    }
    //add the implicitly selected field identifiers
    //the mandatory identifiers are disabled (to forbid unselecting them),
    //but it means that they will not be submitted by columnIndexIsIdentifierMap
    //so we should add them manually if a mandatoryIdentifierFields is mapped
    Set<Integer> mandatoryIdentifierFields = ExcelFieldMatchBL.getMandatoryIdentifierFields();
    Iterator<Integer> iterator = mandatoryIdentifierFields.iterator();
    Collection<Integer> submittedFieldIDs = columnIndexToFieldIDMap.values();
    while (iterator.hasNext()) {
        Integer mandatoryIdentifierField = iterator.next();
        if (submittedFieldIDs.contains(mandatoryIdentifierField)) {
            lastSavedIdentifierFieldIDIsSet.add(mandatoryIdentifierField);
        }
    }
    try {
        FileOutputStream fos = new FileOutputStream(new File(excelMappingsDirectory, mappingFileName));
        ObjectOutputStream out = new ObjectOutputStream(fos);
        out.writeObject(columNameToFieldIDMap);
        out.writeObject(lastSavedIdentifierFieldIDIsSet);
        out.close();
    } catch (FileNotFoundException e) {
        LOGGER.warn("Creating the output stream for mapping failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
    } catch (IOException e) {
        LOGGER.warn("Saving the mapping failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
    }
    return NEXT;
}

From source file:com.funambol.server.config.ConfigurationTest.java

/**
 * Test of plugin handling//from w  w  w. ja  va2s .  c  o  m
 * @throws Exception
 */
public void testPlugin_1() throws Exception {

    Configuration.getConfiguration().initializeEngineComponents();

    Boolean b = (Boolean) PrivateAccessor.getField(Configuration.getConfiguration(),
            "engineComponentsInitialized");

    assertTrue("The engine components should be initialized", b.booleanValue());

    PluginHandler pluginHandler = (PluginHandler) PrivateAccessor.getField(Configuration.getConfiguration(),
            "pluginHandler");

    Map<String, Plugin> plugins = (Map<String, Plugin>) PrivateAccessor.getField(pluginHandler, "plugins");

    assertEquals("wrong expected plugin number:", 2, plugins.size());

    //
    // Deleting plugin 3
    //
    FileUtils.forceDelete(
            new File(Configuration.getConfigPath() + "/com/funambol/server/plugin/dummy-plugin-3.xml"));
    File dirTest1 = new File(funambolHome, "com/funambol/server/config/Configuration/plugin/test-1");

    FileUtils.copyDirectory(dirTest1, runtimePluginDir, new WildcardFileFilter("*.xml"));

    // Waiting for automatic change detection
    Thread.sleep(15 * 1000);

    pluginHandler = (PluginHandler) PrivateAccessor.getField(Configuration.getConfiguration(), "pluginHandler");
    plugins = (Map<String, Plugin>) PrivateAccessor.getField(pluginHandler, "plugins");

    assertEquals("wrong expected plugin number:", 2, plugins.size());

    System.out.println("Plugins: " + plugins);
    assertNotNull(plugins.get("dummy-plugin-1.xml"));
    assertNotNull(plugins.get("dummy-plugin-5.xml"));

    Plugin plugin1 = plugins.get("dummy-plugin-1.xml");
    assertEquals("Wrong plugin name", "test-plugin-1-updated", ((DummyPlugin) plugin1).getName());
}

From source file:es.pode.empaquetador.presentacion.salir.SalirControllerImpl.java

public final void guardar(ActionMapping mapping, es.pode.empaquetador.presentacion.salir.GuardarForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    //       if(validacion.getEsValidoManifest().booleanValue())
    //      {/*from   www.  j  av a2  s.  c  o  m*/
    String identificador = this.getEmpaquetadorSession(request).getIdLocalizador();
    if (logger.isDebugEnabled())
        logger.debug("Guardando el ODE " + identificador);
    if (DecisorOffline.esOffline()) {
        this.getSrvGestorManifestService().guardarManifiesto(identificador);
    } else {
        String sEspacioLibre = this.getEmpaquetadorSession(request).getEspacioLibre();
        String sEspacioOdeInicio = this.getEmpaquetadorSession(request).getEspacioOde();
        if (logger.isDebugEnabled())
            logger.debug("Espacio libre: " + sEspacioLibre + "Espacio ODE inicialmente:" + sEspacioOdeInicio);
        if (org.apache.commons.lang.StringUtils.isNumeric(sEspacioLibre)
                && org.apache.commons.lang.StringUtils.isNumeric(sEspacioOdeInicio)) {
            Long espacioLibre = new Long(sEspacioLibre);
            Long espacioOdeInicio = new Long(sEspacioOdeInicio);
            Boolean hayEspacio = this.getSrvGestorArchivosService().consultaCuota(identificador, espacioLibre,
                    espacioOdeInicio);
            if (hayEspacio.booleanValue()) {
                this.getSrvGestorManifestService().guardarManifiesto(identificador);
            } else {
                throw new ValidatorException("{gestor.avanzado.guardar.noEspacioEnCuota}");
            }
        } else {
            this.getSrvGestorManifestService().guardarManifiesto(identificador);
        }
    }
    //         this.getSrvGestorManifestService().guardarManifiesto(identificador);
    if (!this.getEmpaquetadorSession(request).isGuardadoPrimeraVez()) {
        this.getEmpaquetadorSession(request).setGuardadoPrimeraVez(true);
        if (logger.isDebugEnabled())
            logger.debug("Cambiado flag guardadoPrimeraVez");
    }
    //      }
    //       this.getEmpaquetadorSession(request).setValidacion(validacion);

    form.setGuardar(String.valueOf(true));
}

From source file:com.nextep.designer.vcs.ui.services.impl.ComparisonUIManager.java

private void initializeComparisonEditorProviders() {
    // Retrieving contributions for comparison editor providers
    Collection<IConfigurationElement> elts = Designer.getInstance().getExtensions(EXTENSION_ID, "class", "*"); //$NON-NLS-1$ //$NON-NLS-2$
    cachedProviders = new ArrayList<IComparisonEditorProvider>();
    for (IConfigurationElement elt : elts) {
        try {/*  w  w  w. ja  va2 s  . co m*/
            IComparisonEditorProvider provider = (IComparisonEditorProvider) elt
                    .createExecutableExtension("class"); //$NON-NLS-1$
            final Boolean isDefault = Boolean.valueOf(elt.getAttribute("default")); //$NON-NLS-1$
            if (isDefault != null && isDefault.booleanValue()) {
                currentProvider = provider;
            }
            final String defaultTypeId = elt.getAttribute("typeIdRestriction"); //$NON-NLS-1$
            if (defaultTypeId != null && !"".equals(defaultTypeId.trim())) { //$NON-NLS-1$
                defaultProviderTypeMap.put(defaultTypeId.trim(), provider);
            } else {
                cachedProviders.add(provider);
            }
        } catch (CoreException e) {
            log.error("Contribution error: Unable to instantiate a comparison editor provider from " //$NON-NLS-1$
                    + elt.getContributor().getName());
        }
    }
    // Sorting providers by label
    Collections.sort(cachedProviders, new Comparator<IComparisonEditorProvider>() {

        public int compare(IComparisonEditorProvider o1, IComparisonEditorProvider o2) {
            if (o1 != null && o2 != null) {
                final String l1 = o1.getLabel();
                final String l2 = o2.getLabel();
                return (l1 == null ? "" : l1).compareTo(l2 == null ? "" : l2); //$NON-NLS-1$ //$NON-NLS-2$
            } else if (o2 == null) {
                return o1 == null ? 0 : 1;
            } else {
                return -1;
            }
        };
    });
}

From source file:com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.java

/**
 * Process any login information passed in parameter (username, password). Returns true if SecurityFilter should
 * abort further processing after the method completes (for example, if a redirect was sent as part of the login
 * processing).//from w ww .  j a v a  2s  .  c om
 * 
 * @param request
 * @param response
 * @return true if the filter should return after this method ends, false otherwise
 */
public boolean processLogin(String username, String password, String rememberme, SecurityRequestWrapper request,
        HttpServletResponse response, XWikiContext context) throws Exception {
    Principal principal = authenticate(username, password, context);
    if (principal != null) {
        // login successful
        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("User " + principal.getName() + " has been logged-in");
        }

        // invalidate old session if the user was already authenticated, and they logged in as a different user
        if (request.getUserPrincipal() != null && !username.equals(request.getRemoteUser())) {
            request.getSession().invalidate();
        }

        // manage persistent login info, if persistent login management is enabled
        if (this.persistentLoginManager != null) {
            // did the user request that their login be persistent?
            if (rememberme != null) {
                // remember login
                this.persistentLoginManager.rememberLogin(request, response, username, password);
            } else {
                // forget login
                this.persistentLoginManager.forgetLogin(request, response);
            }
        }

        // make sure the Principal contains wiki name information
        if (!StringUtils.contains(principal.getName(), ':')) {
            principal = new SimplePrincipal(context.getDatabase() + ":" + principal.getName());
        }

        request.setUserPrincipal(principal);
        Boolean bAjax = (Boolean) context.get("ajax");
        if ((bAjax == null) || (!bAjax.booleanValue())) {
            String continueToURL = getContinueToURL(request);
            // This is the url that the user was initially accessing before being prompted for login.
            response.sendRedirect(response.encodeRedirectURL(continueToURL));
        }
    } else {
        // login failed
        // set response status and forward to error page
        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("User " + username + " login has failed");
        }

        String returnCode = context.getWiki().Param("xwiki.authentication.unauthorized_code");
        int rCode = HttpServletResponse.SC_UNAUTHORIZED;
        if ((returnCode != null) && (!returnCode.equals(""))) {
            try {
                rCode = Integer.parseInt(returnCode);
            } catch (Exception e) {
                rCode = HttpServletResponse.SC_UNAUTHORIZED;
            }
        }
        response.setStatus(rCode); // TODO: Does this work? (200 in case of error)
    }

    return true;
}

From source file:com.octo.captcha.service.EhcacheManageableCaptchaService.java

/**
 * Method to validate a response to the challenge corresponding to the given ticket and remove the coresponding
 * captcha from the store.//w  w  w .  j av a2 s . c om
 *
 * @param ID the ticket provided by the buildCaptchaAndGetID method
 *
 * @return true if the response is correct, false otherwise.
 *
 * @throws CaptchaServiceException if the ticket is invalid
 */
public Boolean validateResponseForID(String ID, Object response) throws CaptchaServiceException {

    Boolean valid = super.validateResponseForID(ID, response);

    if (valid.booleanValue()) {
        numberOfCorrectResponse++;
    } else {
        numberOfUncorrectResponse++;
    }
    return valid;
}