Skip to content

Commit 786e7b2

Browse files
fix/missing java docs
1 parent ad9cd7c commit 786e7b2

22 files changed

Lines changed: 333 additions & 56 deletions

.idea/workspace.xml

Lines changed: 50 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

traceo-sdk-core/src/main/java/com/traceo/sdk/DefaultRequest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,32 @@
66
import java.util.HashMap;
77
import java.util.Map;
88

9+
/**
10+
* Default implementation of the {@link com.traceo.sdk.http.IRequest} interface.
11+
* This class should be used only for internal SDK operations.
12+
* @param <T> Content type class defined what should be sent in request.
13+
*/
914
public class DefaultRequest<T> implements IRequest<T> {
1015

16+
/**
17+
* Payload which should be sent in request.
18+
*/
1119
private T content;
1220

21+
/**
22+
* Headers which should be included in request.
23+
*/
1324
private Map<String, String> headers = new HashMap<>();
1425

26+
/**
27+
* {@link com.traceo.sdk.http.HttpMethod} for request.
28+
*/
1529
private HttpMethod httpMethod = HttpMethod.POST;
1630

31+
/**
32+
* Path used to build full URI which is needed for request.
33+
* URI is created with using provided host in {@link com.traceo.sdk.builder.ClientCoreConfiguration} concatenated with this value.
34+
*/
1735
private String endpoint;
1836

1937
public DefaultRequest() {}

traceo-sdk-core/src/main/java/com/traceo/sdk/TraceoIncident.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,33 @@
44
import java.util.List;
55

66
public class TraceoIncident {
7+
/**
8+
* Name of the captured incident. In case of this SDK
9+
* name is defined by class name of the occured exception
10+
* eq. java.lang.NullPointerException.
11+
*/
712
private String name;
813

14+
/**
15+
* Name of the captured incident. In case of this SDK
16+
* name is defined by class name of the occured exception
17+
* eq. java.lang.NullPointerException.
18+
*/
919
private String message;
1020

21+
/**
22+
* Full stacktrace of the captured exception.
23+
*/
1124
private String stack;
1225

26+
/**
27+
* Information about runtime platform on which exception has been catched.
28+
*/
1329
private TraceoRuntimePlatform platform = new TraceoRuntimePlatform();
1430

31+
/**
32+
* List of objects contains information about each trace included in stacktrace.
33+
*/
1534
private List<TraceoTrace> traces = new ArrayList<>();
1635

1736
public TraceoIncident() {}

traceo-sdk-core/src/main/java/com/traceo/sdk/TraceoRuntimePlatform.java

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,83 @@
11
package com.traceo.sdk;
22

3+
/**
4+
* Runtime platform information on which SDk is running.
5+
*/
36
public class TraceoRuntimePlatform {
47
private String arch;
58

6-
private String platform;
9+
private String name;
710

811
private String release;
912

13+
private String jvmName;
14+
15+
private String jvmVersion;
16+
17+
private String javaVersion;
18+
19+
private String javaVendor;
20+
1021
public TraceoRuntimePlatform() {
11-
this(System.getProperty("os.arch"), System.getProperty("os.name"), System.getProperty("os.release"));
22+
this(
23+
System.getProperty("os.arch"),
24+
System.getProperty("os.name"),
25+
System.getProperty("os.release"),
26+
System.getProperty("java.vm.name"),
27+
System.getProperty("java.vm.version"),
28+
System.getProperty("java.version"),
29+
System.getProperty("java.vendor")
30+
);
1231
}
1332

14-
public TraceoRuntimePlatform(String arch, String name, String release) {
33+
public TraceoRuntimePlatform(String arch, String name, String release, String jvmName, String jvmVersion, String javaVersion, String javaVendor) {
1534
this.arch = arch;
16-
this.platform = name;
35+
this.name = name;
1736
this.release = release;
37+
this.jvmName = jvmName;
38+
this.jvmVersion = jvmVersion;
39+
this.javaVersion = javaVersion;
40+
this.javaVendor = javaVendor;
41+
}
42+
43+
public String getName() {
44+
return name;
45+
}
46+
47+
public void setName(String name) {
48+
this.name = name;
49+
}
50+
51+
public String getJvmName() {
52+
return jvmName;
53+
}
54+
55+
public void setJvmName(String jvmName) {
56+
this.jvmName = jvmName;
57+
}
58+
59+
public String getJvmVersion() {
60+
return jvmVersion;
61+
}
62+
63+
public void setJvmVersion(String jvmVersion) {
64+
this.jvmVersion = jvmVersion;
65+
}
66+
67+
public String getJavaVersion() {
68+
return javaVersion;
69+
}
70+
71+
public void setJavaVersion(String javaVersion) {
72+
this.javaVersion = javaVersion;
73+
}
74+
75+
public String getJavaVendor() {
76+
return javaVendor;
77+
}
78+
79+
public void setJavaVendor(String javaVendor) {
80+
this.javaVendor = javaVendor;
1881
}
1982

2083
public String getArch() {
@@ -26,11 +89,11 @@ public void setArch(String arch) {
2689
}
2790

2891
public String getPlatform() {
29-
return platform;
92+
return name;
3093
}
3194

3295
public void setPlatform(String platform) {
33-
this.platform = platform;
96+
this.name = platform;
3497
}
3598

3699
public String getRelease() {

traceo-sdk-core/src/main/java/com/traceo/sdk/TraceoTrace.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,57 @@
11
package com.traceo.sdk;
22

3+
/**
4+
* An item creating after parsing each trace from the stacktrace.
5+
*/
36
public class TraceoTrace {
7+
/**
8+
* Filename in which exception occur in this trace.
9+
*/
410
private String filename;
511

12+
/**
13+
* Function name in which exception occur in this trace.
14+
*/
615
private String function;
716

17+
/**
18+
* Line number in which exception occur in file for this trace.
19+
*/
820
private int lineNo;
921

22+
/**
23+
* Column number in which exception occur in file for this trace.
24+
*/
1025
private int columnNo;
1126

27+
/**
28+
* Specifies whether the exception occurred inside the owner's code or in an external library.
29+
*/
1230
private boolean isInternal;
1331

32+
/**
33+
* Absolute path to the file with exception.
34+
*/
1435
private String absPath;
1536

37+
/**
38+
* File extension.
39+
*/
1640
private String extension;
1741

42+
/**
43+
* Code context for the single line in which exception occur in this file.
44+
*/
1845
private String code;
1946

47+
/**
48+
* Code context for the five lines before exception line.
49+
*/
2050
private String[] preCode;
2151

52+
/**
53+
* Code context for the five lines after exception line.
54+
*/
2255
private String[] postCode;
2356

2457
public String getFilename() {

traceo-sdk-core/src/main/java/com/traceo/sdk/builder/ClientCoreConfiguration.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
package com.traceo.sdk.builder;
22

3+
/**
4+
* Base client configuration class.
5+
*/
36
public class ClientCoreConfiguration {
47

8+
/**
9+
* Api key generated in Traceo project.
10+
*/
511
private String apiKey = null;
612

13+
/**
14+
* The host on which the Traceo instance is running.
15+
* Host should be in format: [protocol]://[domain]:[port]
16+
*/
717
private String host = null;
818

19+
/**
20+
* Specifies whether the SDK should be launched. If not then it will not collect any information.
21+
* After changing the settings, it is necessary to restart the entire application.
22+
*/
923
private boolean isEnabled = true;
1024

25+
/**
26+
* Specifies if SDK should display internal logs.
27+
*/
1128
private boolean isDebug = false;
1229

1330
public ClientCoreConfiguration() {}

0 commit comments

Comments
 (0)