Package org.apache.oodt.opendapps

Examples of org.apache.oodt.opendapps.OpendapProfileElementExtractor


  }

  public static Map<String, ProfileElement> getProfileElements(
      OpendapConfig conf, DConnect dConn, Metadata datasetMet, Profile profile) throws Exception {
   
    OpendapProfileElementExtractor pe = new OpendapProfileElementExtractor(conf);
    Map<String, ProfileElement> profElements = new HashMap<String, ProfileElement>();

    // extracts all variables defined in DDS
    try {
       
        DDS dds = dConn.getDDS();
               
        // loop over all variables found
        Enumeration variables = dds.getVariables();
        while (variables.hasMoreElements()) {
         
          BaseType variable = (BaseType)variables.nextElement();
          String varName = variable.getName();
          if (variable instanceof DArray) {
            LOG.log(Level.FINE, "Extracting Darray variable: "+varName);
          } else if (variable instanceof DGrid) {
            LOG.log(Level.FINE, "Extracting Dgrid variable: "+varName);
          }        

          RewriteSpec spec = getProfileElementSpec(varName, conf);
          if (spec!=null) {
            // use configuration to set variable re-name and type
            String peName = spec.getRename() != null && !spec.getRename().equals("") ? spec.getRename() : spec.getOrigName();
            if (spec.getElementType().equals(RANGED_ELEMENT_TYPE)) {
              profElements.put(peName, pe.extractRangedProfileElement(peName, spec.getOrigName(), profile, dConn.getDAS()));
            } else if (spec.getElementType().equals(ENUM_ELEMENT_TYPE)) {
              profElements.put(peName, pe.extractEnumeratedProfileElement(peName, spec.getOrigName(), profile, dConn.getDAS()));
            }
          } else {
            // if not explicitly configured, assume variable if of RANGED_ELEMENT_TYPE
            profElements.put(varName, pe.extractRangedProfileElement(varName, varName, profile, dConn.getDAS()));
          }
         
        }
       
    } catch(Exception e) {
View Full Code Here


  public static Map<String, ProfileElement> getProfileElements(
      OpendapConfig conf, DConnect dConn, Metadata datasetMet, Profile profile) {
    // TODO: later, we should just read all attributes instead of just those
    // specified in the conf
    OpendapProfileElementExtractor pe = new OpendapProfileElementExtractor(conf);
    Map<String, ProfileElement> profElements = new HashMap<String, ProfileElement>();

    for (RewriteSpec spec : conf.getRewriteSpecs()) {
      String peName = spec.getRename() != null && !spec.getRename().equals("") ? spec
          .getRename()
          : spec.getOrigName();
      try {
        if (spec.getElementType().equals(RANGED_ELEMENT_TYPE)) {
          profElements.put(peName, pe.extractRangedProfileElement(peName, spec
              .getOrigName(), profile, dConn.getDAS()));
        } else if (spec.getElementType().equals(ENUM_ELEMENT_TYPE)) {
          profElements.put(peName, pe.extractEnumeratedProfileElement(peName,
              spec.getOrigName(), profile, dConn.getDAS()));
        }
      } catch (Exception e) {
        e.printStackTrace();
        LOG
View Full Code Here

TOP

Related Classes of org.apache.oodt.opendapps.OpendapProfileElementExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.