Ejemplo n.º 1
0
 /**
  * Get access element of the specified service type for this dataset. If more than one, get the
  * first one.
  *
  * @param type find this ServiceType
  * @return InvAccess or null if there is not one.
  */
 public InvAccess getAccess(thredds.catalog.ServiceType type) {
   for (InvAccess a : getAccess()) {
     InvService s = a.getService();
     if (s.getServiceType() == type) return a;
   }
   return null;
 }
Ejemplo n.º 2
0
  /**
   * Find the named service declared in this dataset or one of its parents.
   *
   * @param name match this name
   * @return first service that matches the given name, or null if none found.
   */
  public InvService findService(String name) {
    if (name == null) return null;

    // search local (but expanded) services
    for (InvService p : services) {
      if (p.getName().equals(name)) return p;
    }

    // not found, look in parent
    if (parent != null) return parent.findService(name);
    return (catalog == null) ? null : catalog.findService(name);
  }
Ejemplo n.º 3
0
  /**
   * Find the named service declared in the top level of this catalog.
   *
   * @param name match this name
   * @return service that matches the given name, or null if none found.
   */
  public InvService findService(String name) {
    if (name == null) return null;

    for (InvService s : services) {
      if (name.equals(s.getName())) return s;

      // look for nested servers
      if (s.getServiceType() == ServiceType.COMPOUND) {
        InvService result = s.findNestedService(name);
        if (result != null) return result;
      }
    }

    return null;
  }