This module provides a component for Release Command Center (RCC) integration. Before this component created, implementation of RCC integration was very complex and hard to setup. This component provides an unified interface for RCC integrations using FlowPDF-Groovy toolkit.
Datasource => Records Set => Transformed Records Set => Data Set => Payload Set
The key idea of reporting is:Type | Name and description |
---|---|
Metadata |
currentMetadata Instance for the metadata that is stored in CloudBees CD server |
static FWLog |
fwLog Internal logging instance |
int |
initialRecordsCount Default value for the count of objects to retrieve on first run (no metadata) |
boolean |
isPreviewMode If is set to true, no modificable operations will be performed (saving of metadata, sending report objects) |
MetadataFactory |
metadataFactory Metadata provider |
java.lang.String |
metadataUniqueKey Unique name of the metadata property, used to deffer metadata for different instances of CRD in the same project |
java.util.ArrayList<java.lang.String> |
payloadKeys List of the payload keys that are used to build the metadata |
java.lang.String |
pluginName Name of the plugin where component is defined |
FlowPlugin |
pluginObject Link to an instance of a plugin |
java.util.ArrayList<java.lang.String> |
reportObjectTypes Types of reports that are processed by this component |
Engine |
reportingEngine CloudBees CD Reporting APIs wrapper |
Transformer |
transformer Instance of the transformer that should process objects before they are passed to the buildPayloadSet |
Type Params | Return Type | Name and description |
---|---|---|
|
Dataset |
buildDataset(FlowPlugin plugin, java.util.List<java.util.Map> records) This method is used to convert records to the compatible representation that can be transformed to the payload |
|
protected java.lang.String |
buildMetadataLocation() This method builds a path to the metadata property (context dependable) |
|
Payloadset |
buildPayloadSet(FlowPlugin plugin, Dataset records) Placeholder for the buildPayloadSet method |
|
void |
collectReportingData() Entry method for the component process. |
|
int |
compareMetadata(Metadata currentMetadata, Metadata newMetadata) This method is responsible for comparing current stored values and the one that was built from the result of getLastRecord() |
|
java.util.Map<java.lang.String, java.lang.Object> |
getLastRecord(FlowPlugin plugin) This method is used to check freshness of current metadata. |
|
java.util.List<java.util.Map<java.lang.String, java.lang.Object>> |
getRecordsAfter(FlowPlugin plugin, Metadata metadata) If current metadata is older than the record received by the getLastRecord(), this method will be called to get new records. |
|
Component |
init(java.util.Map<java.lang.String, java.lang.Object> configuration, FlowPlugin plugin) Initialization of the component. |
|
protected Transformer |
initTransformer(java.lang.String transformScriptValue) |
|
java.util.List<java.util.Map<java.lang.String, java.lang.Object>> |
initialGetRecords(FlowPlugin plugin, int initialRecordsCount) This method will be called if there is no metadata stored for current Reporting configuration and context. |
|
boolean |
isEFComponent() If a parameter named 'transformScript' was found and contains a closure an instance of the Transformer will be initialized to process report objects. |
|
boolean |
isPreview() Getter for the isPreviewMode |
|
Dataset |
newDataset(java.util.ArrayList<java.lang.String> reportObjectTypes, java.util.List<Data> data) Shortcut to create a dataset from given data |
|
MetadataFactory |
newMetadataFactory() |
|
Payloadset |
newPayloadset(java.util.ArrayList<java.lang.String> reportObjectTypes, java.util.ArrayList<Payload> payloads = []) Shortcut to create a payloadset from given payloads |
|
Payloadset |
prepareAndValidatePayloads(Payloadset payloadset) This method is responsible for validating the payloads prepared to be sent to the CloudBees CD server |
|
Payload |
prepareAndValidateSinglePayload(Payload payload, Engine reportingEngine) This method compares the payload with format defined on CloudBees CD server |
|
Dataset |
rawRecordsToDataset(java.util.List<java.util.Map<java.lang.String, java.lang.Object>> records) Converts objects returned from the reporting system to a Data |
|
static java.lang.Object |
validateAndConvertRow(java.lang.String fieldName, java.lang.Object rowValue, java.util.Map<java.lang.String, java.lang.Object> fieldDefinition) This method validates that the value for given key corresponds with the type that is defined on the CloudBees server. |
Methods inherited from class | Name |
---|---|
class Component |
init, isEFComponent |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Instance for the metadata that is stored in CloudBees CD server
Internal logging instance
Default value for the count of objects to retrieve on first run (no metadata)
If is set to true, no modificable operations will be performed (saving of metadata, sending report objects)
Metadata provider
Unique name of the metadata property, used to deffer metadata for different instances of CRD in the same project
List of the payload keys that are used to build the metadata
Name of the plugin where component is defined
Link to an instance of a plugin
Types of reports that are processed by this component
CloudBees CD Reporting APIs wrapper
Instance of the transformer that should process objects before they are passed to the buildPayloadSet
This method is used to convert records to the compatible representation that can be transformed to the payload
plugin
- CloudBees CD plugin instance. Useful if you need to make additional requestsrecords
- Raw records from the reporting systemThis method builds a path to the metadata property (context dependable)
Placeholder for the buildPayloadSet method
plugin
- instance of a pluginrecords
- set of records retrieved from the reporting systemEntry method for the component process.
This method is responsible for comparing current stored values and the one that was built from the result of getLastRecord() Note: Result of all getter functions, that return an array reference should be ordered from older to newer. This will be checked during validation and procedure will fail if records are not sorted in proper order. For this validation function that has been written for metadata comparison by user will be used. For example, if you have a set of builds with 10, 11, and 48, they should go in the following order: [10, 11, 48], otherwise procedure will raise an exception.
currentMetadata
- Metadata that is stored on CloudBees CD server for current configuration and contextnewMetadata
- Metadata that was build from the result of getLastRecord()This method is used to check freshness of current metadata. Values of this record will be compared to current metadata.
plugin
- FlowPlugin instance to request the valuesIf current metadata is older than the record received by the getLastRecord(), this method will be called to get new records.
plugin
- FlowPlugin instance to request the valuesmetadata
- current metadata. Use metadata.getValue() to get current stored data.Initialization of the component. Configuration keys are:
configuration
- Configuration for this reporting componentplugin
- - instance of the plugin will be passed to perform an advanced tasks inside of the Component.This method will be called if there is no metadata stored for current Reporting configuration and context. Can return null if there is no objects in the reporting system.
plugin
- FlowPlugin ancestor to get the valuesinitialRecordsCount
- - see the documentation for Reporting.getInitialRecordsCountIf a parameter named 'transformScript' was found and contains a closure an instance of the Transformer will be initialized to process report objects.
Getter for the isPreviewMode
Shortcut to create a dataset from given data
reportObjectTypes
- - types that this Dataset containsdata
- List of Data to be packet into the DatasetShortcut to create a payloadset from given payloads
reportObjectTypes
- - types that this Payloadset containsdata
- List of Payload to be packet into the PayloadsetThis method is responsible for validating the payloads prepared to be sent to the CloudBees CD server
payloadset
- Payloadset that was formed by the buildPayloadSet(FlowPlugin, Dataset)This method compares the payload with format defined on CloudBees CD server
payload
- Payload that will be validatedreportingEngine
- Engine instance that will get the definition from the CloudBees serverConverts objects returned from the reporting system to a Data
records
- List of records returned from the reporting systemThis method validates that the value for given key corresponds with the type that is defined on the CloudBees server.
fieldName
- name of the payload keyrowValue
- value for the payload keyfieldDefinition
- Map returned by CloudBees CD API getReportObjectAttributes() method