Skip to content

Commit ce6e048

Browse files
authored
dbeaver/pro#11220 datadam refactor tracking service (#18)
* dbeaver/pro#11220: moved server-side impl * dbeaver/pro#11220: fix tracking times
1 parent 2578cca commit ce6e048

6 files changed

Lines changed: 147 additions & 1 deletion

File tree

‎apis/com.dbeaver.datadam.share.api/META-INF/MANIFEST.MF‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Bundle-Version: 0.0.17.qualifier
77
Bundle-RequiredExecutionEnvironment: JavaSE-21
88
Export-Package: com.dbeaver.datadam.share.api.exception,
99
com.dbeaver.datadam.share.api.model,
10-
com.dbeaver.datadam.share.api.service,
10+
com.dbeaver.datadam.share.api.service,
11+
com.dbeaver.datadam.share.api.tracking,
1112
com.dbeaver.datadam.share.api.utils
1213
Bundle-ActivationPolicy: lazy
1314
Require-Bundle: org.jkiss.utils
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2026 DBeaver Corp
4+
*
5+
* All Rights Reserved.
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of DBeaver Corp and its suppliers, if any.
9+
* The intellectual and technical concepts contained
10+
* herein are proprietary to DBeaver Corp and its suppliers
11+
* and may be covered by U.S. and Foreign Patents,
12+
* patents in process, and are protected by trade secret or copyright law.
13+
* Dissemination of this information or reproduction of this material
14+
* is strictly forbidden unless prior written permission is obtained
15+
* from DBeaver Corp.
16+
*/
17+
package com.dbeaver.datadam.share.api.tracking;
18+
19+
import org.jkiss.code.NotNull;
20+
import org.jkiss.code.Nullable;
21+
22+
public record DDClientInfo(
23+
@NotNull String clientId,
24+
@Nullable String workspaceId,
25+
@Nullable String product,
26+
@Nullable String version,
27+
@Nullable String os,
28+
@Nullable String osVersion,
29+
@Nullable String macAddress,
30+
@Nullable String ipAddress
31+
) {
32+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2026 DBeaver Corp
4+
*
5+
* All Rights Reserved.
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of DBeaver Corp and its suppliers, if any.
9+
* The intellectual and technical concepts contained
10+
* herein are proprietary to DBeaver Corp and its suppliers
11+
* and may be covered by U.S. and Foreign Patents,
12+
* patents in process, and are protected by trade secret or copyright law.
13+
* Dissemination of this information or reproduction of this material
14+
* is strictly forbidden unless prior written permission is obtained
15+
* from DBeaver Corp.
16+
*/
17+
package com.dbeaver.datadam.share.api.tracking;
18+
19+
import org.jkiss.code.NotNull;
20+
import org.jkiss.code.Nullable;
21+
22+
public record DDTracking(
23+
@NotNull String trackingId,
24+
boolean online,
25+
@NotNull String startTime,
26+
@Nullable String stopTime
27+
) {
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2026 DBeaver Corp
4+
*
5+
* All Rights Reserved.
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of DBeaver Corp and its suppliers, if any.
9+
* The intellectual and technical concepts contained
10+
* herein are proprietary to DBeaver Corp and its suppliers
11+
* and may be covered by U.S. and Foreign Patents,
12+
* patents in process, and are protected by trade secret or copyright law.
13+
* Dissemination of this information or reproduction of this material
14+
* is strictly forbidden unless prior written permission is obtained
15+
* from DBeaver Corp.
16+
*/
17+
package com.dbeaver.datadam.share.api.tracking;
18+
19+
public final class DDTrackingEndpoints {
20+
public static final String TRACKING = "/tracking/track";
21+
public static final String METERING = "/metering/track";
22+
public static final String START = "/start";
23+
public static final String STOP = "/{trackingId}/stop";
24+
25+
private DDTrackingEndpoints() {
26+
}
27+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2026 DBeaver Corp
4+
*
5+
* All Rights Reserved.
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of DBeaver Corp and its suppliers, if any.
9+
* The intellectual and technical concepts contained
10+
* herein are proprietary to DBeaver Corp and its suppliers
11+
* and may be covered by U.S. and Foreign Patents,
12+
* patents in process, and are protected by trade secret or copyright law.
13+
* Dissemination of this information or reproduction of this material
14+
* is strictly forbidden unless prior written permission is obtained
15+
* from DBeaver Corp.
16+
*/
17+
package com.dbeaver.datadam.share.api.tracking;
18+
19+
import org.jkiss.dbeaver.DBException;
20+
21+
public class DDTrackingNotFoundException extends DBException {
22+
23+
public DDTrackingNotFoundException() {
24+
super("Tracking session not found");
25+
}
26+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2026 DBeaver Corp
4+
*
5+
* All Rights Reserved.
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of DBeaver Corp and its suppliers, if any.
9+
* The intellectual and technical concepts contained
10+
* herein are proprietary to DBeaver Corp and its suppliers
11+
* and may be covered by U.S. and Foreign Patents,
12+
* patents in process, and are protected by trade secret or copyright law.
13+
* Dissemination of this information or reproduction of this material
14+
* is strictly forbidden unless prior written permission is obtained
15+
* from DBeaver Corp.
16+
*/
17+
package com.dbeaver.datadam.share.api.tracking;
18+
19+
import org.jkiss.code.NotNull;
20+
import org.jkiss.dbeaver.DBException;
21+
22+
/**
23+
* Client tracking operations.
24+
*/
25+
public interface DDTrackingService {
26+
27+
@NotNull
28+
DDTracking start(@NotNull DDClientInfo client) throws DBException;
29+
30+
@NotNull
31+
DDTracking stop(@NotNull String trackingId) throws DBException;
32+
}

0 commit comments

Comments
 (0)