Creating agents by using SDK
Implement an agent by using the managed sample from the agent-sdk-version-with-implementation-samples compressed file in Visual Studio Code editor.
Before you begin
- Extracted the agent-sdk-version-with-implementation-samples compressed file to your preferred location.
- Installed the Java™ plug-in for Visual Studio Code editor.
- Verified whether the runtime and federated API management for which you want to establish connectivity by using the agent are up and running. This step is crucial for registering the runtime with federated API management.
- Created the runtime type in federated API management for your third-party runtime.
- The REST APIs to retrieve the heartbeats(status), APIs, and metrics from the runtime. However,
if the runtime lacks a direct REST API for accessing the heartbeats, APIs, and metrics, use
alternative endpoints to retrieve the same. Make sure that these REST APIs or endpoints retrieve the
information completely to construct federated API management
compatible heartbeats, APIs, and metrics.
If no REST API or endpoint is available to retrieve the heartbeats(status), APIs, and metrics from the runtime, use the manual implementation approach. With this approach, you can implement a custom solution to check and retrieve the heartbeats, APIs, and metrics.
Opening the agent-sdk-managed-implementation sample folder
- Open Visual Studio Code editor.
- Click File, select Open Folder, and select agent-sdk-version -with-implementation-samples\samples\implementation\agent-sdk-managed-implementation.
The agent-sdk-managed-implementation sample opens in Visual Studio Code.
Including the Agent SDK Jars into the application
- Select build.gradle in your agent-sdk-managed-implementation folder.
- Specify the location of api, core, and model Jars under
dependencies in the application code.Note: This step applies only if you moved the Agent SDK Jars from the libs folder outside the extracted, agent-sdk- version-with-implementation-samples folder.
For example, if you moved the Agent SDK Jars from the extracted (libs) folder to C:\Users\test\Control Plane\libs, specify the path of the location under dependencies in the application code as follows,
dependencies { implementation(files("C:\\Users\\test\\Control Plane\\libs\\controlplane-agentsdk-api-<version>.jar")) implementation(files("C:\\Users\\test\\Control Plane\\libs\\controlplane-agentsdk-core-<version>.jar")) implementation(files("C:\\Users\\test\\Control Plane\\libs\\controlplane-agentsdk-model-<version>.jar"))Make sure to separate each folder with \\ in the path.
Ignore this step if the Agent SDK Jars are within the extracted folder. The following code reads the location of the Jars from the extracted folder.
- Verify whether the Jars are included properly in the application.
- Click Terminal and select New Terminal.
- Run the following command from the agent-sdk-managed-implementation location:
gradle build(if you have installed Gradle globally)(or)
./gradlew build
Build Successful message appears only when the Jars are included properly, and the application compiles successfully.
- Verify whether the Gradle has execution permissions.
- Run
gradle build(or)./gradlew build - If the issue persists, run
sh ./gradlew build(or)bash .gradlew build
Configuring the properties to connect the runtime with federated API management
- Open application.properties from src\main\resources.
The application.properties file contains properties that are related to the runtime, agent, and federated API management to establish a connection between the runtime and federated API management.
- Specify the value for each property.
Properties Description asset.sync.interval The duration in seconds in which the agent must synchronize the changes that are made to the assets to federated API management. Default - 900 seconds
Min - 60 seconds
Max - 21600 seconds (6 hours)
heartbeat.interval The duration in seconds in which the agent must send health check status to federated API management. Default - 30 seconds
Min - 15 seconds
Max - 900 seconds (15 minutes)
metrics.send.interval The duration in seconds in which the runtime must send metrics to federated API management. Default - 900 seconds
Min - 60 seconds
Max - 7200 seconds (2 hours)
control.plane.password This field is mandatory when AuthConfig is set to Basic auth. Password of the corresponding username, which is used for logging in to federated API management. control.plane.url This field is mandatory when AuthConfig is set to Basic auth. The valid URL that is used to access federated API management. For example, https://localhost:8080
control.plane.username This field is mandatory when AuthConfig is set to Basic auth. Username that is used to log in to federated API management. mcsp.instance.id This field is mandatory when AuthConfig is set to Bearer token-based auth. ID of the specific tenant in the MCSP environment. mcsp.api.key This field is mandatory when AuthConfig is set to Bearer token-based auth. API key that is used to authenticate the tenant. mcsp.url This field is mandatory when AuthConfig is set to Bearer token-based auth. The valid URL where the MCSP server gets hosted. is.tls.enabled Optional. The SSL certification of federated API management. Possible values, true (or) false
tls.trust.store.password Optional. Password to access the truststore file. If is.tls.enabled property is set to true, you must specify a value for this property.
tls.trust.store.path Optional. Location of the truststore file. If is.tls.enabled property is set to true, you must specify a value for this property.
tls.trust.store.type Optional. Type of the truststore file. If is.tls.enabled property is set to true, you must specify a value for this property.
log.level Optional. Log level to be captured. Possible values - trace, debug, info, and error.
runtime.description Optional. The runtime description. Description must not exceed 300 characters.
runtime.id Mandatory. The runtime ID. ID field accepts alphanumeric characters, underscore(_), and hiphen(-)
runtime.location Optional. The location where the runtime is deployed. Note: The location can be provided in either of the following formats:Example, New York or United States|New York|New York- <city>
- <country>|<state>|<city>
Note: If bothruntime.locationand the individual fields (runtime.country,runtime.state, andruntime.city) are provided, the value inruntime.locationtakes precedence.Location name must not exceed 50 characters.
runtime.country Optional. Country where the runtime is deployed. runtime.state Optional. State where the runtime is deployed. runtime.city Optional. City where the runtime is deployed. If the city name is unique and the country and state fields are not specified, federated API management automatically populates the country and state values. runtime.name Mandatory. The runtime name. This property defines how you want to identify the runtime in federated API management. Name must not exceed 50 characters.
runtime.region Mandatory. The region name where the runtime is hosted. Example, EAST US
Region name must not exceed 50 characters.
runtime.type Mandatory. The ID of the runtime type. Example, Azure_GW
Pre-defined types: WEBMETHODS_DEVELOPER_PORTAL, WEBMETHODS_API_GATEWAY
Note: Make sure to verify whether the runtime type exists in federated API management. If it does not exist, use the following Runtime Type Management Service REST API to add the runtime type.POST /api/assetcatalog/v1/runtimes/types
Example, POST https://localhost:8080/api/assetcatalog/v1/runtimes/types
Content-Type - application/JSON
{ "id":"Azure", // ID of the runtime type "name":"azure_runtime" // Name of the runtime type }For details, see Runtime Type Management REST API.
runtime.url Mandatory. The hostname of the runtime. Example, http://demo.apigw-aw-us.webmethods.in
The URL appears in the Runtime details page in federated API management. Federated API management uses the runtime URL to open the runtime from federated API management through the Open in runtime option on the APIs tab in the Catalog page.
runtime.heartbeat.url Mandatory. A valid REST API that retrieves the heartbeats (status) of the runtime. Agent SDK retrieves the heartbeat (status) of the runtime by using the REST API specified in this property.
Example, https://localhost:5555/health
The implementation logic for retrieving the heartbeats by using this REST API is available in HeartbeatManager interface from src\main\java\manager. For details, see Registering the runtime with federated API management
runtime.heartbeat.url.auth Mandatory. The value of the Authorization header for the REST API, specified in the runtime.heartbeat.url property. Example, "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
For this implementation, you can specify the Authorization header value in the application.properties file. As it is sensitive information, it is recommended to use a secret store to securely store and access this data from your deployments.
The implementation logic is available in the HeartbeatManager interface from src\main\java\manager. For details, see Registering the runtime with federated API management
runtime.metrics.url Mandatory. A valid REST API that retrieves the metrics completely from the runtime to construct federated API management compatible metrics. For details on the metrics supported by federated API management, see Federated API management agent overview section. Agent SDK retrieves the metrics from the runtime by using the REST API specified in this property.
Example, https://localhost:5555/metrics
The implementation logic for retrieving the metrics by using this REST API is available in MetricsManager interface at src\main\java\manager. For details, see Synchronizing the metrics from the runtime to federated API management
runtime.metrics.url.aut Mandatory. The value of the Authorization header for the REST API, specified in the runtime.metrics.url property. Example, "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
For this implementation, you can specify the authorization header value in the application.properties file. As it is sensitive information, it is recommended to use a secret store to securely store and access this data from your deployments.
The implementation logic for retrieving the metrics by using this REST API is available in the MetricsManager interface at src\main\java\manager. For details, see Synchronizing the metrics from the runtime to federated API management
runtime.api.url Mandatory. A valid REST API that retrieves all APIs from the runtime completely. The Agent SDK retrieves the APIs from the runtime by using the REST API specified in this property.
Example, https://localhost:5555/apis
The implementation logic for retrieving the APIs using this REST API is available in APIManager interface at src\main\java\manager. For details, see Publishing the APIs from the runtime to federated API management
runtime.api.url.auth Mandatory. The value of the authorization header for the REST API, specified in the runtime.api.url property. Example, "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
For this tutorial, you can specify the authorization header value in the application.properties file. As it is sensitive information, it is recommended to use a secret store to securely store and access this data from your deployments.
The implementation logic for retrieving the APIs by using this REST API is available in the APIManager interface at src\main\java\manager. For details, see Publishing the APIs from the runtime to federated API management
should.publish.assets Enable or disable the publishing of assets to federated API management. Possible values, true (or) false
If should.publish.assets is set to true, Agent SDK publishes the APIs from the runtime to federated API management whenever the agent starts. For details, see Publishing the APIs from the runtime to federated API management
should.send.metrics Enable or disable sending API metrics to federated API management. Possible values, true (or) false
Agent SDK synchronizes the metrics from the runtime to federated API management only if you set should.send.metrics to true. For details, see Synchronizing the metrics from the runtime to federated API management
should.sync.assets Enable or disable syncing of assets to federated API management. Possible values, true (or) false
Agent SDK synchronizes the APIs periodically with federated API management according to the value specified in asset.sync.interval. Within each synchronization interval, Agent SDK synchronizes only the assets that are newly created, updated, or deleted with federated API management. For details, see Publishing the APIs from the runtime to federated API management
Note: In addition to these properties, the developer can build HTTP connection configuration function and define more properties such as maxConnections,maxRetries, maxConnectionTimeout, retry Count, read Timeout, and so on.
Registering the runtime with federated API management
- Open the HeartbeatManager interface from src\main\java\manager.
- Construct the getHeartbeatRestRequestBuilder() method in the
HeartbeatManager interface to retrieve the heartbeats (status) of the runtime.
This step is essential for retrieving and sending the heartbeats (status) of the runtime to the federated API management periodically. To accomplish, you must instruct the Agent SDK on how to retrieve the heartbeats from the runtime by using the REST API. It involves implementing the getHeartbeatRestRequestBuilder() method in the HeartbeatManager interface to return a RequestBuilder object.
Consider the following REST API call as an example and construct a RequestBuilder for retrieving heartbeats (status) from the runtime.
//REST API call GET /health HTTP/1.1 // REST API (specified in the runtime.heartbeat.url property)to retrieve the heartbeats of the runtime using POST method in HTTP protocol. Host: localhost:5555 //Runtime URL (specified in the runtime.url property) Authorization: Basic QWRtaW5pc3RyYXRvcjptYW5hZ2U= // Text highlighted in bold is the AuthHeader value of the REST API (specified in the runtime.heartbeat.url.auth property)For the corresponding REST API call, the RequestBuilder code must be as follows. Copy and paste the following code into the build() method within the getHeartbeatRestRequestBuilder() method. This code is also available as a comment in the HeartbeatManager class, which you can uncomment and use. Make sure to remove the return null in the line number 57 if you uncomment and use the code from the HeartbeatManager class.
Note: The following getHeartbeatRestRequestBuilder() code is only for constructing the request for the corresponding API call. You can modify it based on your API request.// To add Auth header for the health endpoint as the API above has a header with authentication. HashMap<String,String> headers=new HashMap<>(); headers.put(HttpHeaders.AUTHORIZATION,agentConfiguration. heartbeatURLAuthHeader); return new SdkHttpRequest.Builder(agentConfiguration.heartbeatURL,HttpMethod.GET) // agentConfiguration.heartbeatURL returns the Heartbeat URL (/health) using the GET method. .headers(headers) //To add the Headers constructed above .maxRetries(3) //The maximum number of times the HTTP client must re-establish the connection in case of HTTP connection failure. .retryInterval(300) //The duration in seconds in which the HTTP client must re-establish the connection in case of HTTP connection failure. .build();After implementing the code to send a request to the runtime for heartbeats, the next step is to parse the received response(heartbeats) into an federated API management compatible heartbeat model.
- Construct the getHeartbeatResponseParser() method to parse the response(heartbeats)
received from the runtime to federated API management compatible heartbeat model. For details on the heartbeat model, see
com.webmethods.api.controlplane.agentsdk.model package under
Heartbeat in the javadocs.
Assume the following response (heartbeats) is sent from the runtime to the agent when the REST API mentioned in the Step 2 is invoked.
{ "status":true }The agent must send this response to federated API management, which requires the heartbeats to be in the following federated API management compatible model,
{ "created": 1710858635000, "runtimeId": "35ea9d8c-2b93-4517-9d97-269921009cf5", "active":1 }Here, active: 0 indicates that the runtime is down or inactive and active: 1 indicates that the runtime is up or active.
To accomplish, you must implement code to parse the response. Copy and paste the following code into the getHeartbeatResponseParser() method in the HeartbeatManager interface.
Note: The following getHeartbeatResponseParser() code is only for parsing the corresponding response. You can modify it based on your API response.// To get the current timestamp long timestamp=System.currentTimeMillis(); // To construct ObjectMapper object ObjectMapper objectMapper=new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false); // To convert the response to SDK Http response SdkHttpResponse responseParsed=(SdkHttpResponse) response; try{ // To get the response body as string String body =(String) responseParsed.getBody(); // To create a health object to capture the response (heartbeats) of the runtime and convert the health object to a Federated API management compatible heartbeat object. Health health=objectMapper.readValue(body, Health.class); // To construct the heartbeat object based on the received health object Heartbeat heartbeat=new Heartbeat.Builder(agentConfiguration.runtimeId) .active((health.getStatus())?Heartbeat.Status.ACTIVE:Heartbeat.Status.INACTIVE) .created(timestamp) .build(); // Returns the heartbeat return heartbeat; }catch(Exception e){ e.printStackTrace(); }The next step is to build and run the agent application to verify whether the runtime is registered with federated API management.
- To build the Jar, run the following command from agent-sdk-managed-implementation location in
the
terminal:
gradle build (if you have configured Gradle globally in your system) (or) ./gradlew buildBuild Successful message appears and a sample-managed-sdk-version.jar is created at build\libs
- To run the Jar, run the following command from
agent-sdk-managed-implementation location in the
Terminal:
java -jar ./build/libs/sample-managed-sdk-<version>.jarWhere, /build/libs/sample-managed-sdk-version.jar is the path where the Jar is created.
The agent application starts.
- Verify whether the runtime is registered with federated API management
and if the heartbeats (status) are sent to federated API management
successfully.
- On the Catalog page, click the Runtimes tab.
- Check whether the runtime (specified in the application.properties) is
listed.
If the runtime is listed, it indicates that the runtime is successfully registered with federated API management.
- Check the status of that corresponding runtime in the Status column.
The status appears green only if the runtime is up and the heartbeats (status) are received successfully by the federated API management.
You can also click the
icon under the Action column corresponding to that runtime to monitor the status of the runtime for a specific time interval.
Note: When the agent application starts, it reads the runtime configurations from the application.properties file and registers with federated API management. As a result, the runtime appears on the Runtimes page in federated API management immediately after registration. However, to check the runtime's heartbeat (status) in federated API management, you must wait for the synchronization interval that is specified in the application.properties file to elapse.The runtime is registered with federated API management and federated API management starts receiving the status of the runtime. Now, you can stop the agent connection and implement code for publishing the APIs from the runtime to federated API management.
Publishing the APIs from the runtime to federated API management
Agent SDK performs this step only if should.publish.assets or should.sync.assets is set to true in the application.properties file.
- Open the APIManager interface from src\main\java\manager.
- Construct the getAPIRestRequestBuilder() method in the APIManager
interface to retrieve the APIs from the runtime.
This step is essential for retrieving and sending the APIs from the runtime to federated API management. To accomplish, you must instruct the Agent SDK on how to retrieve the APIs from the runtime by using the REST API. It involves implementing the getAPIRestRequestBuilder() method in the APIManager interface to return a RequestBuilder object.
Consider the following REST API call as an example and construct a RequestBuilder for retrieving the APIs from the runtime.
POST /apis HTTP/1.1 // REST API(specified in the runtime.api.url property) to retrieve the Apis of the runtime using POST method in HTTP protocol. Host: localhost:5555 // Runtime URL (specified in the runtime.url property) Content-Type: application/json // The request body in json format Authorization: Basic QWRtaW5pc3RyYXRvcjptYW5hZ2U= // Text highlighted in bold is the AuthHeader value of the REST API (specified in the runtime.api.url.auth property) //Sample request body to retrieve the APIs in the specified time period in the interval of 60 seconds. { "from":1704430169000, "to":1715316569000, "interval":60 }Copy and paste the following code into the getAPIRestRequestBuilder() method. This code is also available as a comment in the APIManager interface, which you can uncomment and use.Note: The following getAPIRestRequestBuilder() code is only for constructing the request for the corresponding API. You can modify it based on your API request.// To add Auth header for the health endpoint as the API above has a header with authentication. HashMap<String,String> headers=new HashMap<>(); headers.put(HttpHeaders.AUTHORIZATION,agentConfiguration.apisURLAuthHeader); // To add the content type and the request body format. headers.put(HttpHeaders.CONTENT_TYPE, "application/json"); // To construct your request body. The context is available for the getAPIRestRequestBuilder() method as a parameter. String requestBody="{'from':"+context.getFromTimestamp()+",'to':"+context.getToTimestamp()+",'interval':"+context.getInterval()+"}"; // To retrieve the APIs according to the request body above return new SdkHttpRequest.Builder(agentConfiguration.apisURL,HttpMethod.POST) // agentConfiguration.apisURL returns the API URL (/apis) using the POST method. .body(requestBody) .headers(headers) // To add the Headers constructed above. .maxRetries(3) // The maximum number of times the HTTP client must re-establish the connection in case of HTTP connection failure. .retryInterval(300) // The duration in seconds in which the HTTP client must re-establish the connection in case of HTTP connection failure. .build();After implementing the code to send a request to the runtime for APIs, the next step is to parse the received response (APIs) into an federated API management compatible API model.
- Construct the getAPIResponseParser() method to parse the response(APIs) received
from the runtime to federated API management compatible API model. For details on the API model supported by federated API management,
see com.webmethods.api.controlplane.agentsdk.model package under API in
the javadocs. Implement the getAPIRestRequestBuilder() method to parse the
response you receive from the runtime to federated API management
compatible API model as specified in the javadocs. Note: Make sure to place your code into the parseList() method within getAPIRestRequestBuilder() method in the APIManager interface.
After you implement the code, the next step is to build and run the agent application to verify whether the APIs are published from the runtime to federated API management.
- To build the Jar, run the following command from agent-sdk-managed-implementation location in
the
terminal:
gradle build (if you have configured Gradle globally in your system) (or) ./gradlew buildBuild Successful message appears and a sample-managed-sdk-version .jar is created at build\libs.
- To run the Jar, run the following command from agent-sdk-managed-implementation location in the
Terminal:
java -jar ./build/libs/sample-managed-sdk<version>.jarWhere, /build/libs/sample-managed-sdk-<version>.jar is the path where the Jar is created.
The agent application starts.
- Verify whether the APIs are published from the runtime to federated API management
successfully.
- On the Catalog page, click the Runtimes
tab.
Check whether the runtime (specified in the application.properties) is listed.
- To verify whether the APIs associated with the runtime are published to federated API management, click the Overflow menu corresponding to the runtime and select Details.
- Click Relations tab.
A list of all the APIs associated with the runtime appears.
The APIs are published from the runtime to federated API management. Now, you can stop the agent connection and implement code for synchronizing the API metrics from the runtime to federated API management.
- On the Catalog page, click the Runtimes
tab.
Synchronizing the metrics from the runtime to federated API management
Agent SDK performs this step only if you set should.send.metrics to true in the application.properties file.
- Open the MetricsManager interface from src\main\java\manager.
- Construct the getMetricsRequestBuilder() method in the MetricsManager
interface to retrieve the metrics from the runtime.
This step is essential for retrieving and sending the metrics from the runtime to federated API management. To accomplish, you must instruct the Agent SDK on how to retrieve the metrics from the runtime by using the REST API. It involves implementing the getMetricsRequestBuilder() method in the MetricsManager interface to return a RequestBuilder object.
Consider the following REST API call as an example and construct a RequestBuilder for retrieving the metrics from the runtime.
POST /metrics HTTP/1.1 // REST API(specified in the runtime.metrics.url property) to retrieve the metrics of the runtime using POST method in HTTP protocol. Host: localhost:5555 // Runtime URL (specified in the runtime.url property) Content-Type: application/json // The request body in json format Authorization: Basic QWRtaW5pc3RyYXRvcjptYW5hZ2U= // Text highlighted in bold is the AuthHeader value of the REST API (specified in the runtime.metrics.url.auth property) //Sample request body to retrieve the metrics in the specified time period in the interval of 60 seconds. { "from":1704430169000, "to":1715316569000, "interval":60 }Copy and paste the following code into the getMetricsRequestBuilder() method. This code is also available as a comment in the MetricsManager interface, which you can uncomment and use.Note: The following getMetricsRequestBuilder() code is only for constructing the request for the corresponding API. You can modify it based on your API request.// To add Auth header for the health endpoint as the API above has a header with authentication. HashMap<String,String> headers=new HashMap<>(); headers.put(HttpHeaders.AUTHORIZATION,agentConfiguration.metricsURLAuthHeader); // To add the content type and the request body format. headers.put(HttpHeaders.CONTENT_TYPE, "application/json"); // To construct your request body. The context is available for the getAPIRestRequestBuilder() method as a parameter. String requestBody="{'from':"+context.getFromTimestamp()+",'to':"+context.getToTimestamp()+",'interval':"+context.getInterval()+"}"; // To retrieve the metrics according to the request body above return new SdkHttpRequest.Builder(agentConfiguration.metricsURL,HttpMethod.POST) // agentConfiguration.metricsURL returns the metrics URL (/metrics) using the POST method. .body(requestBody) .headers(headers) // To add the Headers constructed above. .maxRetries(3) // The maximum number of times the HTTP client must re-establish the connection in case of HTTP connection failure. .retryInterval(300) // The duration in seconds in which the HTTP client must re-establish the connection in case of HTTP connection failure. .build();After implementing the code to send a request to the runtime for metrics, the next step is to parse the received response (metrics) into an federated API management compatible API model.
- Construct the getMetricsResponseParser() method to parse the response (metrics)
received from the runtime to federated API management compatible metrics model. For details on the API model supported by federated API management,
see com.webmethods.api.controlplane.agentsdk.model package under Metrics
in the javadocs. Implement the getMetricsResponseParser() method to parse
the response you receive from the runtime to federated API management
compatible metrics model as specified in the javadocs. Note: Make sure to place your code into the parseList() method within the getMetricsResponseParser() method in the MetricsManager interface.
After you implement the code, the next step is to build and run the agent application to verify whether the metrics are published from the runtime to federated API management.
- To build the jar, run the following command from agent-sdk-managed-implementation location in
the
terminal:
gradle build (if you have configured Gradle globally in your system) (or) ./gradlew buildBuild Successful message appears and a sample-managed-sdk- version .jar is created at build\libs.
- To run the jar, run the following command from agent-sdk-managed-implementation location in the
terminal:
java -jar ./build/libs/sample-managed-sdk<version>.jarWhere, /build/libs/sample-managed-sdk-<version>.jar is the path where the jar is created.
The agent application starts.
- Verify whether the API metrics are published from the runtime to federated API management
successfully.
- On the Catalog page, click the Runtimes tab.
- Check whether the runtime (specified in the application.properties) is listed.
- To verify whether the metrics of the API are published to federated API management,
click the
icon corresponding to the runtime.
The Runtime specific monitoring Insights page renders the metrics of that runtime pertaining to a specified time interval. It lists the metrics such as Transactions, Error rate, Availability, Response time.
The metrics are synchronized from the runtime to federated API management. In this procedure, you learned how to implement code that instructs the Agent SDK to perform its core functions and how to build and test each use case individually. The next procedure explains how to build and test the entire package (Jar). You can skip the next procedure if the jar is built and the agent application is running.