Example usage for java.util.logging Level CONFIG

List of usage examples for java.util.logging Level CONFIG

Introduction

In this page you can find the example usage for java.util.logging Level CONFIG.

Prototype

Level CONFIG

To view the source code for java.util.logging Level CONFIG.

Click Source Link

Document

CONFIG is a message level for static configuration messages.

Usage

From source file:tigase.muc.modules.PresenceModule.java

/**
 * Constructs ...// ww w  .  j a  v a2  s . c o  m
 * 
 * 
 * @param config
 * @param writer
 * @param mucRepository
 * @param historyProvider
 * @param sender
 * @param mucLogger
 */
public PresenceModule(MucConfig config, ElementWriter writer, IMucRepository mucRepository,
        HistoryProvider historyProvider, DelDeliverySend sender, MucLogger mucLogger,
        Ghostbuster2 ghostbuster) {
    super(config, writer, mucRepository);
    this.historyProvider = historyProvider;
    this.mucLogger = mucLogger;
    this.filterEnabled = config.isPresenceFilterEnabled();
    this.ghostbuster = ghostbuster;
    allowedElements.add(ElementCriteria.name("show"));
    allowedElements.add(ElementCriteria.name("status"));
    allowedElements.add(ElementCriteria.name("priority"));
    allowedElements.add(ElementCriteria.xmlns("http://jabber.org/protocol/caps"));
    if (log.isLoggable(Level.CONFIG)) {
        log.config("Filtering presence children is " + (filterEnabled ? "enabled" : "disabled"));
    }
}

From source file:com.google.enterprise.connector.sharepoint.client.SharepointClientContext.java

public SharepointClientContext(ClientFactory clientFactory, String sharepointUrl, final String inDomain,
        final String inKdcHost, final String inUsername, final String inPassword,
        final String inGoogleConnectorWorkDir, final String inGoogleGlobalNamespace,
        final String inGoogleLocalNamespace, final String includedURls, final String excludedURls,
        final String inMySiteBaseURL, final String inAliasMapString, final FeedType inFeedType,
        boolean useSPSearchVisibility) throws SharepointException {
    // Avoid a deprecation warning on an overloaded Protocol constructor
    // by passing the argument as a ProtocolSocketFactory instead of an
    // SSLProtocolSocketFactory.
    ProtocolSocketFactory socketFactory = new SSLProtocolSocketFactory();
    Protocol.registerProtocol("https", new Protocol("https", socketFactory, SPConstants.SSL_DEFAULT_PORT));

    this.clientFactory = clientFactory;
    kdcServer = inKdcHost;//from  www .  j  av  a2  s  .  c o  m
    if (sharepointUrl == null) {
        throw new SharepointException("sharepoint URL is null");
    }
    if (inUsername == null) {
        throw new SharepointException("Username is null.");
    }
    if (inPassword == null) {
        throw new SharepointException("Password is null.");
    }
    if (inGoogleConnectorWorkDir == null) {
        throw new SharepointException("Working Directory is null.");
    }
    if (inFeedType == null) {
        throw new SharepointException("Feed Type is null.");
    }

    sharepointUrl = sharepointUrl.trim();

    if (sharepointUrl.endsWith(SPConstants.SLASH)) {
        sharepointUrl = sharepointUrl.substring(0, sharepointUrl.lastIndexOf(SPConstants.SLASH));
    }
    // Why to construct a SharePoint URL with default port as 80.
    try {
        final URL url = new URL(sharepointUrl);
        int port = url.getPort();
        if (-1 == port) {
            port = url.getDefaultPort();
        }
        siteURL = url.getProtocol() + SPConstants.URL_SEP + url.getHost() + SPConstants.COLON + port
                + url.getPath();
    } catch (final MalformedURLException e) {
        throw new SharepointException("Failed to construct sharepoint URL...", e);
    }

    if ((inDomain == null) || inDomain.trim().equals("")) {
        LOGGER.log(Level.CONFIG, "Trying to get domain information from username specified [ " + inUsername
                + " ] because domain field has not been explicitly specified.");
        domain = Util.getDomainFromUsername(inUsername);
    } else {
        domain = inDomain;
    }

    LOGGER.finest("domain set to " + domain);

    username = Util.getUserFromUsername(inUsername);
    LOGGER.finest("username set to " + username);

    this.setExcludedURlList(excludedURls, SPConstants.SEPARATOR);
    this.setIncludedURlList(includedURls, SPConstants.SEPARATOR);

    password = inPassword;
    googleGlobalNamespace = inGoogleGlobalNamespace;
    googleLocalNamespace = inGoogleLocalNamespace;
    googleConnectorWorkDir = inGoogleConnectorWorkDir;
    LOGGER.finest("googleConnectorWorkDir set to " + googleConnectorWorkDir);
    excludedURL_ParentDir = googleConnectorWorkDir + SPConstants.SLASH + SPConstants.EXCLUDED_URL_DIR;
    mySiteBaseURL = inMySiteBaseURL;
    LOGGER.finest("mySiteBaseURL set to " + mySiteBaseURL);
    aliasMap = parseAlias(inAliasMapString);

    feedType = inFeedType;
    LOGGER.finest("feedType set to " + feedType);
    LOGGER.finest("bFQDNConversion set to " + bFQDNConversion);

    this.useSPSearchVisibility = useSPSearchVisibility;

    LOGGER.config(" sharepointUrl = [" + sharepointUrl + "] , domain = [" + inDomain + "] , username = ["
            + inUsername + "] , googleConnectorWorkDir = [" + inGoogleConnectorWorkDir
            + "] , googleGlobalNamespace = [" + inGoogleGlobalNamespace + "] , googleLocalNamespace = ["
            + inGoogleLocalNamespace + "] , includedURls = [" + includedURls + "] , excludedURls = ["
            + excludedURls + "] , mySiteBaseURL = [" + inMySiteBaseURL + "], aliasMapString = ["
            + inAliasMapString + "], FeedType [" + inFeedType + "], useSPSearchVisibility = ["
            + useSPSearchVisibility + "]");
}

From source file:edu.usu.sdl.openstorefront.web.rest.service.Application.java

private List<String> loadLevels() {
    List<String> logLevels = Arrays.asList(Level.OFF.getName(), Level.SEVERE.getName(), Level.WARNING.getName(),
            Level.CONFIG.getName(), Level.INFO.getName(), Level.FINE.getName(), Level.FINER.getName(),
            Level.FINEST.getName(), Level.ALL.getName());
    return logLevels;
}

From source file:jenkins.util.SystemProperties.java

private static String doTryGetValueFromContext(String key) {
    if (StringUtils.isNotBlank(key) && Listener.theContext != null) {
        try {/*from w  w  w . j av  a2  s  .c  o  m*/
            String value = Listener.theContext.getInitParameter(key);
            if (value != null) {
                return value;
            }
        } catch (SecurityException ex) {
            // Log exception and go on
            LOGGER.log(Level.CONFIG, "Access to the property {0} is prohibited", key);
        }
    }
    return null;
}

From source file:com.ellychou.todo.rest.service.SpringContextJerseyTest.java

/**
* Returns an instance of {@link TestContainerFactory} class. This instance can be set by a constructor ({@link
* #JerseyTest(org.glassfish.jersey.test.spi.TestContainerFactory)}, as an application {@link Providers Provider} or the
* {@link TestContainerFactory} class can be set as a {@value org.glassfish.jersey.test.TestProperties#CONTAINER_FACTORY}
* property./*from www. j a  v a  2 s  . c  o m*/
*
* @return an instance of {@link TestContainerFactory} class.
* @throws TestContainerException if the initialization of {@link TestContainerFactory} instance is not successful.
*/
protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
    if (testContainerFactory == null) {
        if (testContainerFactoryClass == null) {

            final String tcfClassName = getProperty(TestProperties.CONTAINER_FACTORY);
            if ((tcfClassName == null)) {
                Set<TestContainerFactory> testContainerFactories = Providers
                        .getProviders(application.getServiceLocator(), TestContainerFactory.class);

                if (testContainerFactories.size() >= 1) {
                    // if default factory is present, use it.
                    for (TestContainerFactory tcFactory : testContainerFactories) {

                        if (tcFactory.getClass().getName().equals(TestProperties.DEFAULT_CONTAINER_FACTORY)) {
                            LOGGER.log(Level.CONFIG,
                                    "Found multiple TestContainerFactory implementations, using default {0}",
                                    tcFactory.getClass().getName());

                            testContainerFactoryClass = tcFactory.getClass(); // is this necessary?
                            return tcFactory;
                        }
                    }

                    if (testContainerFactories.size() != 1) {
                        LOGGER.log(Level.WARNING,
                                "Found multiple TestContainerFactory implementations, using {0}",
                                testContainerFactories.iterator().next().getClass().getName());
                    }

                    testContainerFactoryClass = testContainerFactories.iterator().next().getClass();
                    return testContainerFactories.iterator().next();

                }
            } else {
                final Class<Object> tfClass = AccessController
                        .doPrivileged(ReflectionHelper.classForNamePA(tcfClassName, null));
                if (tfClass == null) {
                    throw new TestContainerException("The default test container factory class name, "
                            + tcfClassName + ", cannot be loaded");
                }
                try {
                    testContainerFactoryClass = tfClass.asSubclass(TestContainerFactory.class);
                } catch (ClassCastException ex) {
                    throw new TestContainerException("The default test container factory class, " + tcfClassName
                            + ", is not an instance of TestContainerFactory", ex);
                }
            }
        }

        try {
            return testContainerFactoryClass.newInstance();
        } catch (Exception ex) {
            throw new TestContainerException("The default test container factory, " + testContainerFactoryClass
                    + ", could not be instantiated", ex);
        }
    }

    return testContainerFactory;
}

From source file:com.google.enterprise.connector.sharepoint.wsclient.soap.SPSiteDataWS.java

/**
 * Retrieves the title of a Web Site. Should only be used in case of SP2003
 * Top URL. For all other cases, WebWS.getTitle() is the preferred method.
 *///from   w  w  w  .  j a  v  a2  s.c  o m
//TODO: Adding VisibleForTesting throws exception when generating javadoc
//@VisibleForTesting
String getTitle() throws RemoteException {
    final UnsignedIntHolder getWebResult = new UnsignedIntHolder();
    final _sWebMetadataHolder sWebMetadata = new _sWebMetadataHolder();
    final ArrayOf_sWebWithTimeHolder vWebs = new ArrayOf_sWebWithTimeHolder();
    final ArrayOf_sListWithTimeHolder vLists = new ArrayOf_sListWithTimeHolder();
    final ArrayOf_sFPUrlHolder vFPUrls = new ArrayOf_sFPUrlHolder();
    final StringHolder strRoles = new StringHolder();
    final ArrayOfStringHolder vRolesUsers = new ArrayOfStringHolder();
    final ArrayOfStringHolder vRolesGroups = new ArrayOfStringHolder();
    try {
        stub.getWeb(getWebResult, sWebMetadata, vWebs, vLists, vFPUrls, strRoles, vRolesUsers, vRolesGroups);
        return sWebMetadata.value.getTitle();
    } catch (final AxisFault af) { // Handling of username formats for
        // different authentication models.
        if ((SPConstants.UNAUTHORIZED.indexOf(af.getFaultString()) != -1)
                && (sharepointClientContext.getDomain() != null)) {
            final String username = Util.switchUserNameFormat(stub.getUsername());
            LOGGER.log(Level.CONFIG, "Web Service call failed for username [ " + stub.getUsername()
                    + " ]. Trying with " + username);
            stub.setUsername(username);
            try {
                stub.getWeb(getWebResult, sWebMetadata, vWebs, vLists, vFPUrls, strRoles, vRolesUsers,
                        vRolesGroups);
                return sWebMetadata.value.getTitle();
            } catch (final Exception e) {
                LOGGER.log(Level.WARNING,
                        "Unable to get the title for web because call to the WS failed. endpoint [ " + endpoint
                                + " ]",
                        e);
                return "";
            }
        } else {
            LOGGER.log(Level.WARNING,
                    "Unable to get the title for web because call to the WS failed. endpoint [ " + endpoint
                            + " ]",
                    af);
            return "";
        }
    } catch (final Throwable e) {
        LOGGER.log(Level.WARNING,
                "Unable to get the title for web because call to the WS failed. endpoint [ " + endpoint + " ]",
                e);
        return "";
    }
}

From source file:diet.gridr.g5k.gui.GanttChart.java

/**
 * Method returning the card panel/*  www.j  a  va  2s.c  o  m*/
 *
 * @return the card panel
 */
private JPanel getCardPanel() {
    cardPanel = new JPanel();
    ganttChartLayout = new CardLayout();
    cardPanel.setLayout(ganttChartLayout);
    final WaitingFrame waiting = new WaitingFrame("Waiting frame",
            "Creating the gantt charts for this cluster ...", durationsStringArray.length + 1, true);
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            Thread thread = new Thread(new Runnable() {
                public void run() {
                    waiting.setStatusText("Operation : ");
                    waiting.launch("running oar stat history command ...");
                    OarHistoryRunnable historyRunnable = null;
                    chartPanels = new JPanel[durationsStringArray.length];
                    for (int i = 0; i < durationsStringArray.length; i++) {
                        waiting.setStatusText("retrieving OAR history for " + durationsStringArray[i]);
                        waiting.incrementProgressBar();
                        Date startDate = GregorianCalendar.getInstance().getTime();
                        Date endDate = new Date(startDate.getTime() + HistoryUtil.durationsTimesArray[i]);
                        historyRunnable = new OarHistoryRunnable(connection, jobsList.get(i),
                                Config.getBatchScheduler(G5kSite.getIndexForSite(siteName)),
                                G5kSite.getInternalFrontalForSite(siteName), startDate, endDate);
                        Thread th = new Thread(historyRunnable);
                        th.start();
                        try {
                            th.join();
                        } catch (Exception e) {
                            LoggingManager.log(Level.WARNING, LoggingManager.RESOURCESTOOL,
                                    this.getClass().getName(), "run", e);
                        }
                        jobsList.set(i, historyRunnable.getJobsList());
                        //                            Iterator<String> iter = historyLines.iterator();
                        //                            /*
                        //                             * The history is separated into three parts:
                        //                             *
                        //                             *  - the first is the free nodes written as follows :
                        //                             *  'node1' 'weightOfNode1' 'node2' 'weightOfNode2' ...
                        //                             *   eg :
                        //                             *  'sagittaire-12.lyon.grid5000.fr' '2' 'sagittaire-13.lyon.grid5000.fr' '2'
                        //                             *
                        //                             *  - the second is a list of jobs :
                        //                             *  'job id' 'type' 'user' 'state' 'command' 'properties' 'start time' 'queue' 'submission time' 'end time' 'node1' 'weightOfNode1' 'node2' 'weightOfNode2' ...
                        //                             *   e.g. :
                        //                             *   '20081' 'PASSIVE' 'ssoudan' 'Running' '/bin/sleep 72000' '(p.deploy = "YES") AND p.deploy = "YES" ' '2007-03-23 10:18:48' 'deploy' '2007-03-23 10:19:03' '2007-03-24 06:18:48' 'sagittaire-19.lyon.grid5000.fr' '2' 'sagittaire-24.lyon.grid5000.fr' '2'
                        //                             *
                        //                             *  - the last one is a list of dead jobs :
                        //                             *  the last part as the same pattern as the jobs
                        //                             *  '0' 'Dead' 'oar' 'null' 'null' 'null' '0000-00-00 00:00:00' 'default' '2007-03-22 19:30:02' '2007-03-24 14:00:00' 'sagittaire-60.lyon.grid5000.fr' '2'
                        //                             *
                        //                             */
                        //                            // for all jobs
                        //                            while(iter.hasNext()){
                        //                                String historyLine = iter.next();
                        //                                historyLine = historyLine.replace("''","' '");
                        //                                StringTokenizer tokenizer = new StringTokenizer(historyLine,"'");
                        //                                ArrayList<String> information = new ArrayList<String>();
                        //                                while(tokenizer.hasMoreTokens()){
                        //                                    information.add(tokenizer.nextToken());
                        //                                }
                        //                                int jobNumber=-1;
                        //                                try{
                        //                                    // if no exception is thrown then it means that we are no! in the first
                        //                                    // part of the history
                        //                                    jobNumber = Integer.parseInt(information.get(0));
                        //                                }
                        //                                catch(Exception e){
                        //                                    LoggingManager.log(Level.FINE, LoggingManager.RESOURCESTOOL, this.getClass().getName(), "run", e);
                        //                                }
                        //                                if(jobNumber == 0){
                        //                                    // this is a dead of absent node
                        //                                    GridJob aJob = new Oar1Job();
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_HOSTS, information.get(20));
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_ID, "0");
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_OWNER, "");
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_QUEUE, "");
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_STATE, "");
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_RESOURCES_COUNT, "1");
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_SCHEDTIME,
                        //                                            GanttChart.getOARDateFromDate(Calendar.getInstance().getTime()));//information.get(12);
                        //                                    aJob.setParameterValue(GridJob.KEY_GRID_JOB_WALLTIME,
                        //                                            getWallTimeFromDate(HistoryUtil.durationsTimesArray[i]));//ntheWallTime;
                        //                                    jobsList.get(i).add(aJob);
                        //                                }
                        //                                else if (jobNumber != -1){
                        //                                    // this is not a dead or absent or suspected job but a classical job
                        //                                    GridJob aJob = null;
                        //                                    //searching the job
                        //                                    for(int j = 0 ;j < jobsList.get(i).size() ; j++){
                        //                                        aJob = jobsList.get(i).get(j);
                        //                                        String firstParam = aJob.getParameterValue(GridJob.KEY_GRID_JOB_ID);
                        //                                        if(jobNumber == Integer.parseInt(firstParam)){
                        //                                            j=jobsList.get(i).size();
                        //                                        }
                        //                                    }
                        //                                    // if the job is waiting
                        //                                    if(aJob.getParameterValue(GridJob.KEY_GRID_JOB_STATE).substring(0, 1).equalsIgnoreCase("w")){
                        //                                        ArrayList<String> theNodes = new ArrayList<String>();
                        //                                        for(int index = 20 ; index < information.size() ; index +=4){
                        //                                            theNodes.add(information.get(index));
                        //                                        }
                        //
                        //                                        if(theNodes.size() >= 1){
                        ////                                            String nodesOfTheJob = theNodes.get(0);
                        ////                                            for(int anIndex = 1 ; anIndex < theNodes.size(); anIndex ++){
                        ////                                                nodesOfTheJob += "+" + theNodes.get(anIndex);
                        ////                                            }
                        //                                            // TODO: check this operation (don't understand how use it)
                        //                                            aJob.setHostsFromArray(theNodes.toArray(new String[0]));
                        //                                        }
                        //                                    }
                        //                                }
                        //                            }

                        waiting.setStatusText("creating chart for " + durationsStringArray[i]);
                        visualizationDuration = i;
                        chartPanels[i] = new ChartPanel(createChart(createDataset()));
                        chartPanels[i].setPreferredSize(new java.awt.Dimension(800, 600));
                        chartPanels[i].setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 10));
                        cardPanel.add(durationsStringArray[i], chartPanels[i]);
                    }
                    visualizationDuration = ONE_DAY;
                    ganttChartLayout.show(cardPanel, durationsStringArray[visualizationDuration]);
                    waiting.dispose();
                    GanttChart.this.pack();
                    GanttChart.this.setVisible(true);
                    LoggingManager.log(Level.CONFIG, LoggingManager.RESOURCESTOOL, this.getClass().getName(),
                            "run", "GanttChart initialized");
                }
            });
            thread.start();
        }
    });
    LoggingManager.log(Level.CONFIG, LoggingManager.RESOURCESTOOL, this.getClass().getName(), "getCardPanel",
            "CardPanel initialized");
    return cardPanel;
}

From source file:com.google.enterprise.connector.sharepoint.wsclient.soap.SPSiteDataWS.java

/**
 * Makes a call to Site Data web service to retrieve site meta data and create
 * a SPDocuemnt and it returns a single SPDcoument.This method returns null if
 * and only if any one of SiteData stub or webState is null.
 *
 * @param webState The web from which we need to construct SPDcoument for it's
 *          landing page./*  ww  w. ja v  a2 s .com*/
 * @return a single SPDocument for the given web.
 * @throws SharepointException
 */
public SPDocument getSiteData(final WebState webState) throws SharepointException {
    final UnsignedIntHolder getWebResult = new UnsignedIntHolder();
    final _sWebMetadataHolder sWebMetadata = new _sWebMetadataHolder();
    final ArrayOf_sWebWithTimeHolder vWebs = new ArrayOf_sWebWithTimeHolder();
    final ArrayOf_sListWithTimeHolder vLists = new ArrayOf_sListWithTimeHolder();
    final ArrayOf_sFPUrlHolder vFPUrls = new ArrayOf_sFPUrlHolder();
    final StringHolder strRoles = new StringHolder();
    final ArrayOfStringHolder vRolesUsers = new ArrayOfStringHolder();
    final ArrayOfStringHolder vRolesGroups = new ArrayOfStringHolder();

    if (stub == null) {
        LOGGER.warning("Unable to get the list collection because stub is null");
        // in case if SiteData web service end point is not created properly.
        return null;
    }

    if (webState == null) {
        LOGGER.warning("Unable to get the list collection because webstate is null");
        // in case if the web state is null and is not existing in SharePoint
        // server.
        return null;
    }
    try {
        stub.getWeb(getWebResult, sWebMetadata, vWebs, vLists, vFPUrls, strRoles, vRolesUsers, vRolesGroups);
    } catch (final AxisFault af) {
        // Handling of username formats for
        // different authentication models.
        if ((SPConstants.UNAUTHORIZED.indexOf(af.getFaultString()) != -1)
                && (sharepointClientContext.getDomain() != null)) {
            final String username = Util.switchUserNameFormat(stub.getUsername());
            LOGGER.log(Level.CONFIG, "Web Service call failed for username [ " + stub.getUsername()
                    + " ]. Trying with " + username);
            stub.setUsername(username);
            try {
                stub.getWeb(getWebResult, sWebMetadata, vWebs, vLists, vFPUrls, strRoles, vRolesUsers,
                        vRolesGroups);
            } catch (final Exception e) {
                LOGGER.log(Level.WARNING,
                        "Unable to get site data for web because call to the WS failed. endpoint [ " + endpoint
                                + " ]",
                        e);
            }
        } else {
            LOGGER.log(Level.WARNING,
                    "Unable to get site data for web because call to the WS failed. endpoint [ " + endpoint
                            + " ]",
                    af);
        }
    } catch (final Throwable e) {
        LOGGER.log(Level.WARNING,
                "Unable to get the data for web because call to the WS failed. endpoint [ " + endpoint + " ]",
                e);
    }

    final SPDocument siteDataDocument = new SPDocument(
            webState.getPrimaryKey() + SPConstants.DEFAULT_SITE_LANDING_PAGE + SPConstants.DOC_TOKEN
                    + sWebMetadata.value.getWebID(),
            webState.getWebUrl() + SPConstants.DEFAULT_SITE_LANDING_PAGE,
            sWebMetadata.value.getLastModified().getInstance(), sWebMetadata.value.getAuthor(),
            SPConstants.SITE, webState.getTitle(), sharepointClientContext.getFeedType(),
            webState.getSharePointType());
    HttpMethodBase method = null;
    String strUrl = Util.encodeURL(siteDataDocument.getUrl());
    try {
        method = new HeadMethod(strUrl);
        int responseCode = sharepointClientContext.checkConnectivity(strUrl, method);
        if (responseCode != 200) {
            LOGGER.log(Level.INFO,
                    "Possible Publishing website.Marking Url [" + strUrl + " ] with Document Type as ACL");
            siteDataDocument.setDocumentType(DocumentType.ACL);
        }
    } catch (final Exception e) {
        LOGGER.log(Level.WARNING, "Unable to connect [ " + strUrl + " ] marking site home page as ACL document",
                e);
        siteDataDocument.setDocumentType(DocumentType.ACL);
    }

    return siteDataDocument;
}

From source file:com.ellychou.todo.rest.service.SpringContextJerseyTest.java

/**
* Get the port to be used for test application deployments.
*
* @return The HTTP port of the URI/*from w w w .j av  a  2s .  c  om*/
*/
protected final int getPort() {
    final String value = AccessController
            .doPrivileged(PropertiesHelper.getSystemProperty(TestProperties.CONTAINER_PORT));
    if (value != null) {

        try {
            final int i = Integer.parseInt(value);
            if (i <= 0) {
                throw new NumberFormatException("Value not positive.");
            }
            return i;
        } catch (NumberFormatException e) {
            LOGGER.log(Level.CONFIG,
                    "Value of " + TestProperties.CONTAINER_PORT + " property is not a valid positive integer ["
                            + value + "]." + " Reverting to default [" + TestProperties.DEFAULT_CONTAINER_PORT
                            + "].",
                    e);
        }
    }
    return TestProperties.DEFAULT_CONTAINER_PORT;
}

From source file:diet.gridr.g5k.gui.GanttChart.java

/**
 * Method printing to files the jobs//  w w  w.j  a  v a  2  s  .co m
 *
 */
private void printToFile() {
    try {
        for (int i = 0; i < durationsStringArray.length; i++) {
            ArrayList<GridJob> aJobList = jobsList.get(i);
            PrintWriter ecrivain = new PrintWriter(new BufferedWriter(
                    new FileWriter(System.getProperty("user.home") + durationsStringArray[i] + ".txt")));
            for (int j = 0; j < aJobList.size(); j++) {
                GridJob aJob = aJobList.get(j);
                ecrivain.println("---");
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_ID));
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_RESOURCES_COUNT));
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_HOSTS));
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_OWNER));
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_QUEUE));
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_SCHEDTIME));
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_STATE));
                ecrivain.println(aJob.getParameterValue(GridJob.KEY_GRID_JOB_WALLTIME));
            }
            ecrivain.close();
        }
    } catch (Exception e) {
        LoggingManager.log(Level.CONFIG, LoggingManager.RESOURCESTOOL, this.getClass().getName(), "printFile",
                e);
    }
}