Examples of AttributeTable


Examples of opendap.dap.AttributeTable

      Profile profile, DAS das)
      throws NoSuchAttributeException {
    EnumeratedProfileElement elem = new EnumeratedProfileElement(profile);
    elem.setName(elemName);

    AttributeTable attTable = null;
    try {
      attTable = das.getAttributeTable(elemName);
    } catch (NoSuchAttributeException e) {
      LOG.log(Level.WARNING, "Error extracting attribute table for element: ["
          + elemName + "]: Message: " + e.getMessage());
      throw e;

    }

    Enumeration attributeNames = attTable.getNames();
    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
View Full Code Here

Examples of opendap.dap.AttributeTable

      @SuppressWarnings("unchecked")
      Enumeration<String> names = das.getNames();
      while (names.hasMoreElements()) {
        String attName = names.nextElement();
        LOG.log(Level.FINE, "Extracting DAS attribute: " + attName);
        AttributeTable at = das.getAttributeTable(attName);
        Enumeration<String> e = at.getNames();
       
        // NetCDF global attributes
        // store attribute name, all values for ALL attributes (strings and numerics)
        ProcessingInstructions processingInstructions = config.getProcessingInstructions();
        if (attName.equals(NC_GLOBAL)) {
          while (e.hasMoreElements()) {
            String key = e.nextElement();
            Attribute att = at.getAttribute(key);
            // convert all DAS attribute names to lower case
            String lkey = key.toLowerCase();
           
            // look for global attribute name in date/time configuration specification
            String dateTimeFormatKey = OpendapConfigMetKeys.DATETIME_FORMAT_ATTR + ":" + lkey;
            String dateTimeFormatValue = processingInstructions.getInstructionValue(dateTimeFormatKey);
            // add this attribute as properly formatted date/time
            if (StringUtils.hasText(dateTimeFormatValue)) {
              DateFormat inFormat = new SimpleDateFormat(dateTimeFormatValue);
              Enumeration<String> edt = att.getValues();
              while (edt.hasMoreElements()) {
                String value = edt.nextElement();
                try {
                  Date date = inFormat.parse(value);
                  ProfileUtils.addIfNotNull(metadata, lkey, outputDatetimeFormat.format(date));
                } catch(ParseException pe) {
                  LOG.log(Level.WARNING,
                          "Error parsing date/time from DAS attribute: "+key+" value="+value+" error="+pe.getMessage());
                }
              }
            // add this global attribute as string
            } else {
              ProfileUtils.addIfNotExisting(metadata, lkey, att.getValues());
            }
          }
         
        // NetCDF coordinates
        } else {
         
          if (   attName.equalsIgnoreCase("lat") || attName.equalsIgnoreCase("latitude")
              || attName.equalsIgnoreCase("lon") || attName.equalsIgnoreCase("longitude")
              || attName.equalsIgnoreCase("time")
              || attName.equalsIgnoreCase("alt") || attName.equalsIgnoreCase("altitude")
              || attName.equalsIgnoreCase("lev") || attName.equalsIgnoreCase("level")
              || attName.equalsIgnoreCase("depth")
              ) {
           
            if (!excludedVariables.contains(attName)) {
              // store coordinate name
              ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.COORDINATES, attName);
            }
           
          } else if (attName.toLowerCase().startsWith("time_") || attName.toLowerCase().endsWith("_time")) {
           
            // ignore for now - it's not a coordinate neither a variable you would want to search on
           
          // NetCDF variables
          } else {
           
            if (!excludedVariables.contains(attName)) {
              // store variable name
              ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.VARIABLES, attName);
              // store "standard_name", "long_name"
              while (e.hasMoreElements()) {
                String key = e.nextElement();
                Attribute att = at.getAttribute(key);
                if (key.equalsIgnoreCase(STANDARD_NAME)) {
                  ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.CF_STANDARD_NAMES, att.getValueAt(0));
                } else if (key.equalsIgnoreCase(LONG_NAME)) {
                  ProfileUtils.addIfNotNull(metadata, OpendapProfileMetKeys.VARIABLES_LONG_NAMES, att.getValueAt(0));
                }          
View Full Code Here

Examples of opendap.dap.AttributeTable

  public RangedProfileElement extractRangedProfileElement(String elemName, String varname,
      Profile profile, DAS das) throws NoSuchAttributeException {
    RangedProfileElement elem = new RangedProfileElement(profile);
    elem.setName(elemName);
    AttributeTable attTable = null;
    try {
      attTable = das.getAttributeTable(varname);
     
      // make variable names case insensitive
      if(attTable == null) attTable = das.getAttributeTable(varname.toLowerCase());
      if(attTable == null) attTable = das.getAttributeTable(varname.toUpperCase());
      if(attTable == null) throw new NoSuchAttributeException("Att table for ["+varname+"] is null!");
    } catch (NoSuchAttributeException e) {
      e.printStackTrace();
      LOG.log(Level.WARNING, "Error extracting attribute table for element: ["
          + elemName + "]: Message: " + e.getMessage());
      throw e;

    }

    Enumeration attributeNames = attTable.getNames();

    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
    
      if (!attr.isContainer()) {
         Enumeration attrValues = null;
       
          try {
View Full Code Here

Examples of opendap.dap.AttributeTable

  public RangedProfileElement extractRangedProfileElement(String elemName, String varname,
      Profile profile, DAS das) throws NoSuchAttributeException {
    RangedProfileElement elem = new RangedProfileElement(profile);
    elem.setName(elemName);
    AttributeTable attTable = null;
    try {
      attTable = das.getAttributeTable(varname);
     
      // make variable names case insensitive
      if(attTable == null) attTable = das.getAttributeTable(varname.toLowerCase());
      if(attTable == null) attTable = das.getAttributeTable(varname.toUpperCase());
      if(attTable == null) throw new NoSuchAttributeException("Att table for ["+varname+"] is null!");
    } catch (NoSuchAttributeException e) {
      e.printStackTrace();
      LOG.log(Level.WARNING, "Error extracting attribute table for element: ["
          + elemName + "]: Message: " + e.getMessage());
      throw e;

    }

    Enumeration attributeNames = attTable.getNames();

    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        e.printStackTrace();
View Full Code Here

Examples of opendap.dap.AttributeTable

      Profile profile, DAS das)
      throws NoSuchAttributeException {
    EnumeratedProfileElement elem = new EnumeratedProfileElement(profile);
    elem.setName(elemName);

    AttributeTable attTable = null;
    try {
      attTable = das.getAttributeTable(elemName);
    } catch (NoSuchAttributeException e) {
      LOG.log(Level.WARNING, "Error extracting attribute table for element: ["
          + elemName + "]: Message: " + e.getMessage());
      throw e;

    }

    Enumeration attributeNames = attTable.getNames();
    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
View Full Code Here

Examples of org.bouncycastle.asn1.cms.AttributeTable

     * @return information about SignerInformation
     */
    private SignerInformation signTimeStamp(SignerInformation signer)
            throws IOException, TSPException
    {
        AttributeTable unsignedAttributes = signer.getUnsignedAttributes();

        ASN1EncodableVector vector = new ASN1EncodableVector();
        if (unsignedAttributes != null)
        {
            vector = unsignedAttributes.toASN1EncodableVector();
        }

        byte[] token = tsaClient.getTimeStampToken(signer.getSignature());
        ASN1ObjectIdentifier oid = PKCSObjectIdentifiers.id_aa_signatureTimeStampToken;
        ASN1Encodable signatureTimeStamp = new Attribute(oid, new DERSet(byteToASN1Object(token)));

        vector.add(signatureTimeStamp);
        Attributes signedAttributes = new Attributes(vector);

        SignerInformation newSigner = SignerInformation.replaceUnsignedAttributes(
                signer, new AttributeTable(signedAttributes));

        // TODO can this actually happen?
        if (newSigner == null)
        {
            return signer;
View Full Code Here

Examples of org.bouncycastle.asn1.cms.AttributeTable

            digestEncryptionAlgorithmOid = ((ASN1ObjectIdentifier)((ASN1Sequence)signerInfo.getObjectAt(next++)).getObjectAt(0)).getId();
            digest = ((ASN1OctetString)signerInfo.getObjectAt(next++)).getOctets();
            if (next < signerInfo.size() && signerInfo.getObjectAt(next) instanceof ASN1TaggedObject) {
                ASN1TaggedObject taggedObject = (ASN1TaggedObject) signerInfo.getObjectAt(next);
                ASN1Set unat = ASN1Set.getInstance(taggedObject, false);
                AttributeTable attble = new AttributeTable(unat);
                Attribute ts = attble.get(PKCSObjectIdentifiers.id_aa_signatureTimeStampToken);
                if (ts != null && ts.getAttrValues().size() > 0) {
                    ASN1Set attributeValues = ts.getAttrValues();
                    ASN1Sequence tokenSequence = ASN1Sequence.getInstance(attributeValues.getObjectAt(0));
                    ContentInfo contentInfo = new ContentInfo(tokenSequence);
                    this.timeStampToken = new TimeStampToken(contentInfo);
View Full Code Here

Examples of org.bouncycastle.asn1.cms.AttributeTable

                attributes.put(attr.getAttrType(), attr);
            }

            // Add our signer info and sign the message
            log.debug("Signing SCEP message with cert: "+CertTools.getSubjectDN(signCert));
            gen1.addSigner(signKey, (X509Certificate)signCert, digestAlg, new AttributeTable(attributes), null);
            signedData = gen1.generate(msg, true, provider);
            responseMessage = signedData.getEncoded();
            if (responseMessage != null) {
                ret = true;
            }
View Full Code Here

Examples of org.bouncycastle.asn1.cms.AttributeTable

          log.error("PKCS10 not inited!");
          return ret;
        }
        // Get attributes
        CertificationRequestInfo info = pkcs10.getCertificationRequestInfo();
        AttributeTable attributes = new AttributeTable(info.getAttributes());
        if (attributes == null) {
            return ret;
        }
        Attribute attr = attributes.get(new DERObjectIdentifier(szOID_REQUEST_CLIENT_INFO));
        if (attr == null) {
                return ret;               
        } else {
            ASN1Set values = attr.getAttrValues();
            if (values.size() == 0) {
View Full Code Here

Examples of org.bouncycastle.asn1.cms.AttributeTable

        log.error("PKCS10 not inited!");
        return null;
      }
        // Get attributes
        CertificationRequestInfo info = pkcs10.getCertificationRequestInfo();
        AttributeTable attributes = new AttributeTable(info.getAttributes());
        if (attributes == null) {
          log.error("No attributes!");
            return null;
        }
        Attribute attr = attributes.get(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest);
        if (attr == null) {
          log.error("Cannot find request extension.");
          return null;
        }
        ASN1Set set = attr.getAttrValues();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.