Example usage for java.lang Boolean Boolean

List of usage examples for java.lang Boolean Boolean

Introduction

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

Prototype

@Deprecated(since = "9")
public Boolean(String s) 

Source Link

Document

Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true" .

Usage

From source file:dk.netarkivet.harvester.harvesting.WARCWriterProcessor.java

/**
 * @param name Name of this writer.//  w ww.  jav  a 2 s  . co  m
 */
public WARCWriterProcessor(final String name) {
    super(name, "Netarchivesuite WARCWriter processor (Version 1.0");
    Type e = addElementToDefinition(new SimpleType(ATTR_WRITE_REQUESTS,
            "Whether to write 'request' type records. Default is true.", new Boolean(true)));
    e.setOverrideable(true);
    e.setExpertSetting(true);
    e = addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA,
            "Whether to write 'metadata' type records. Default is true.", new Boolean(true)));
    e.setOverrideable(true);
    e.setExpertSetting(true);
    e = addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_IDENTICAL_DIGESTS,
            "Whether to write 'revisit' type records when a URI's "
                    + "history indicates the previous fetch had an identical " + "content digest. "
                    + "Default is true.",
            new Boolean(true)));
    e.setOverrideable(true);
    e.setExpertSetting(true);
    e = addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_NOT_MODIFIED,
            "Whether to write 'revisit' type records when a "
                    + "304-Not Modified response is received. Default is true.",
            new Boolean(true)));
    e.setOverrideable(true);
    e.setExpertSetting(true);

    // Add map setting to add NAS metadata to WarcInfo records. 
    e = addElementToDefinition(new MapType(ATTR_METADATA_ITEMS, "Metadata items.", String.class));
    e.setOverrideable(true);
    e.setExpertSetting(true);
}

From source file:com.google.gsa.valve.modules.ldap.LDAPSSO.java

/**
 * This is the main method that does the authentication and should be 
 * invoked by the classes that would like to populate new user authentication 
 * credentials from the LDAP server.// w  ww  . j  a  va2  s  .  c o  m
 * <p>
 * It also authenticates the user against the LDAP server, so that only 
 * priviledged users are able to read the LDAP attributes. These multiple 
 * credentials are stored in the directory server and populate them in the 
 * user's credential container. It enables the other AuthN/AuthZ modules to 
 * use them when securely accessing the backend systems.
 * <p>
 * If the LDAP authentication result is OK, it creates an 
 * authentication cookie. Anyway, the HTTP response code is returned in this 
 * method to inform the caller on the status.
 * 
 * @param request HTTP request
 * @param response HTTP response
 * @param authCookies vector that contains the authentication cookies
 * @param url the document url
 * @param creds an array of credentials for all external sources
 * @param id the default credential id to be retrieved from creds
        
 * @return the HTTP error code
        
 * @throws HttpException
 * @throws IOException
 */
public int authenticate(HttpServletRequest request, HttpServletResponse response, Vector<Cookie> authCookies,
        String url, Credentials creds, String id) throws HttpException, IOException {

    logger.debug("Start LDAPSSO AuthN process");

    //protection
    repositories.clear();
    ldapAttributes.clear();

    //Insert LDAP attributes from the config file
    getLDAPAttributes(id);

    //First read the u/p the credentails store, in this case using the same as the root login
    logger.debug("LDAPSSO: trying to get creds from repository ID: " + id);
    Credential cred = null;
    try {
        cred = creds.getCredential(id);
    } catch (NullPointerException npe) {
        logger.error("NPE while reading credentials of ID: " + id);
    }
    if (cred == null) {
        cred = creds.getCredential("root");
        if (cred != null) {
            logger.info("LDAPSSO: credential ID used is \"root\"");
        } else {
            logger.error("LDAPSSO: No credentials available for " + id);
        }
    }

    Cookie[] cookies = null;

    // Initialize status code
    int statusCode = HttpServletResponse.SC_UNAUTHORIZED;

    // Read cookies
    cookies = request.getCookies();

    try {
        authMaxAge = Integer.parseInt(valveConf.getAuthMaxAge());
    } catch (NumberFormatException nfe) {
        logger.error(
                "Configuration error: chack the configuration file as the number set for authMaxAge is not OK:");
    }

    //If the required cookie was not found need to authenticate.
    logger.info("Authenticating root user with LDAP");
    try {

        //Check if the LDAP credentials are OK                       
        Ldap ldapconn = new Ldap(ldapHost, cred.getUsername(), cred.getPassword(), ldapBaseuser, ldapDomain,
                rdnAttr);
        try {
            logger.debug("Connecting to LDAP");
            DirContext ctx = ldapconn.openConnection();
            if (ctx == null) {
                //Just send a comment  
                logger.debug("The user(" + cred.getUsername() + ")/password doesn't match");
                ldapconn.closeConnection(ctx);
                return (HttpServletResponse.SC_UNAUTHORIZED);
            }

            //Fetching credentials
            logger.debug("Fetching credentials from the LDAP");

            fetchingCredentials(ldapconn, ctx, cred.getUsername(), creds);

            //Close the connection
            ldapconn.closeConnection(ctx);

        } catch (Exception ex) {
            logger.error("LDAP connection problem during user access: " + ex.getMessage(), ex);
            return (HttpServletResponse.SC_UNAUTHORIZED);
        } finally {
        }

        Cookie extAuthCookie = null;

        extAuthCookie = settingCookie();

        //add sendCookies support
        logger.debug("Setting session");
        boolean isSessionEnabled = new Boolean(valveConf.getSessionConfig().isSessionEnabled()).booleanValue();
        boolean sendCookies = false;
        if (isSessionEnabled) {
            sendCookies = new Boolean(valveConf.getSessionConfig().getSendCookies()).booleanValue();
        }
        if ((!isSessionEnabled) || ((isSessionEnabled) && (sendCookies))) {
            response.addCookie(extAuthCookie);
        }

        //add cookie to the array
        authCookies.add(extAuthCookie);

        //This would be set to OK or 401 in a real AuthN module
        statusCode = HttpServletResponse.SC_OK;

    } catch (Exception e) {

        // Log error
        logger.error("LDAP SSO authentication failure: " + e.getMessage(), e);

        // Update status code
        statusCode = HttpServletResponse.SC_UNAUTHORIZED;

    }

    // Debug
    logger.debug("Sample Authentication completed (" + statusCode + ")");

    // Return status code
    return statusCode;

}

From source file:it.unibas.spicygui.controllo.provider.ActionSceneConnectionTarget.java

private boolean createJoinCondition(Widget sourceWidget, Widget targetWidget) {
    executeInjection();/* w w w .j  a va  2s .  c om*/
    if (modello.getBean(Costanti.CREATING_JOIN_SESSION) == null
            || modello.getBean(Costanti.JOIN_SESSION_SOURCE) != null) {
        //////                String[] options = new String[]{NbBundle.getMessage(Costanti.class, Costanti.JOIN_DIALOG_SINGLE), NbBundle.getMessage(Costanti.class, Costanti.JOIN_DIALOG_MULTIPLE), NbBundle.getMessage(Costanti.class, Costanti.JOIN_DIALOG_CANCEL)};
        //////                int scelta = JOptionPane.showOptionDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(Costanti.class, Costanti.JOIN_DIALOG_MESSAGE), NbBundle.getMessage(Costanti.class, Costanti.JOIN_DIALOG_TITLE), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[2]);
        //////                if (scelta == 2 || scelta == JOptionPane.CLOSED_OPTION) {
        //////                    return;
        //////                }
        //////                if (scelta == 0) {
        creator.createCorrespondenceJoinCondition(mainLayer, sourceWidget, targetWidget, false);
        return true;
    } else {
        if (this.modello.getBean(Costanti.JOIN_CONSTRIANTS) == null
                || this.modello.getBean(Costanti.JOIN_CONDITION) == null
                || this.modello.getBean(Costanti.FROM_PATH_NODES) == null) {
            //////                JoinCondition joinCondition = new JoinCondition(new ArrayList<PathExpression>(), new ArrayList<PathExpression>());
            JoinConstraint joinConstraint = new JoinConstraint();
            List<INode> fromPathNodes = new ArrayList<INode>();
            JoinCondition joinCondition = creator.createCorrespondenceJoinCondition(mainLayer, sourceWidget,
                    targetWidget, joinConstraint, null, fromPathNodes, false);
            this.modello.putBean(Costanti.CREATING_JOIN_SESSION, new Boolean(true));
            this.modello.putBean(Costanti.JOIN_CONSTRIANTS, joinConstraint);
            this.modello.putBean(Costanti.JOIN_CONDITION, joinCondition);
            this.modello.putBean(Costanti.FROM_PATH_NODES, fromPathNodes);
            this.modello.putBean(Costanti.JOIN_SESSION_TARGET, new Boolean(true));
            //caso di join multiplo inizio
            vista.getMultipleJDialog().setVisible(true);
            vista.getMultipleJDialog().setText(joinCondition.toString());
        } else {
            JoinConstraint joinConstraint = (JoinConstraint) this.modello.getBean(Costanti.JOIN_CONSTRIANTS);
            JoinCondition joinCondition = (JoinCondition) this.modello.getBean(Costanti.JOIN_CONDITION);
            List<INode> fromPathNodes = (List<INode>) this.modello.getBean(Costanti.FROM_PATH_NODES);
            //caso di join multiplo gi in corso
            creator.createCorrespondenceJoinCondition(mainLayer, sourceWidget, targetWidget, joinConstraint,
                    joinCondition, fromPathNodes, false);
            vista.getMultipleJDialog().setText(joinCondition.toString());
            //TODO : Gestire il caso in cui siamo in  sessione di join
        }
    }
    return false;
}

From source file:org.newcashel.meta.model.NCClass.java

public static void load(HSSFWorkbook wb, LaunchParms launchParm) throws Exception {

    // load the sheet
    Sheet sheet = wb.getSheet("ClassAttributes");
    if (sheet == null) {
        throw new Exception("The ClassAttributes sheet was not found in the MetaBook, terminate load process");
    }/*from  ww w  .j  ava2  s  .c  om*/

    //String[] fieldNames = POIUtil.getFirstRowVals(sheet);

    Class cls = Class.forName("org.newcashel.meta.model.NCClass");
    Class[] parmString = new Class[1];

    Row row = null;

    try {

        for (int i = 1; i <= sheet.getLastRowNum(); i++) {
            // skip blank rows between class attributes
            row = sheet.getRow(i);

            if (row != null && (POIUtil.getCellValue(row, ATTRIBUTE_OFFSET) == null
                    || POIUtil.getCellValue(row, TYPE_OFFSET).length() < 1))
                continue;

            // get the size of the cell, the length will be the number of atbs in the class
            // determine if the next Cell to the left is a separate Cell or part of a CellRangeAddress
            Cell cell = row.getCell(0, Row.RETURN_BLANK_AS_NULL);
            if (cell == null) {
                continue;
            }

            CellRangeAddress cra = getCellRangeAddress(sheet, row.getRowNum(), 0);
            if (cra == null) {
                return;
            }

            // instantiate the NCClass instance
            NCClass ncClass = new NCClass();
            ncClass.setClassName(POIUtil.getCellValue(row, CLASSNAME_OFFSET));
            //logger.info("loading NCClass " + ncClass.getClassName());

            ncClass.setSuperClassName(POIUtil.getCellValue(row, SUPERCLASS_NAME_OFFSET));
            ncClass.setClassParent(POIUtil.getCellValue(row, PARENTCLASS_OFFSET));
            ncClass.setPrimaryKey(POIUtil.getCellValue(row, PRIMARYKEY_OFFSET));
            ncClass.setPercolate(new Boolean(POIUtil.getCellValue(row, PERCOLATE_OFFSET)));
            ncClass.setGroupConstrain(new Boolean(POIUtil.getCellValue(row, GROUP_CONSTRAIN_OFFSET)));

            // not throwing java class errors, may not be significant to load context

            // TODO, if NO_VERIFY_JAVA_CLASS is true, skip validation
            // TODO, if NO_VERF true and blank 

            String javaClassName = POIUtil.getCellValue(row, JAVA_CLASS_OFFSET);
            if (javaClassName.endsWith("Person.class")) {
                System.out.println("OKK");
            }
            Class<?> javaCls = null;
            if (javaClassName != null && javaClassName.length() > 0) {
                ncClass.setJavaClassName(javaClassName);
                try {
                    javaCls = Class.forName(javaClassName);
                } catch (Exception e) {
                    logger.error("Java class specified but cannot be loaded for " + ncClass.getClassName()
                            + ", " + javaClassName);
                }
            } else {
                logger.info("no java class specified for class " + ncClass.getClassName());
            }

            classes.put(ncClass.getClassName(), ncClass);
            logger.info("Adding class " + ncClass.getClassName());

            // loop for all the rows in the cell range
            for (i = cra.getFirstRow(); i <= cra.getLastRow(); i++) {
                row = sheet.getRow(i);
                if (row == null) {
                    return; // range iteration complete
                }
                cell = row.getCell(ATTRIBUTE_OFFSET, Row.RETURN_BLANK_AS_NULL);
                if (cell == null)
                    continue;

                String atbName = POIUtil.getCellValue(row, ATTRIBUTE_OFFSET);
                String version = POIUtil.getCellValue(row, VERSION_OFFSET);

                // if  no version id and the atb has not been set, then set it
                // if a version and it matches the build version, set/overwrite the value 
                Attribute atb = null;

                // if version id is set and matches the launchParm setting, use it else skip 
                // a non-versioned atb may be encountered first, reuse it if received a versioned one
                if (version != null && version.length() > 0) {
                    if (!(launchParm.getVersion().equals(version))) {
                        continue;
                    }
                    logger.debug("add version specific atb " + ncClass.getClassName() + ", " + atbName + ", "
                            + version);
                    // if a default version has already been established, use it else create one
                    atb = ncClass.getAttribute(atbName);
                    if (atb == null) {
                        atb = new Attribute();
                    }
                } else { // no version, use existing if already set to the current version
                    atb = ncClass.getAttribute(atbName);
                    if (atb == null) {
                        atb = new Attribute();
                    } else
                        continue; // already established a version specific atb, ignore non-versioned entry
                }

                // create the Attributes and add to the class instance
                // TODO, verify not null on these required values, user may override Excel edits
                atb.setName(POIUtil.getCellValue(row, ATTRIBUTE_OFFSET));
                atb.setType(POIUtil.getCellValue(row, TYPE_OFFSET));
                atb.setLabel(POIUtil.getCellValue(row, LABEL_OFFSET));
                atb.setIndexName(POIUtil.getPopulatedCellValue(row, INDEXNAME_OFFSET));

                //logger.info("added NCClass atb " + ncClass.getClassName() + ", " + atb.getName());

                // defaults to false
                atb.setStore(UTIL.convertBoolean(POIUtil.getCellValue(row, STORE_OFFSET)));
                /*
                String storeVal = POIUtil.getPopulatedCellValue(row, STORE_OFFSET);
                if (storeVal != null) {
                   atb.setStore(new Boolean(storeVal));
                }
                */

                // analyzed is default value, will tokenize field
                String indexVal = POIUtil.getPopulatedCellValue(row, INDEX_OFFSET);
                if (indexVal != null) {
                    atb.setIndex(indexVal);
                }

                // default is true, don't set unless value is not
                String includeInAll = POIUtil.getPopulatedCellValue(row, INCLUDEINALL_OFFSET);
                if (includeInAll != null && includeInAll.equalsIgnoreCase("no")) {
                    atb.setIncludeInAll(false);
                }

                // default varies, based on the numeric type
                // TODO, verify numeric field
                String precision = POIUtil.getPopulatedCellValue(row, PRECISIONSTEP_OFFSET);
                if (precision != null) {
                    atb.setPrecision(new Integer(precision));
                }

                String dateFormat = POIUtil.getPopulatedCellValue(row, DATEFORMAT_OFFSET);
                if (dateFormat != null) {
                    atb.setDateFormat(dateFormat);
                }

                String fieldDataFormat = POIUtil.getPopulatedCellValue(row, FIELDDATAFORMAT_OFFSET);
                if (fieldDataFormat != null) {
                    atb.setFieldDataFormat(fieldDataFormat);
                }

                atb.setDocValues(UTIL.convertBoolean(POIUtil.getCellValue(row, DOCVALUES_OFFSET)));

                String boost = POIUtil.getPopulatedCellValue(row, BOOST_OFFSET);
                if (boost != null) {
                    atb.setBoost(new Double(boost));
                }

                // defaults to not adding the field to the JSON string
                String nullVal = POIUtil.getPopulatedCellValue(row, NULLVALUE_OFFSET);
                if (nullVal != null) {
                    atb.setNullValue(nullVal);
                }

                String termVector = POIUtil.getPopulatedCellValue(row, TERMVECTOR_OFFSET);
                if (termVector != null) {
                    atb.setTermVector(termVector);
                }

                String analyzer = POIUtil.getPopulatedCellValue(row, ANALYZER_OFFSET);
                if (analyzer != null) {
                    atb.setAnalyzer(analyzer);
                }

                String indexAnalyzer = POIUtil.getPopulatedCellValue(row, INDEX_ANALYZER_OFFSET);
                if (indexAnalyzer != null) {
                    atb.setIndexAnalyzer(indexAnalyzer);
                }

                String searchAnalyzer = POIUtil.getPopulatedCellValue(row, SEARCH_ANALYZER_OFFSET);
                if (searchAnalyzer != null) {
                    atb.setSearchAnalyzer(searchAnalyzer);
                }

                atb.setIgnoreAbove(UTIL.convertAnyNumberToInt(POIUtil.getCellValue(row, IGNOREABOVE_OFFSET)));
                atb.setPositionOffset(
                        UTIL.convertAnyNumberToInt(POIUtil.getCellValue(row, POSITIONGAP_OFFSET)));
                atb.setIgnoreMalformed(UTIL.convertBoolean(POIUtil.getCellValue(row, IGNOREMALFORMED_OFFSET)));
                atb.setCoerceNumber(UTIL.convertBoolean(POIUtil.getCellValue(row, COERCENUMBER_OFFSET)));
                atb.setBinaryCompress(UTIL.convertBoolean(POIUtil.getCellValue(row, BINARYCOMPRESS_OFFSET)));
                atb.setCompressThreshold(
                        UTIL.convertAnyNumberToInt(POIUtil.getCellValue(row, COMPRESSTHRESHOLD_OFFSET)));

                // TODO, all all the others

                //atb.setStore(UTIL.convertBoolean(POIUtil.getCellValue(row, STORE_OFFSET)));

                if (atb.getType().equalsIgnoreCase("SubType")) {
                    subTypes.put(atb.getName(), atb.getLabel());
                } else {
                    // save the attribute
                    ncClass.attributes.put(atb.getName(), atb);
                    ncClass.labels.put(atb.getLabel(), atb);

                    // if java class, verify the field accessibility
                    if (javaCls != null) {
                        Field field = null;
                        Class<?> current = javaCls;
                        while (!(current.getName().equals("java.lang.Object"))) {
                            try {
                                field = current.getDeclaredField(atb.getName());
                                atb.setField(field);
                                //atb.setField(current.getDeclaredField(atb.getName()));
                                break;
                            } catch (Exception e) {
                                //System.out.println("java reflection warning, class/field not found, checking super class " + cls.getName() + ", " + atb.getName());
                                current = current.getSuperclass();
                                continue;
                            }
                        }

                        if (field != null) {
                            field.setAccessible(true);
                        }
                    }
                }
            }
            i--; // continue the loop on the prior row
        }
    } catch (Exception e) {
        String msg = "exception in NCClass load " + e.toString();
        logger.error(msg);
        throw new Exception(msg);
    }
}

From source file:net.sourceforge.eclipsetrader.charts.ChartsPlugin.java

public static Chart createDefaultChart() {
    Log logger = LogFactory.getLog(ChartsPlugin.class);
    SimpleDateFormat dateTimeFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); //$NON-NLS-1$
    Chart chart = new Chart();

    File file = ChartsPlugin.getDefault().getStateLocation().append("defaultChart.xml").toFile(); //$NON-NLS-1$
    if (file.exists() == true) {
        try {/*from  www.  j ava 2  s .co m*/
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document document = builder.parse(file);

            NodeList firstNode = document.getFirstChild().getChildNodes();
            for (int r = 0; r < firstNode.getLength(); r++) {
                Node item = firstNode.item(r);
                Node valueNode = item.getFirstChild();
                String nodeName = item.getNodeName();

                if (valueNode != null) {
                    if (nodeName.equalsIgnoreCase("compression") == true) //$NON-NLS-1$
                        chart.setCompression(Integer.parseInt(valueNode.getNodeValue()));
                    else if (nodeName.equalsIgnoreCase("period") == true) //$NON-NLS-1$
                        chart.setPeriod(Integer.parseInt(valueNode.getNodeValue()));
                    else if (nodeName.equalsIgnoreCase("autoScale") == true) //$NON-NLS-1$
                        chart.setAutoScale(new Boolean(valueNode.getNodeValue()).booleanValue());
                    else if (nodeName.equalsIgnoreCase("begin") == true) //$NON-NLS-1$
                    {
                        try {
                            chart.setBeginDate(dateTimeFormat.parse(valueNode.getNodeValue()));
                        } catch (Exception e) {
                            logger.warn(e.toString());
                        }
                    } else if (nodeName.equalsIgnoreCase("end") == true) //$NON-NLS-1$
                    {
                        try {
                            chart.setEndDate(dateTimeFormat.parse(valueNode.getNodeValue()));
                        } catch (Exception e) {
                            logger.warn(e.toString());
                        }
                    }
                }
                if (nodeName.equalsIgnoreCase("row")) //$NON-NLS-1$
                {
                    ChartRow row = new ChartRow(new Integer(r));
                    row.setParent(chart);

                    NodeList tabList = item.getChildNodes();
                    for (int t = 0; t < tabList.getLength(); t++) {
                        item = tabList.item(t);
                        nodeName = item.getNodeName();
                        if (nodeName.equalsIgnoreCase("tab")) //$NON-NLS-1$
                        {
                            ChartTab tab = new ChartTab(new Integer(t));
                            tab.setParent(row);
                            tab.setLabel(((Node) item).getAttributes().getNamedItem("label").getNodeValue()); //$NON-NLS-1$

                            NodeList indicatorList = item.getChildNodes();
                            for (int i = 0; i < indicatorList.getLength(); i++) {
                                item = indicatorList.item(i);
                                nodeName = item.getNodeName();
                                if (nodeName.equalsIgnoreCase("indicator")) //$NON-NLS-1$
                                {
                                    ChartIndicator indicator = new ChartIndicator(new Integer(i));
                                    indicator.setParent(tab);
                                    indicator.setPluginId(((Node) item).getAttributes().getNamedItem("pluginId") //$NON-NLS-1$
                                            .getNodeValue());

                                    NodeList parametersList = item.getChildNodes();
                                    for (int p = 0; p < parametersList.getLength(); p++) {
                                        item = parametersList.item(p);
                                        nodeName = item.getNodeName();
                                        if (nodeName.equalsIgnoreCase("param")) //$NON-NLS-1$
                                        {
                                            String key = ((Node) item).getAttributes().getNamedItem("key") //$NON-NLS-1$
                                                    .getNodeValue();
                                            String value = ((Node) item).getAttributes().getNamedItem("value") //$NON-NLS-1$
                                                    .getNodeValue();
                                            indicator.getParameters().put(key, value);
                                        }
                                    }

                                    tab.getIndicators().add(indicator);
                                } else if (nodeName.equalsIgnoreCase("object")) //$NON-NLS-1$
                                {
                                    ChartObject object = new ChartObject(new Integer(i));
                                    object.setParent(tab);
                                    object.setPluginId(((Node) item).getAttributes().getNamedItem("pluginId") //$NON-NLS-1$
                                            .getNodeValue());

                                    NodeList parametersList = item.getChildNodes();
                                    for (int p = 0; p < parametersList.getLength(); p++) {
                                        item = parametersList.item(p);
                                        nodeName = item.getNodeName();
                                        if (nodeName.equalsIgnoreCase("param")) //$NON-NLS-1$
                                        {
                                            String key = ((Node) item).getAttributes().getNamedItem("key") //$NON-NLS-1$
                                                    .getNodeValue();
                                            String value = ((Node) item).getAttributes().getNamedItem("value") //$NON-NLS-1$
                                                    .getNodeValue();
                                            object.getParameters().put(key, value);
                                        }
                                    }

                                    tab.getObjects().add(object);
                                }
                            }

                            row.getTabs().add(tab);
                        }
                    }

                    chart.getRows().add(row);
                }
            }
        } catch (Exception e) {
            logger.error(e.toString(), e);
        }
    }

    chart.clearChanged();

    return chart;
}

From source file:jhttpp2.Jhttpp2Server.java

/**
 * @since 0.4.10a// w w  w  .  ja  v a 2s. c  om
 */
public void setServerProperties(Properties p) {
    serverproperties = p;
    use_proxy = new Boolean(serverproperties.getProperty("server.http-proxy", "false")).booleanValue();
    try {
        proxy = InetAddress.getByName(serverproperties.getProperty("server.http-proxy.hostname", "127.0.0.1"));
    } catch (UnknownHostException e) {
    }
    proxy_port = new Integer(serverproperties.getProperty("server.http-proxy.port", "8080")).intValue();
    block_urls = new Boolean(serverproperties.getProperty("server.filter.url", "false")).booleanValue();
    http_useragent = serverproperties.getProperty("server.filter.http.useragent",
            "Mozilla/4.0 (compatible; MSIE 4.0; WindowsNT 5.0)");
    filter_http = new Boolean(serverproperties.getProperty("server.filter.http", "false")).booleanValue();
    enable_cookies_by_default = new Boolean(
            serverproperties.getProperty("server.enable-cookies-by-default", "true")).booleanValue();
    debug = new Boolean(serverproperties.getProperty("server.debug-logging", "false")).booleanValue();
    port = new Integer(serverproperties.getProperty("server.port", "8088")).intValue();
    log_access = new Boolean(serverproperties.getProperty("server.access.log", "false")).booleanValue();
    log_access_filename = serverproperties.getProperty("server.access.log.filename", "paccess.log");
    webconfig = new Boolean(serverproperties.getProperty("server.webconfig", "true")).booleanValue();
    www_server = new Boolean(serverproperties.getProperty("server.www", "true")).booleanValue();
    config_user = serverproperties.getProperty("server.webconfig.username", "root");
    config_password = serverproperties.getProperty("server.webconfig.password", "geheim");
}

From source file:org.sakaiproject.component.app.postem.GradebookManagerImpl.java

public SortedSet getReleasedGradebooksByContext(final String context, final String sortBy,
        final boolean ascending) {
    if (context == null) {
        throw new IllegalArgumentException("Null Argument");
    } else {/* w ww .ja v  a2 s.  c o m*/
        HibernateCallback hcb = new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException, SQLException {

                Criteria crit = session.createCriteria(GradebookImpl.class).add(Expression.eq(CONTEXT, context))
                        .add(Expression.eq(RELEASED, new Boolean(true)));

                List gbs = crit.list();

                Comparator gbComparator = determineComparator(sortBy, ascending);

                SortedSet gradebooks = new TreeSet(gbComparator);

                Iterator gbIterator = gbs.iterator();

                while (gbIterator.hasNext()) {
                    gradebooks.add((Gradebook) gbIterator.next());

                }

                return gradebooks;
            }
        };

        return (SortedSet) getHibernateTemplate().execute(hcb);
    }
}

From source file:com.projity.dialog.ResourceSubstitutionDialog.java

protected boolean bind(boolean get) {
    if (form == null)
        return false;
    if (get) {//from   w w w. j  a va2 s. c o m
        entireProject.setSelected((form.getEntireProject()).booleanValue());
        ignoreInProgress.setSelected(form.isIgnoreInProgress().booleanValue());
        rescheduleDateChooser.setValue(new Date(form.getRescheduleDate()));
        fromResource.setSelectedItem(form.getFromResource());
        toResource.setSelectedItem(form.getToResource());
    } else {
        Boolean b1 = new Boolean(entireProject.isSelected());
        form.setEntireProject(b1);
        Boolean b3 = new Boolean(ignoreInProgress.isSelected());
        form.setIgnoreInProgress(b3);

        long d2 = DateTime.gmt((Date) rescheduleDateChooser.getValue());
        d2 = CalendarOption.getInstance().makeValidStart(d2, true);
        form.setRescheduleDate(d2);
        form.setFromResource((Resource) fromResource.getSelectedItem());
        form.setToResource((Resource) toResource.getSelectedItem());

    }
    return true;
}

From source file:org.metis.cassandra.CqlComponent.java

/**
 * Return the startMonitor Boolean, which indicates whether the component
 * was instructed to monitor its Spring context file.
 * /*from  w w w. ja  va 2  s.  c o  m*/
 * @return Boolean
 */
public Boolean getStartMonitor() {
    if (startMonitor == null) {
        startMonitor = new Boolean(dfltStartMonitor);
    }
    return startMonitor;
}

From source file:com.xwiki.authentication.guanxi.GuanxiShibAuthenticator.java

/**
 * See if user exists in the system already.
 * /*from   ww w  . ja  v a2s.  c  o  m*/
 * @param String eid Enterprise id of user
 * @param XWikiContext context The context
 * @return Boolean t,f
 */
private Boolean userExists(String eid, XWikiContext context) {
    Boolean b = new Boolean(true);
    String fullwikiname = gxconfig.getDefaultUserSpace() + "." + eid;
    Principal p = getUserPrincipal(fullwikiname, context);

    if (p == null) {
        b = false;
    }

    if (log.isDebugEnabled()) {
        log.debug("looking for user " + fullwikiname + "[" + eid + "] = " + b);
    }
    return b;
}