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.hsm.ws.impl.WSSecuritySOAPHandler.java

@Override
public boolean handleMessage(SOAPMessageContext context) {
    LOG.debug("handleMessage");
    Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    if (false == outboundProperty.booleanValue()) {
        try {//from ww w .  j a  v a 2s  .c  om
            handleInboundMessage(context);
        } catch (Exception e) {
            throw new ProtocolException(e);
        }
    }
    return true;
}

From source file:com.glaf.jbpm.action.EndCounterSigningAction.java

public void execute(ExecutionContext ctx) throws Exception {
    logger.debug("------------------------------------------------------");
    logger.debug("----------------EndCounterSigningAction---------------");
    logger.debug("------------------------------------------------------");

    boolean executable = true;

    Map<String, Object> params = new java.util.HashMap<String, Object>();

    ContextInstance contextInstance = ctx.getContextInstance();
    Map<String, Object> variables = contextInstance.getVariables();
    if (variables != null && variables.size() > 0) {
        Iterator<String> iterator = variables.keySet().iterator();
        while (iterator.hasNext()) {
            String variableName = iterator.next();
            if (params.get(variableName) == null) {
                Object value = contextInstance.getVariable(variableName);
                params.put(variableName, value);
            }/*from w ww  .  ja  va  2s.c  o m*/
        }
    }

    if (StringUtils.isNotEmpty(expression)) {
        if (expression.startsWith("#{") && expression.endsWith("}")) {
            Object value = DefaultExpressionEvaluator.evaluate(expression, params);
            if (value != null) {
                if (value instanceof Boolean) {
                    Boolean b = (Boolean) value;
                    executable = b.booleanValue();
                }
            }
        }
    }

    if (!executable) {
        logger.debug("???false??");
        return;
    }

    TaskMgmtInstance tmi = ctx.getTaskMgmtInstance();
    TaskInstance x = ctx.getTaskInstance();
    String actorId = null;
    if (x != null) {
        actorId = x.getActorId();
    }
    Collection<TaskInstance> c = tmi.getTaskInstances();
    for (Iterator<TaskInstance> it = c.iterator(); it.hasNext();) {
        TaskInstance taskInstance = it.next();
        if (!taskInstance.hasEnded()) {
            if ((actorId != null && actorId.equals(taskInstance.getActorId()))) {
                if (cache.getIfPresent(String.valueOf(taskInstance.getId())) == null) {
                    cache.put(String.valueOf(taskInstance.getId()), "1");
                }
            } else {
                if (cache.getIfPresent(String.valueOf(taskInstance.getId())) == null) {
                    cache.put(String.valueOf(taskInstance.getId()), "1");
                    if (StringUtils.isNotEmpty(taskName)) {
                        if (!StringUtils.equals(taskName, taskInstance.getName())) {
                            continue;
                        }
                    }
                    if (StringUtils.isNotEmpty(transitionName)) {
                        taskInstance.setSignalling(false);
                        taskInstance.end(transitionName);
                    } else {
                        taskInstance.setSignalling(false);
                        taskInstance.end();
                    }
                }
            }
        }
    }
}

From source file:com.glaf.jbpm.action.JoinAction.java

public void execute(ExecutionContext ctx) throws Exception {
    logger.debug("------------------------------------------------------");
    logger.debug("----------------JoinAction----------------------------");
    logger.debug("------------------------------------------------------");

    boolean executable = true;

    Map<String, Object> params = new java.util.HashMap<String, Object>();

    ContextInstance contextInstance = ctx.getContextInstance();
    Map<String, Object> variables = contextInstance.getVariables();
    if (variables != null && variables.size() > 0) {
        Iterator<String> iterator = variables.keySet().iterator();
        while (iterator.hasNext()) {
            String variableName = iterator.next();
            if (params.get(variableName) == null) {
                Object value = contextInstance.getVariable(variableName);
                params.put(variableName, value);
            }/*  w  w w.  jav  a2  s . c  o  m*/
        }
    }

    if (StringUtils.isNotEmpty(expression)) {
        if (expression.startsWith("#{") && expression.endsWith("}")) {
            Object value = DefaultExpressionEvaluator.evaluate(expression, params);
            if (value != null) {
                if (value instanceof Boolean) {
                    Boolean b = (Boolean) value;
                    executable = b.booleanValue();
                }
            }
        }
    }

    if (!executable) {
        logger.debug("???false??");
        return;
    }

    Join join = (Join) ctx.getNode();
    join.setDiscriminator(true);

    Token root = ctx.getToken().getParent();
    Collection<Token> childTokenList = root.getChildren().values();
    TaskMgmtInstance tms = ctx.getTaskMgmtInstance();
    if (StringUtils.isNotEmpty(includes)) {
        List<String> rows = StringTools.split(includes, ",");
        Iterator<Token> iter = childTokenList.iterator();
        while (iter.hasNext()) {
            Token childToken = iter.next();
            Collection<TaskInstance> taskInstances = tms.getUnfinishedTasks(childToken);
            Iterator<TaskInstance> it = taskInstances.iterator();
            while (it.hasNext()) {
                TaskInstance taskInstance = it.next();
                if (rows.contains(taskInstance.getName())) {
                    if (taskInstance.isBlocking()) {
                        taskInstance.setBlocking(false);
                    }
                    if (taskInstance.isSignalling()) {
                        taskInstance.setSignalling(false);
                    }
                    taskInstance.cancel();
                }
            }
        }
    } else {
        List<String> rows = StringTools.split(excludes, ",");
        Iterator<Token> iter = childTokenList.iterator();
        while (iter.hasNext()) {
            Token childToken = iter.next();
            Collection<TaskInstance> taskInstances = tms.getUnfinishedTasks(childToken);
            Iterator<TaskInstance> it = taskInstances.iterator();
            while (it.hasNext()) {
                TaskInstance taskInstance = it.next();
                if (!(rows != null && rows.contains(taskInstance.getName()))) {
                    if (taskInstance.isBlocking()) {
                        taskInstance.setBlocking(false);
                    }
                    if (taskInstance.isSignalling()) {
                        taskInstance.setSignalling(false);
                    }
                    taskInstance.cancel();
                }
            }
        }
    }
}

From source file:com.karura.framework.plugins.utils.ContactAccessor.java

/**
 * Check to see if the data associated with the key is required to be populated in the Contact object.
 * /*w  w w . j a  v  a2  s. c  om*/
 * @param key
 * @param map
 *            created by running buildPopulationSet.
 * @return true if the key data is required
 */
protected boolean isRequired(String key, HashMap<String, Boolean> map) {
    Boolean retVal = map.get(key);
    return (retVal == null) ? false : retVal.booleanValue();
}

From source file:es.pode.empaquetador.presentacion.guardar.GuardarControllerImpl.java

/**
 * @see es.pode.empaquetador.presentacion.guardar.GuardarController#guardar(org.apache.struts.action.ActionMapping, es.pode.empaquetador.presentacion.guardar.GuardarForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *///w w  w . j a va  2  s .  co  m
public final void guardar(ActionMapping mapping, es.pode.empaquetador.presentacion.guardar.GuardarForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    String returnURL = form.getReturnURL();
    String identificador = this.getEmpaquetadorSession(request).getIdLocalizador();
    try {
        if (logger.isDebugEnabled())
            logger.debug("Comprobando pendientes de catalogar antes de guardar...");
        gestorSesion.comprobarPendientesCatalogacion(request);
        if (logger.isDebugEnabled())
            logger.debug("Guardando ode " + identificador);
        if (DecisorOffline.esOffline()) {
            this.getSrvGestorManifestService().guardarManifiesto(identificador);
            this.saveSuccessMessage(request, "portalempaquetado.presentacion.salir.guardar.correcto");
        } 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);
                    this.saveSuccessMessage(request, "portalempaquetado.presentacion.salir.guardar.correcto");
                } else
                    saveErrorMessage(request, "gestor.avanzado.guardar.noEspacioEnCuota");
            } else {
                this.getSrvGestorManifestService().guardarManifiesto(identificador);
                this.saveSuccessMessage(request, "portalempaquetado.presentacion.salir.guardar.correcto");
            }
        }
    } catch (Exception e) {
        logger.error("Se produjo un error al guardar el manifiesto " + identificador, e);
        saveErrorMessage(request, "gestor.avanzado.guardar");
    }
    if (returnURL == null || returnURL.trim().equals("")) {
        String redirect = "http://" + LdapUserDetailsUtils.getHost() + LdapUserDetailsUtils.getSubdominio()
                + mapping.findForward("gestor.archivos").getPath();
        if (logger.isDebugEnabled())
            logger.debug("ReturnURL es null en guardar. Redirijo a " + redirect);
        response.sendRedirect(redirect);
    } else {
        /*
         * Concateno host y subdominio para URLs tipo http://host/agrega:
         * returnURL se genera a partir de una html:rewrite, no es necesario
         * incluir el subdominio, porque de haberlo, ya esta inluido.
         */
        returnURL = "http://" + LdapUserDetailsUtils.getHost() + returnURL;
        if (logger.isDebugEnabled())
            logger.debug("ReturnURL es " + returnURL);
        response.sendRedirect(returnURL);
    }

    if (!this.getEmpaquetadorSession(request).isGuardadoPrimeraVez()) {
        this.getEmpaquetadorSession(request).setGuardadoPrimeraVez(true);
        logger.debug("Cambiado flag guardadoPorPrimeraVez");
    }
}

From source file:CheckBoxNodeTreeSample.java

public CheckBoxNodeRenderer() {
    Font fontValue;/* w w w . ja  va 2s. com*/
    fontValue = UIManager.getFont("Tree.font");
    if (fontValue != null) {
        leafRenderer.setFont(fontValue);
    }
    Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
    leafRenderer.setFocusPainted((booleanValue != null) && (booleanValue.booleanValue()));

    selectionBorderColor = UIManager.getColor("Tree.selectionBorderColor");
    selectionForeground = UIManager.getColor("Tree.selectionForeground");
    selectionBackground = UIManager.getColor("Tree.selectionBackground");
    textForeground = UIManager.getColor("Tree.textForeground");
    textBackground = UIManager.getColor("Tree.textBackground");
}

From source file:de.iteratec.iteraplan.model.user.PermissionAttrTypeGroup.java

public void setWritePermission(Boolean writePermission) {
    this.writePermission = writePermission;
    if (writePermission.booleanValue() && (readPermission == null || !readPermission.booleanValue())) {
        setReadPermission(Boolean.TRUE);
    }/*w w w. j av a  2s  . co  m*/
}

From source file:dk.dbc.opensearch.datadock.DatadockMainTest.java

@Ignore("Until I figure out how to get to the method-private field 'mode'")
@Test/*from   w w w.  j  a v  a2s  . c o m*/
public void testSetServerModeTerminateOnZeroSubmitted() throws Exception {
    setConfigExpectations();

    DatadockMain datadock = new DatadockMain();
    Deencapsulation.invoke(datadock, "setServerMode");
    Deencapsulation.setField(datadock, "mode", "true");
    Boolean field = (Boolean) Deencapsulation.getField(datadock, "terminateOnZeroSubmitted");
    System.out.println(String.format("%s", field.booleanValue()));
    assertTrue(field.booleanValue());
}

From source file:com.alkacon.opencms.newsletter.CmsNewsletterSubscriberCleanupJob.java

/**
 * Removes the inactive subscribers from the newsletter organizational units that are not activated.<p>
 * /*from   w  ww . j av a  2 s  . co  m*/
 * @param cms the configured job users context
 * @param expireDate the expiration date, if a subscriber user was created before that date, it will be deleted
 * @return the number of deleted subscribers
 */
private int removeInactiveSubscribers(CmsObject cms, long expireDate) {

    int count = 0;
    try {
        List newsletterUnits = CmsNewsletterManager.getOrgUnits(cms);
        Iterator i = newsletterUnits.iterator();
        // loop the newsletter organizational units
        while (i.hasNext()) {
            CmsOrganizationalUnit ou = (CmsOrganizationalUnit) i.next();
            List users = OpenCms.getOrgUnitManager().getUsers(cms, ou.getName(), false);
            Iterator k = users.iterator();
            // loop subscribers found in the current newsletter ou
            while (k.hasNext()) {
                CmsUser user = (CmsUser) k.next();
                // get the additional info value for the subscriber
                Boolean active = (Boolean) user
                        .getAdditionalInfo(CmsNewsletterManager.USER_ADDITIONALINFO_ACTIVE);
                if ((active != null) && !active.booleanValue()) {
                    // found additional info & value is false, check creation date
                    if (user.getDateCreated() < expireDate) {
                        // user is older than specified maximum age, delete it
                        cms.deleteUser(user.getName());
                        count++;
                    }
                }
            }
        }
    } catch (CmsException e) {
        // error removing users, log error
        if (LOG.isErrorEnabled()) {
            LOG.error(Messages.get().getBundle().key(Messages.LOG_NEWSLETTER_CLEANUP_ERROR_DELETING_0), e);
        }
    }
    return count;
}

From source file:com.ganji.tungsten.replicator.applier.GanjiMcQueueApplier.java

private boolean insert2Queue(String schema, String table, String actionName, JSONObject obj, Timestamp tm)
        throws ApplierException {
    obj.put("__schema", schema);
    obj.put("__table", table);
    obj.put("__action", actionName);
    obj.put("__ts", tm.getTime());

    Future<Boolean> f = mc_conn.set(queue_name, 0, obj.toJSONString());
    try {/*from  w  w  w. jav a 2 s  .  com*/
        Boolean b = f.get();
        return b.booleanValue();
    } catch (InterruptedException e) {
        throw new ApplierException(e);
    } catch (ExecutionException e) {
        throw new ApplierException(e);
    }

    //return false;
}