Example usage for java.util List toString

List of usage examples for java.util List toString

Introduction

In this page you can find the example usage for java.util List toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.uiautomation.ios.grid.IOSCapabilitiesMonitor.java

@Override
public void run() {
    while (active) {
        try {/*w  w  w . j  a  v  a2 s . c o m*/
            RegistrationRequest latest = createRegistrationRequest();
            if (latest == null) {
                noResponse++;
                proxy.setAvailable(false);
                if (noResponse >= 30) {
                    active = false;
                    removeNode();
                }
                continue;
            }
            noResponse = 0;
            proxy.setAvailable(true);
            List<DesiredCapabilities> latestCapabilities = latest.getCapabilities();
            if (!registeredCapabilities.toString().equals(latestCapabilities.toString())) {
                System.out.println("New capabilities registered on " + node.toString() + ". Updating...");
                updateCapabilities(latest);
            }
            Thread.sleep(2000);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

From source file:com.btobits.automator.fix.ant.filter.FixFilterRule.java

public List<String> actionStrMsg(List<String> messages) {
    if (log.isDebugEnabled()) {
        log.debug("Filter action on message: " + messages.toString());
    }//from w w  w.  j  a  v a2 s. c o m
    List<String> result = new LinkedList<String>(messages);
    for (FixFilterAction filterAction : filterActions) {
        result = filterAction.doStrMsgAction(messages);
    }
    if (log.isDebugEnabled()) {
        log.debug("Message after actions: " + result.toString());
    }
    return result;
}

From source file:com.wandisco.s3hdfs.rewrite.redirect.MultiPartFileRedirect.java

private void doIncrementalConcat(List<String> sources) throws IOException {
    int sourcesToConcat = sources.size();
    int increments = sourcesToConcat / 500;

    int i = 0;//w  ww .j a va2 s.  co m
    do {
        int startIndex = (i * 500 == 0) ? 1 : i * 500; //1, 500, 1000, 1500...
        int endIndex = ((i + 1) * 500); //499, 999, 1499...
        if (endIndex >= sourcesToConcat)
            endIndex = sourcesToConcat;
        List<String> toConcat = sources.subList(startIndex, endIndex);
        System.out.println("CONCAT SRCS[" + i + "]: " + toConcat.toString());
        String conCatSrcs = StringUtils.join(",", toConcat);

        PostMethod httpPost = (PostMethod) getHttpMethod(request.getScheme(), request.getServerName(),
                request.getServerPort(), "CONCAT&sources=" + conCatSrcs, path.getUserName(),
                ADD_WEBHDFS(path.getHdfsRootUploadPath() + "1" + PART_FILE_NAME), POST);

        httpClient.executeMethod(httpPost);
        httpPost.releaseConnection();
        assert httpPost.getStatusCode() == 200;

        i++;
    } while (i <= increments);
}

From source file:com.shome.rubyshop.LoginActivity.java

private void Publish_Permission() {
    //publis request
    //Chi duoc goi sau khi ReadPermissions dc accept (goi tai OnResult)
    Session session = Session.getActiveSession();
    if (session != null) {
        // Check for publish permissions
        List<String> permissions = session.getPermissions();
        Log.v("permission", permissions.toString());
        if (!isSubsetOf(PERMISSIONS, permissions)) {
            pendingPublishReauthorization = true;
            Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(this,
                    PERMISSIONS);/*w  w  w  .jav  a 2 s.  c o m*/
            session.requestNewPublishPermissions(newPermissionsRequest);
            return;
        }
    }

}

From source file:edu.missouri.bas.bluetooth.equivital.EquivitalRunnable.java

private void writeChestSensorDatatoCSV(String chestSensorData) {
    // TODO Auto-generated method stub
    //Toast.makeText(serviceContext,"Trying to write to the file",Toast.LENGTH_LONG).show();
    Calendar c = Calendar.getInstance();
    SimpleDateFormat curFormater = new SimpleDateFormat("MMMMM_dd");
    String dateObj = curFormater.format(c.getTime());
    String file_name = "chestsensor." + deviceName + "." + dateObj + ".txt";
    Calendar cal = Calendar.getInstance();
    cal.setTimeZone(TimeZone.getTimeZone("US/Central"));
    File f = new File(BASE_PATH, file_name);
    String dataToWrite = String.valueOf(cal.getTime()) + "," + chestSensorData;
    dataPoints.add(dataToWrite + ";");
    if (dataPoints.size() == 57) {
        List<String> subList = dataPoints.subList(0, 56);
        String data = subList.toString();
        String formattedData = data.replaceAll("[\\[\\]]", "");
        //sendDatatoServer("chestsensor"+"."+phoneAddress+"."+deviceName+"."+dateObj,formattedData);
        TransmitData transmitData = new TransmitData();
        transmitData.execute("chestsensor" + "." + phoneAddress + "." + deviceName + "." + dateObj,
                formattedData);//from   w  w w .  ja v a  2 s . c om
        Log.d("Equivital", "Data Point Sent");
        subList.clear();
        subList = null;
    }
    if (f != null) {
        try {
            writeToFile(f, dataToWrite);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}

From source file:com.btobits.automator.fix.ant.filter.FixFilterRule.java

public List<Message> actionFixMsg(final List<Message> messages) {
    if (log.isDebugEnabled()) {
        log.debug("Filter action on message: " + messages.toString());
    }//from  ww  w . j  a v a  2 s .  c o m
    List<Message> result = new LinkedList<Message>(messages);
    for (FixFilterAction filterAction : filterActions) {
        result = filterAction.doFixMsgAction(messages);
    }
    if (log.isDebugEnabled()) {
        log.debug("Message after actions: " + result.toString());
    }
    return result;
}

From source file:com.yahoo.bard.webservice.config.LayeredFileSystemConfig.java

/**
 * Build a Layered File System Configuration, using first the environment and an application configuration source,
 * then drill down into available modules and load each of them in package dependency order.
 *//*from  ww  w  . j av  a2s. c om*/
@SuppressWarnings(value = "unchecked")
public LayeredFileSystemConfig() {
    masterConfiguration = new CompositeConfiguration();
    masterConfiguration.setThrowExceptionOnMissing(true);
    runtimeProperties = new Properties();

    try {

        List<Configuration> userConfig = loader.loadConfigurations(USER_CONFIG_FILE_NAME);

        // User configuration provides overrides for configuration on a specific environment or specialized role
        if (userConfig.size() > 1) {
            List<Resource> resources = loader.loadResourcesWithName(USER_CONFIG_FILE_NAME)
                    .collect(Collectors.toList());
            LOG.error(TOO_MANY_USER_CONFIGS.logFormat(resources.toString()));
            throw new SystemConfigException(TOO_MANY_USER_CONFIGS.format(resources.size()));
        }

        // Test application configuration provides overrides for configuration in a testing environment
        List<Configuration> testApplicationConfig = loader.loadConfigurationsNoJars(TEST_CONFIG_FILE_NAME);

        // Application configuration defines configuration at an application level for a bard instance
        List<Configuration> applicationConfig = loader.loadConfigurations(APPLICATION_CONFIG_FILE_NAME);

        if (applicationConfig.size() > 1) {
            List<Resource> resources = loader.loadResourcesWithName(APPLICATION_CONFIG_FILE_NAME)
                    .collect(Collectors.toList());
            LOG.error(TOO_MANY_APPLICATION_CONFIGS.logFormat(resources.toString()));
            throw new SystemConfigException(TOO_MANY_APPLICATION_CONFIGS.format(resources.size()));
        }

        // Environment config has higher priority than java system properties
        // Java system properties have higher priority than file based configuration
        // Also, a runtime map is maintained to support on-the-fly configuration changes

        // Load the rest of the config "top down" through the layers, in highest to lowest precedence
        Stream.of(Stream.of(new MapConfiguration(runtimeProperties)), Stream.of(new EnvironmentConfiguration()),
                Stream.of(new SystemConfiguration()), userConfig.stream(), testApplicationConfig.stream(),
                applicationConfig.stream()).flatMap(Function.identity()).filter(Objects::nonNull)
                .forEachOrdered(masterConfiguration::addConfiguration);

        // Use the config which has been loaded to identify module dependencies
        List<String> dependentModules = (List<String>) masterConfiguration
                .getList(ConfigurationGraph.DEPENDENT_MODULE_KEY, Collections.<String>emptyList());

        // Add module dependencies to the master configuration
        new ModuleLoader(loader).getConfigurations(dependentModules)
                .forEach(masterConfiguration::addConfiguration);
    } catch (IOException e) {
        throw new SystemConfigException(e);
    }
}

From source file:org.openbaton.nse.core.QosManagement.java

public List<Server> createQueues(Host hostMap, List<QoSAllocation> queues, String nsrId) {

    logger.info("[QOS-HANDLER] CREATING queues for " + nsrId + " at time " + new Date().getTime());
    logger.debug("received request for " + queues.toString());

    List<ServerQoS> queuesReq = new ArrayList<>();
    List<Server> servers = new ArrayList<>();

    for (QoSAllocation allocation : queues) {

        String serverName = allocation.getServerName();
        logger.debug("[CREATING QUEUES] get server name " + serverName);
        String hypervisor = hostMap.belongsTo(serverName);
        logger.debug("[CREATING QUEUES] get hypervisor name " + hypervisor);
        Server serverData = requestor.getServerData(hypervisor, serverName);
        logger.debug("[CREATING QUEUES] server data is " + serverData.toString());
        servers.add(serverData);/*w  w  w .j av a  2  s  .c  om*/
        ServerQoS serverQoS = this.compileServerRequest(serverData, allocation.getIfaces(), hypervisor);
        queuesReq.add(serverQoS);
    }

    QosAdd add = new QosAdd(queuesReq);
    add = requestor.setQoS(add);

    servers = this.updateServers(servers, add);
    logger.info("[QOS-HANDLER] CREATED queues for " + nsrId + " at time " + new Date().getTime());
    return servers;
}

From source file:com.sm.store.TestRemoteCall.java

public void testReplace() {
    RemoteClientImpl client = new NTRemoteClientImpl("localhost:7100", null, "store");
    List list = client.query("replace Person set income = 20.0 where age <= 3 and age >= 0");
    System.out.println("size " + list.size() + " " + list.toString());
    String json = client//w  w w. j a  v  a  2  s . c om
            .query4Json("select  name, age, male, address from Person where key# >= 0 and key# <= 3");
    System.out.println("json :" + json);
}

From source file:com.liferay.sync.engine.service.SyncFileServiceTest.java

@Test
public void testDeleteFolderSyncFile() throws Exception {
    List<SyncFile> syncFiles = SyncFileService.findSyncFiles(syncAccount.getSyncAccountId());

    Assert.assertEquals(syncFiles.toString(), 1, syncFiles.size());

    SyncFile folderSyncFileA = SyncFileTestUtil.addFolderSyncFile(FileUtil.getFilePathName(filePathName, "a"),
            syncAccount.getSyncAccountId());

    SyncFile folderSyncFileAA = SyncFileTestUtil.addFolderSyncFile(
            FileUtil.getFilePathName(filePathName, "a", "a"), folderSyncFileA.getTypePK(),
            syncAccount.getSyncAccountId());

    SyncFileTestUtil.addFolderSyncFile(FileUtil.getFilePathName(filePathName, "a", "b"),
            folderSyncFileA.getTypePK(), syncAccount.getSyncAccountId());

    SyncFileTestUtil.addFolderSyncFile(FileUtil.getFilePathName(filePathName, "a", "a", "a"),
            folderSyncFileAA.getTypePK(), syncAccount.getSyncAccountId());

    SyncFileTestUtil.addFileSyncFile(FileUtil.getFilePathName(filePathName, "a", "b.txt"),
            folderSyncFileA.getTypePK(), syncAccount.getSyncAccountId());

    SyncFileTestUtil.addFileSyncFile(FileUtil.getFilePathName(filePathName, "a", "c.txt"),
            folderSyncFileA.getTypePK(), syncAccount.getSyncAccountId());

    SyncFileTestUtil.addFileSyncFile(FileUtil.getFilePathName(filePathName, "a", "a", "a.txt"),
            folderSyncFileAA.getTypePK(), syncAccount.getSyncAccountId());

    syncFiles = SyncFileService.findSyncFiles(syncAccount.getSyncAccountId());

    Assert.assertEquals(syncFiles.toString(), 8, syncFiles.size());

    SyncFileService.deleteSyncFile(folderSyncFileA);

    syncFiles = SyncFileService.findSyncFiles(syncAccount.getSyncAccountId());

    Assert.assertEquals(syncFiles.toString(), 1, syncFiles.size());
}