Library providing wrappers for working with Dynatrace Client Codelink API from Java code
Switch branches/tags
Nothing to show
Clone or download
Michal.Weyer
Michal.Weyer Error messages for codelink polling no longer repeat infinitely if th…
…e message doesn't change.
Latest commit 133c929 Mar 3, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img
src
.gitignore
.travis.yml
LICENSE
README.md
pom.xml

README.md

Dynatrace CodeLink Wrapper Build Status

This library provides an easy to use Java implementation of Dynatrace Client's CodeLink feature.

Table of Contents

What is CodeLink?

The ability to navigate from Dynatrace AppMon Client to code in your favorite IDE with Dynatrace plugin. E.g. this is available in the PurePaths view, from the PurePath Tree section: after right-clicking on a message call, selecting Source Lookup / Open in IDE.

Source lookup

IDEs currently supporting CodeLink

Usage

Installation

Manual installation is currently required, maven repository might be available in the future. The wrapper comes with Apache's HttpComponents shaded inside, thus you don't have to worry about library dependencies.

Maven

  • Download the latest artifact from Releases
  • Put the artifact and pom.xml under /repo/com/dynatrace/codelink/codelink-wrapper/0.0.1
  • Add the following code to the <repositories> section:
<repository>
    <id>local-repo</id>
    <releases>
        <enabled>true</enabled>
        <checksumPolicy>ignore</checksumPolicy>
    </releases>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <url>file://${project.basedir}/repo</url>
</repository>
  • Add the following code to the <dependencies> section:
<dependency>
    <groupId>com.dynatrace.codelink</groupId>
    <artifactId>codelink-wrapper</artifactId>
    <version>0.0.1</version>
</dependency>

Gradle

  • Download the latest artifact from Releases
  • Put the artifact under /lib
  • Put the following code in your dependencies block:
compile fileTree(dir: 'lib', include: '*.jar')

Integrating an IDE with CodeLink using this library

CodeLink-Wrapper exposes three interfaces which have to be implemented:

The typical use-case looks as following:

CodeLinkClient client = new CodeLinkClient(new YourCodeLinkSettings(), new YourIDEDescriptor(), new YourProjectDescriptor());
client.startPolling(CodeLinkClient.DEFAULT_INTERVAL, CodeLinkClient.DEFAULT_UNIT);

Incoming lookup requests will call a jumpToClass method in ProjectDescriptor, that's where one has to implement the jumping logic.

One thing to keep in mind is the format of className inside CodeLinkLookupResponse. It follows the OuterClass$InnerClass$InnerClass format. Typically you will have to split the string on $ in order to search for classes.

The getId() method in IDEDescriptor returns the ID associated with an IDE.

The ID which the function returns needs to be registered on the Dynatrace Client side. To do that, you have to contact Dynatrace directly.

You can use ECLIPSE Id: 0 IDEDescriptor.ECLIPSE_ID until the IDE you are writing the implementation for is registered.