Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
feat: add annotation to mark outgoing http(s) traffic (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
kayman-mk authored May 2, 2022
1 parent d196d04 commit 1a74d10
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@
</build>

<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.hlag.tools.commvis.analyzer.annotation;

import javax.ws.rs.HttpMethod;
import java.lang.annotation.*;

/**
* Annotated on methods to indicate that an HTTP(S) call is done. Based on this information projects communicating
* with each other can be visualized.
*
* The destination endpoint is matched on projectId, method and path. The names of the path parameters do not have to
* match.
*
* @see VisualizeHttpsCalls
*/
@Repeatable(VisualizeHttpsCalls.class)
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface VisualizeHttpsCall {
/**
* @return the method used to call path.
*/
HttpMethod method();

/**
* @return the path called, e.g. "/customer/{id}"
*/
String path();

/**
* @return the project called
*/
String projectId();

/**
* @return the name of the project called. Just for a better visibility in the code. The value isn't used.
*/
String projectName() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.hlag.tools.commvis.analyzer.annotation;

import java.lang.annotation.*;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface VisualizeHttpsCalls {
VisualizeHttpsCall[] value();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.hlag.tools.commvis.analyzer.service;

import com.hlag.tools.commvis.analyzer.annotation.VisualizeHttpsCall;
import com.hlag.tools.commvis.analyzer.model.ISenderReceiverCommunication;

import java.util.Collection;
Expand Down

0 comments on commit 1a74d10

Please sign in to comment.