Getting started with Java Code

Many of the codes requried to be executed are dynamically loaded from the database, therefore, check some examples at: 11.data.canary.sql from the solarec-db repository.

Connect to a new inverter

The code of an inverter is simple to create, you just need to create the brand name package at the solarec.inverters module tech.renovus.solarec.inverters.brand package. We recommend that all required classes of the inverter are stored in that package to avoid confusion with similar classes of other inverters.

The main class that must implemented is tech.renovus.solarec.inverters.common.InverterService and it executable is the one stored in the data_definition table.

The main method that you will have to implement is the InverterData retrieveData() throws InveterServiceException. This method is core of the services and is the one responsable for:

The method is not responsable for:

The data that needs to be retrieve are:

The inverter service code will be execute every 24 hours by the tech.renovus.solarec.scheduler.InvertersCheckScheduler at the solarec.schedule module, for each enabled client + location + generator. In case the inverter does not provide the weather information, you can obtain that data from the WeatherService.

For samples, check the list of currently implemented brands at: solarec-java / solarec.inveters / inverters.

Connect to a new data grid service

Currently one service for data grid is supported and must implement the interface tech.renovus.solarec.grid.DataGridService. You can enable / disable the active data grid service class by adding or removing the @Service annotation.

The main method that you will have to implement is the **Collection retrieveGridData(CountryVo ctrVo) throws DataGridServiceException**. This method is core of the services and is the one responsable for:

The method is not responsable for:

The data that needs to be retrieve is:

The inverter service code will be execute every 6 hours by the tech.renovus.solarec.scheduler.DataGridCheckScheduler at the solarec.schedule module. The method will be call for each country that is used for any of the countries of the clients.

For samples, check the list of currently implemented services as: solarec-java / solarec.inveters / grid.

Connect to a new weather service

Currently one service for data grid is supported and must implement the interface tech.renovus.solarec.weather.WeatherService. You can enable / disable the active data grid service class by adding or removing the @Service annotation.

The main method that you will have to implement is the **Collection retrieveWeatherData(LocationVo locVo, StationVo station, Date dateFrom, Date dateTo) throws WeatherServiceException**. This method is core of the services and is the one responsable for:

The method is not responsable for:

The data that needs to be retrieve is:

The weather service is not executed by any schduler, instead, it can be call from an Inveter service, in case the inverter does not provide the weather information.

For samples, check the list of currently implemented services as: solarec-java / solarec.inveters / weather.