Java Vector from String constructFilter(String hostname, Vector schedulertypes)

Here you can find the source of constructFilter(String hostname, Vector schedulertypes)

Description

what is this used for?

License

Open Source License

Parameter

Parameter Description
hostname specifies the hostname
schedulertypes a parameter

Declaration

private static String constructFilter(String hostname,
        Vector schedulertypes) 

Method Source Code

//package com.java2s;
/*//  w w w  . ja va  2 s  .  c om
 * Portions of this file Copyright 1999-2005 University of Chicago
 * Portions of this file Copyright 1999-2005 The University of Southern California.
 *
 * This file or a portion of this file is licensed under the
 * terms of the Globus Toolkit Public License, found at
 * http://www.globus.org/toolkit/download/license.html.
 * If you redistribute this file, with or without
 * modifications, you must include this notice in the file.
 */

import java.util.*;

public class Main {
    /** what is this used for?
     * 
     * @param hostname specifies the hostname
     * @param schedulertypes 
     */
    private static String constructFilter(String hostname,
            Vector schedulertypes) {
        StringBuffer filter = new StringBuffer();

        filter.append("(&(objectclass=GlobusServiceJobManager)(hn=");
        filter.append(hostname);
        if (hostname.indexOf("*") == -1)
            filter.append("*");
        filter.append(")");

        int size = schedulertypes.size();

        if (size != 0) {

            filter.append("(|");

            for (int i = 0; i < size; i++) {
                filter.append("(schedulertype=");
                filter.append(schedulertypes.elementAt(i));
                filter.append(")");
            }

            filter.append(")");
        }

        filter.append(")");

        return filter.toString();
    }
}

Related

  1. containSource(Vector sources, String source)
  2. convertStringToVector(String source, String separator)
  3. createNodeValueVector(final String val)
  4. getKeyStringAsVector(String keyString, String separator)