/*
Get the Report PassCorrelId field from the message header.

Javadoc description supplied by the SIBusMessage interface.
421532
@Override
    public final Boolean getReportPassCorrelId() {
        Boolean value = (Boolean) getApi().getField(JsApiAccess.REPORTPASSCORRELID_VALUE);
        return (value == null) ? Boolean.FALSE : value;
    }
756634
public String getDoi() {
    if (Header_Type.featOkTst && ((Header_Type)jcasType).casFeat_doi == null)
      jcasType.jcas.throwFeatMissing("doi", "de.julielab.jules.types.Header");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Header_Type)jcasType).casFeatCode_doi);}
38305
private String getGatewayMessage(final List<Result> results) throws IOException {
		int valueCount = 0;
		Writer writer = new StringWriter();
		JsonGenerator g = jsonFactory.createGenerator(writer);
		g.writeStartObject();
		g.writeNumberField("timestamp", System.currentTimeMillis() / 1000);
		g.writeNumberField("proto_version", STACKDRIVER_PROTOCOL_VERSION);
		g.writeArrayFieldStart("data");

		List<String> typeNames = this.getTypeNames();

		for (Result metric : results) {
			if (isNumeric(metric.getValue())) {
				// we have a numeric value, write a value into the message

				StringBuilder nameBuilder = new StringBuilder();

				// put the prefix if set
				if (this.prefix != null) {
					nameBuilder.append(prefix);
					nameBuilder.append(".");
				}

				// put the class name or its alias if available
				if (!metric.getKeyAlias().isEmpty()) {
					nameBuilder.append(metric.getKeyAlias());

				} else {
					nameBuilder.append(metric.getClassName());
				}

				// Wildcard "typeNames" substitution
				String typeName = com.googlecode.jmxtrans.model.naming.StringUtils.cleanupStr(
						TypeNameValuesStringBuilder.getDefaultBuilder().build(typeNames, metric.getTypeName()));
				if (typeName != null && typeName.length() > 0) {
					nameBuilder.append(".");
					nameBuilder.append(typeName);
				}

				// add the attribute name
				nameBuilder.append(".");
				nameBuilder.append(KeyUtils.getValueKey(metric));

				// check for Float/Double NaN since these will cause the message validation to fail
				if (metric.getValue() instanceof Float && ((Float) metric.getValue()).isNaN()) {
					logger.info("Metric value for " + nameBuilder.toString() + " is NaN, skipping");
					continue;
				}

				if (metric.getValue() instanceof Double && ((Double) metric.getValue()).isNaN()) {
					logger.info("Metric value for " + nameBuilder.toString() + " is NaN, skipping");
					continue;
				}

				valueCount++;
				g.writeStartObject();

				g.writeStringField("name", nameBuilder.toString());

				g.writeNumberField("value", Double.valueOf(metric.getValue().toString()));

				// if the metric is attached to an instance, include that in the message
				if (instanceId != null && !instanceId.isEmpty()) {
					g.writeStringField("instance", instanceId);
				}
				g.writeNumberField("collected_at", metric.getEpoch() / 1000);
				g.writeEndObject();
			}
		}

		g.writeEndArray();
		g.writeEndObject();
		g.flush();
		g.close();

		// return the message if there are any values to report
		if (valueCount > 0) {
			return writer.toString();
		} else {
			return null;
		}
	}
1185483
public String getSystemMessageId() {
    //based on com.ibm.ws.sib.mfp.impl.JsHdrsImpl
    if (uuid != null) {
      StringBuilder buff = new StringBuilder(uuid.toString());
      buff.append(MfpConstants.MESSAGE_HANDLE_SEPARATOR);
      buff.append(value);
      return new String(buff);
    }
    else {
      return null;
    }
  }
1290884
public void getTraceSummaryLine(StringBuilder buff) {
    
    // Get the common fields for control messages
    super.getTraceSummaryLine(buff);

    buff.append(",requestID=");
    buff.append(getRequestID());
    
    buff.append(",durableSubName=");
    buff.append(getDurableSubName());
    
    buff.append(",durableDiscriminator=");
    buff.append(getDurableDiscriminator());
    
    buff.append(",durableSelector=");
    buff.append(getDurableSelector());
    
    buff.append(",durableSelectorDomain=");
    buff.append(getDurableSelectorDomain());
    
    buff.append(",securityUserid=");
    buff.append(getSecurityUserid());
    
    buff.append(",noLocal=");
    buff.append(isNoLocal());
    
    buff.append(",cloned=");
    buff.append(isCloned());
    
    buff.append(",durableSelectorNamespaceMap=");
    buff.append(getDurableSelectorNamespaceMap());
    
  }
436353
private int getNumDoc(String docID) {
    if (goneContext != null ) {
      removeDoc(docID);
    }
    for (int i = 0; i < documents.size(); i++) {
      if (documents.get(i).getDocID().equals(docID)) {  //  document exist
        if(!testMode && documents.get(i).getXComponent() == null) {
          XComponent xComponent = OfficeTools.getCurrentComponent(xContext);
          if (xComponent == null) {
            MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
          } else {
            try {
              xComponent.addEventListener(xEventListener);
            } catch (Throwable t) {
              MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
              xComponent = null;
            }
            if(xComponent != null) {
              documents.get(i).setXComponent(xContext, xComponent);
              MessageHandler.printToLogFile("Fixed: XComponent set for Document (ID: " + docID + ")");
            }
          }
        }
        return i;
      }
    }
    //  Add new document
    XComponent xComponent = null;
    if (!testMode) {              //  xComponent == null for test cases 
      xComponent = OfficeTools.getCurrentComponent(xContext);
      if (xComponent == null) {
        MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
      } else {
        try {
          xComponent.addEventListener(xEventListener);
        } catch (Throwable t) {
          MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
          xComponent = null;
        }
      }
    }
    documents.add(new SingleDocument(xContext, config, docID, xComponent));
    setMenuTextForSwitchOff(xContext);
    if (debugMode) {
      MessageHandler.printToLogFile("Document " + docNum + " created; docID = " + docID);
    }
    return documents.size() - 1;
  }
1335381
@FFDCIgnore({Throwable.class})
    private static Method getJAXRSGetCurrentMessageMethod() {
        Method m;
        try {
            Class<?> jaxrsUtilsClass = Class.forName("org.apache.cxf.jaxrs.utils.JAXRSUtils");
            m = ReflectionUtil.getDeclaredMethod(jaxrsUtilsClass, "getCurrentMessage");
        } catch (Throwable t) {
            // expected in non-JAX-RS server environments
            if (LOG.isLoggable(Level.FINEST)) {
                LOG.log(Level.FINEST, "Caught exception getting JAXRUtils class", t);
            }
            m = null;
        }
        return m;
    }
34157
@Override
    public final byte[] getApiMessageIdAsBytes() {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getApiMessageIdAsBytes");

        byte[] value = (byte[]) getApi().getField(JsApiAccess.MESSAGEID);
        if (value != null) {
            byte[] copy = new byte[value.length];
            System.arraycopy(value, 0, copy, 0, value.length);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "getApiMessageIdAsBytes", copy);
            return copy;
        }
        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "getApiMessageIdAsBytes", null);
            return null;
        }
    }
532914
public String getFieldSig() {
        if (!visitingField) {
            throw new IllegalStateException("getFieldSig called while not visiting field");
        }
        if (fieldSig == null) {
            fieldSig = getStringFromIndex(field.getSignatureIndex());
        }
        return fieldSig;
    }
381620
@Override
    public DocumentData getTRDocumentInfo(String trId, DocumentType type, String documentId) throws ServiceException {
        if (trId == null || trId.isEmpty()) {
            throw new IllegalArgumentException("Non-empty trId must be specified.");
        }
        if (documentId == null || documentId.isEmpty()) {
            throw new IllegalArgumentException("Non-empty documentId must be specified.");
        }

        GetDocumentInfoResponse resp = invokeApiJson(
                "GET",
                escapePathSegment(account.getInstanceId()) + "/v2/doc-trs/"
                    + escapePathSegment(trId) + "/" + type.toString().toLowerCase() + "/" + escapePathSegment(documentId),
                null,
                GetDocumentInfoResponse.class);

        if (resp.getStatus() == Status.ERROR) {
            throw new ServiceException(resp.getMessage());
        }

        return new DocumentDataImpl(resp.documentData);
    }
1310173
public static int getFieldID(FieldType type)
   {
      int result;
      switch (type.getFieldTypeClass())
      {
         case TASK:
         {
            result = MPPTaskField.TASK_FIELD_BASE | MPPTaskField.getID((TaskField) type);
            break;
         }

         case RESOURCE:
         {
            result = MPPResourceField.RESOURCE_FIELD_BASE | MPPResourceField.getID((ResourceField) type);
            break;
         }

         case ASSIGNMENT:
         {
            result = MPPAssignmentField.ASSIGNMENT_FIELD_BASE | MPPAssignmentField.getID((AssignmentField) type);
            break;
         }

         default:
         {
            result = -1;
         }

      }
      return result;
   }
1223826
protected String getId(FaceletContext ctx)
    {
        if (this._id != null)
        {
            return this._id.getValue(ctx);
        }
        return ctx.generateUniqueId(_delegate.getTagId());
    }
775002
function _determineReportId(ledCount)
{
    var reportId = 9;
    var maxLeds = 64;

    if (ledCount < 8 * 3) {
        reportId = 6;
        maxLeds = 8;
    } else if (ledCount < 16 * 3) {
        reportId = 7;
        maxLeds = 16;
    } else if (ledCount < 32 * 3) {
        reportId = 8;
        maxLeds = 32;
    }

    return { 'reportId': reportId, 'maxLeds': maxLeds };
}
139561
public String getDocid() {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_docid == null)
      jcasType.jcas.throwFeatMissing("docid", "de.julielab.jules.types.ace.Document");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Document_Type)jcasType).casFeatCode_docid);}
802310
public com.google.protobuf.ByteString
      getReportCallBytes() {
    java.lang.Object ref = reportCall_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      reportCall_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1191950
int getChoiceField(int accessor) {
    int result = 0;
    try {
      if (jmfPart.isPresent(accessor))
        result = jmfPart.getInt(accessor);
    } catch (JMFException e) {
      FFDCFilter.processException(e, "getChoiceField", "185", this);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "getChoiceField failed: " + e);
    }
    return result;
  }
149287
public final String getApiMessageId() {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getApiMessageId");

        String value = null;

        /* The ApiMessageId is held as hexBinary & so we need to convert to an */
        /* ID:xxxx format. */
        byte[] binValue = (byte[]) getApi().getField(JsApiAccess.MESSAGEID);
        if (binValue != null) {
            /* It'll be more economical to get the length right immediately */
            StringBuffer sbuf = new StringBuffer((binValue.length * 2) + 3);

            /* Insert the ID: then add on the binary value as a hex string */
            sbuf.append(ID_STRING);
            HexString.binToHex(binValue, 0, binValue.length, sbuf);

            /* Return the String representation */
            value = sbuf.toString();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getApiMessageId", value);

        return value;
    }