@sap/opentelemetry-exporter-for-sap-cloud-logging
Version:
A set of auto-configured OpenTelemetry exporters for SAP Cloud Logging
75 lines • 2.76 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Application = void 0;
class Application {
constructor() { }
static parse(data) {
let app = new Application();
app.applicationName = data[Application.FIELD_APPLICATION_NAME];
app.applicationID = data[Application.FIELD_APPLICATION_ID];
app.applicationURIs = data[Application.FIELD_APPLICATION_URIS];
app.name = data[Application.FIELD_NAME];
app.uris = data[Application.FIELD_URIS];
app.instanceIndex = parseInt(data[Application.FIELD_INSTANCE_INDEX]);
app.spaceName = data[Application.FIELD_SPACE_NAME];
app.spaceID = data[Application.FIELD_SPACE_ID];
app.organizationName = data[Application.FIELD_ORGANIZATION_NAME];
app.organizationID = data[Application.FIELD_ORGANIZATION_ID];
app.processID = data[Application.FIELD_PROCESS_ID];
app.processType = data[Application.FIELD_PROCESS_TYPE];
return app;
}
getApplicationName() {
return this.getStringOrEmpty(this.applicationName);
}
getApplicationID() {
return this.getStringOrEmpty(this.applicationID);
}
getApplicationURIs() {
return this.applicationURIs ? this.applicationURIs : [];
}
getName() {
return this.getStringOrEmpty(this.name);
}
getURIs() {
return this.uris ? this.uris : [];
}
getInstanceIndex() {
return !isNaN(this.instanceIndex) ? this.instanceIndex : -1;
}
getSpaceName() {
return this.getStringOrEmpty(this.spaceName);
}
getSpaceID() {
return this.getStringOrEmpty(this.spaceID);
}
getOrganizationName() {
return this.getStringOrEmpty(this.organizationName);
}
getOrganizationID() {
return this.getStringOrEmpty(this.organizationID);
}
getProcessID() {
return this.getStringOrEmpty(this.processID);
}
getProcessType() {
return this.getStringOrEmpty(this.processType);
}
getStringOrEmpty(value) {
return value ? value : "";
}
}
exports.Application = Application;
Application.FIELD_APPLICATION_NAME = "application_name";
Application.FIELD_APPLICATION_ID = "application_id";
Application.FIELD_APPLICATION_URIS = "application_uris";
Application.FIELD_NAME = "name";
Application.FIELD_URIS = "uris";
Application.FIELD_SPACE_NAME = "space_name";
Application.FIELD_SPACE_ID = "space_id";
Application.FIELD_ORGANIZATION_NAME = "organization_name";
Application.FIELD_ORGANIZATION_ID = "organization_id";
Application.FIELD_INSTANCE_INDEX = "instance_index";
Application.FIELD_PROCESS_ID = "process_id";
Application.FIELD_PROCESS_TYPE = "process_type";
//# sourceMappingURL=application.js.map