Select to view content in your preferred language

GeoEvent SDK: Available Framework References

498
0
03-11-2020 10:35 AM
EricIronside
Esri Regular Contributor
3 0 498

When working with the GeoEvent SDK, there are times when you need to utilize a framework service from the underlying GeoEvent system. In order to do this you must inject the service into your bean in the configuration file.  This blog discusses how to do that and provides a list of services that are available.  This blog is not intended to be all encompassing, so I'll update it as needed.

Adding a Framework Resource Reference

To reference an underlying SDK resource you must add it to your Blueprint config.xml file.

1. Add the service reference towards the top of the xml:

  • id: a name you give the reference so you can refer to it later in the configuration xml.
  • interface: the full name of the class you are referencing

<reference id="geoDefManagerService" interface="com.esri.ges.manager.geoeventdefinition.GeoEventDefinitionManager" />

2. Inside your bean declaration, add a property that identifies the reference and gives it a unique name:

<property name="manager" ref="geoDefManagerService" />

3. Inside your Service class, implement a method to allow the reference to be injected into your service:

private GeoEventDefinitionManager geoEventDefinitionManager;

public void setManager(GeoEventDefinitionManager geoEventDefinitionManager) {

       this.geoEventDefinitionManager = geoEventDefinitionManager;

}

4. Use the injected reference when instantiating your implementation class:

EventJoiner eventJoiner = new EventJoiner(definition, this.geoEventDefinitionManager);

Non-Reference Properties

The following resources are available without having to create a reference in your config.xml.

Data Folder

If you need to store data on disk (such as configuration or non-volatile cache) you can add a data folder property to your bean.  Using the data folder property is the same for the Service and Implementation classes as documented above for the referenced resources.

<property name="dataFolder" value="./data/myfolder" />

The path in the value above points to the GeoEvent installation data directory (typically C:\Program Files\ArcGIS\Server\GeoEvent\data\ ).

Useful References

GeoEventDefinitionManager

Allows you to find/use/modify existing GeoEvent Definitions and/or create new ones.

Interface: com.esri.ges.manager.geoeventdefinition.GeoEventDefinitionManager

Documentation:

file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/manager/geoeventdefinition/GeoEventDefinitionManager.html

Messaging

Allows you to create/publish GeoEvents and subscribe to GeoEvent listeners.  The main use of this reference is to get access to a GeoEventCreator.

Interface: com.esri.ges.messaging.Messaging

Documentation: 

file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/messaging/Messaging.html

Example for Implementation Class: 

private GeoEventCreator geoEventCreator;

public void setMessaging(Messaging messaging) {

   geoEventCreator = messaging.createGeoEventCreator();

}

HTTP Client Service

Gives you access to the GeoEvent Server's HTTP client services.  Use this to create HTTP clients that honor GeoEvent Server's global settings for proxy, etc.

Interface: com.esri.ges.core.http.GeoEventHttpClientService

Documentation: 

file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/core/http/GeoEventHttpClientService.html

Example for Implementation Class: 

private GeoEventHttpClient httpclient;
public class AnImplementationClass(GeoEventHttpClientService httpClientService) {
   this.httpclient = httpClientService.createNewClient();
}

Tag Manager

If you need to create some custom TAGs, you can use the tag manager to do that.

Interface: com.esri.ges.manager.tag.TagManager

Documentation: 

file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/manager/tag/TagManager.html

AGS Connection Manager

If you need to connect to a registered data store.

Interface: com.esri.ges.manager.datastore.agsconnection.ArcGISServerConnectionManager

Documentation: 

file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/manager/datastore/agsconnection/ArcGISServerConnectionManager.html

 

 

About the Author
Esri Professional Services Real-Time GIS Team GeoEvent Sr. Product Enginner