Package com.bloomberglp.blpapi

Examples of com.bloomberglp.blpapi.Element.numValues()


          }
          throw new OpenGammaRuntimeException("Unable to get a Bloomberg response for " + fields + " fields for " + securityKeys + ": " + responseError);
        }
       
        Element securityDataArray = resultElem.getElement(SECURITY_DATA);
        int numSecurities = securityDataArray.numValues();
        for (int iSecurityElem = 0; iSecurityElem < numSecurities; iSecurityElem++) {
          Element securityElem = securityDataArray.getValueAsElement(iSecurityElem);
          String securityKey = securityElem.getElementAsString(SECURITY);
          ReferenceData refData = new ReferenceData(securityKey);
          if (securityElem.hasElement(SECURITY_ERROR)) {
View Full Code Here


      if (msg.hasElement(EXCEPTIONS)) {
        // This can occur on SubscriptionStarted if at least
        // one field is good while the rest are bad.
        Element exceptions = msg.getElement(EXCEPTIONS);
        for (int i = 0; i < exceptions.numValues(); ++i) {
          Element exInfo = exceptions.getValueAsElement(i);
          Element fieldId = exInfo.getElement(FIELD_ID);
          Element reason = exInfo.getElement(REASON);
          s_logger.warn("{}: security={} field={} category={}",
              new Object[]{_dateFormat.format(Calendar.getInstance().getTime()), topic, fieldId.getValueAsString(), reason.getElement(CATEGORY).getValueAsString()});
View Full Code Here

          extractError(securityElem.getElement(SECURITY_ERROR));
        }
        if (securityElem.hasElement(FIELD_EXCEPTIONS)) {
          Element fieldExceptions = securityElem.getElement(FIELD_EXCEPTIONS);

          for (int i = 0; i < fieldExceptions.numValues(); i++) {
            Element fieldException = fieldExceptions.getValueAsElement(i);
            String fieldId = fieldException.getElementAsString(FIELD_ID);
            s_logger.warn("Field error on {}", fieldId);
            Element errorInfo = fieldException.getElement(ERROR_INFO);
            extractError(errorInfo);
View Full Code Here

  public static FudgeMsg parseElement(final Element element) {
    final MutableFudgeMsg fieldData = FudgeContext.GLOBAL_DEFAULT.newMessage();
    for (int iSubElement = 0; iSubElement < element.numElements(); iSubElement++) {
      final Element subElement = element.getElement(iSubElement);
      if (subElement.numValues() == 0) {
        continue;
      }
      final String name = subElement.elementDefinition().name().toString();
      final Object value = parseValue(subElement);
      if (value instanceof List<?>) {
View Full Code Here

        bld = ImmutableLocalDateDoubleTimeSeries.builder();
        result.put(identifiers, bld);
      }
      Element fieldDataArray = securityElem.getElement(FIELD_DATA);

      int numValues = fieldDataArray.numValues();
      for (int i = 0; i < numValues; i++) {
        Element fieldData = fieldDataArray.getValueAsElement(i);
        Datetime date = fieldData.getElementAsDate("date");
        LocalDate ldate = LocalDate.of(date.year(), date.month(), date.dayOfMonth());
        double lastPrice = fieldData.getElementAsFloat64(field);
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.