There are currently three types of plugins: Batches, Jobs (with Flows & Steps) and Triggers.
First off, there's a naming convention for all plugins: If you create a custom batch or trigger class, its name has to end with "Plugin"!
A batch is a subprogram that can be placed in a queue manually or by scheduler. It will be executed, when the batch is in the first position of the queue.
So your custom batch has to be named like "MyCustomBatchPlugin" and it also has to extend the following abstract class: de.gadiv.integration.server.batch.DefaultBatch
Any class that extends "DefaultBatch" has to implement the following methods:
Jobs are an extension to normal batches, because they support a more complex design of program flow and parallelization.
Your custom job has to be named like "MyCustomJobPlugin" and it also has to extend the following abstract class: de.gadiv.integration.server.batchx.DefaultJob
DefaultJob extends the class de.gadiv.integration.server.batch.DefaultBatch.
The job class contains a list of so called 'steps'. A step is an executable unit which can be defined by the batch developer. These steps will be executed during batch execution in the order of adding them to the batch. There are several types of steps:
The steps / flows described above should be added to the job object by calling addStep(). They can be combined arbitrarily. A flow can contain more steps and flows, which can contain more steps and flows, etc.
There's also a so called JobContext which contains a serializable object 'contextData'. The contextData represents the progress of the batch. In case it was cancelled or crashed, the batch can extract information from this object to know where to continue with the execution.
If your batch should be able to continue at a certain point after failure, you have to implement the serializable object depending on the needs of your batch. And of course you have to evaluate the information of the contextData inside your batch / steps.
For an example how these classes work together see the following link.
A trigger is a plugin that can be used to start certain actions, if a certain event happens. For example you could think of a trigger that copies files from one directory to another, if they appear in a certain folder or reach a certain size.
It's up to you to define (in the execute() method) what the trigger checks or observes and what it does, if a certain event happens.
Your custom trigger has to be named like "MyCustomTriggerPlugin" and it also has to extend the following abstract class: de.gadiv.integration.server.trigger.AbstractTrigger
Any class that extends "AbstractTrigger" has to implement the following methods:
Parameters are a way to make your plugin configurable. You can pass parameters to your batch in the giServerManager GUI when starting a new batch or when creating a new scheduler or trigger. There's a text area, where you can insert your parameters like this (one per row):
MY_PARAM_1=some text
MY_PARAM_2=12345
...
If you want to read this params in your batch or trigger dynamically (for example the init() method of a batch would be a good spot for that), you can call getParamString(MY_PARAM_1), which would return "some text" or getParamInteger(MY_PARAM_2), which would return 12345.
When you're done with coding, you have to place the JAR-files containing your compiled code in the "ext" folder of your giServer. At giServer start, it will check this folder and find any plugins it can use (Class name ends with "Plugin" and extends "DefaultBatch" or "AbstractTrigger"). If everything went right, you can start a new batch with your batch class or define a trigger using your trigger class.