Skip to content

Commit c983ede

Browse files
committed
Adding OpampClient.setAgentDescription
1 parent 1fbd155 commit c983ede

File tree

1 file changed

+19
-8
lines changed
  • opamp-client/src/main/java/io/opentelemetry/opamp/client/internal

1 file changed

+19
-8
lines changed

opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/OpampClient.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,23 @@ public interface OpampClient {
2727
void start(Callbacks callbacks);
2828

2929
/**
30-
* Stops the client. May be called only after {@link #start(Callbacks)}. May be called
31-
* only once. After this call returns successfully it is guaranteed that no callbacks will be
32-
* called. Once stopped, the client cannot be started again.
30+
* Stops the client. May be called only after {@link #start(Callbacks)}. May be called only once.
31+
* After this call returns successfully it is guaranteed that no callbacks will be called. Once
32+
* stopped, the client cannot be started again.
3333
*/
3434
void stop();
3535

36+
/**
37+
* Sets attributes of the Agent. The attributes will be included in the next status report sent to
38+
* the Server. When called after {@link #start(Callbacks)}, the attributes will be included in the
39+
* next outgoing status report. This is typically used by Agents which allow their
40+
* AgentDescription to change dynamically while the OpAMPClient is started. May be also called
41+
* from OnMessage handler.
42+
*
43+
* @param agentDescription The new agent description.
44+
*/
45+
void setAgentDescription(Opamp.AgentDescription agentDescription);
46+
3647
/**
3748
* Sets the current remote config status which will be sent in the next agent to server request.
3849
*
@@ -50,18 +61,18 @@ public interface OpampClient {
5061
interface Callbacks {
5162
/**
5263
* Called when the connection is successfully established to the Server. May be called after
53-
* {@link #start(Callbacks)} is called and every time a connection is established to
54-
* the Server. For WebSocket clients this is called after the handshake is completed without any
55-
* error. For HTTP clients this is called for any request if the response status is OK.
64+
* {@link #start(Callbacks)} is called and every time a connection is established to the Server.
65+
* For WebSocket clients this is called after the handshake is completed without any error. For
66+
* HTTP clients this is called for any request if the response status is OK.
5667
*
5768
* @param client The relevant {@link OpampClient} instance.
5869
*/
5970
void onConnect(OpampClient client);
6071

6172
/**
6273
* Called when the connection to the Server cannot be established. May be called after {@link
63-
* #start(Callbacks)} is called and tries to connect to the Server. May also be
64-
* called if the connection is lost and reconnection attempt fails.
74+
* #start(Callbacks)} is called and tries to connect to the Server. May also be called if the
75+
* connection is lost and reconnection attempt fails.
6576
*
6677
* @param client The relevant {@link OpampClient} instance.
6778
* @param throwable The exception.

0 commit comments

Comments
 (0)