All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dynatrace.oneagent.sdk.impl.noop.OneAgentSDKNoop Maven / Gradle / Ivy

Go to download

Dynatrace OneAgent SDK for Java allows Dynatrace customers to instrument java applications, not supported out-of-the-box by Dynatrace OneAgent for Java.

There is a newer version: 1.9.0
Show newest version
/*
 * Copyright 2018 Dynatrace LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.dynatrace.oneagent.sdk.impl.noop;

import com.dynatrace.oneagent.sdk.api.InProcessLink;
import com.dynatrace.oneagent.sdk.api.InProcessLinkTracer;
import com.dynatrace.oneagent.sdk.api.IncomingRemoteCallTracer;
import com.dynatrace.oneagent.sdk.api.IncomingWebRequestTracer;
import com.dynatrace.oneagent.sdk.api.LoggingCallback;
import com.dynatrace.oneagent.sdk.api.OneAgentSDK;
import com.dynatrace.oneagent.sdk.api.OutgoingRemoteCallTracer;
import com.dynatrace.oneagent.sdk.api.OutgoingWebRequestTracer;
import com.dynatrace.oneagent.sdk.api.enums.SDKState;
import com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo;
import com.dynatrace.oneagent.sdk.api.enums.ChannelType;

/**
 * This class provides an empty (NOOP) implementation of the {@link OneAgentSDK}
 * interface.
 *
 * @author Alram.Lechner
 *
 */
public class OneAgentSDKNoop implements OneAgentSDK {

	// ***** Webrequests (incoming) *****
	@Override
	public WebApplicationInfo createWebApplicationInfo(String webServerName, String applicationID, String contextRoot) {
		return WebApplicationInfoNoop.INSTANCE;
	}

	@Override
	public IncomingWebRequestTracer traceIncomingWebRequest(WebApplicationInfo webApplicationInfo, String url,
			String method) {
		return IncomingWebRequestTracerNoop.INSTANCE;
	}

	// ***** Remote Calls (outgoing & incoming) *****
	@Override
	public IncomingRemoteCallTracer traceIncomingRemoteCall(String remoteMethod, String remoteService,
			String clientEndpoint) {
		return RemoteCallServerTracerNoop.INSTANCE;
	}

	@Override
	public OutgoingRemoteCallTracer traceOutgoingRemoteCall(String remoteMethod, String remoteService,
			String serviceEndpoint, ChannelType channelType, String channelEndpoint) {
		return RemoteCallClientTracerNoop.INSTANCE;
	}

	// ***** Common *****

	@Override
	public void setLoggingCallback(LoggingCallback loggingCallback) {
	}

	@Override
	public SDKState getCurrentState() {
		return SDKState.PERMANENTLY_INACTIVE;
	}

	@Override
	public InProcessLink createInProcessLink() {
		return InProcessLinkNoop.INSTANCE;
	}

	@Override
	public InProcessLinkTracer traceInProcessLink(InProcessLink inProcessLink) {
		return InProcessLinkTracerNoop.INSTANCE;
	}

	@Override
	public void addCustomRequestAttribute(String key, String value) {
	}

	@Override
	public void addCustomRequestAttribute(String key, long value) {
	}

	@Override
	public void addCustomRequestAttribute(String key, double value) {
	}

	@Override
	public OutgoingWebRequestTracer traceOutgoingWebRequest(String url, String method) {
		return OutgoingWebRequestTracerNoop.INSTANCE;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy