Integration → Creating Custom Source Configuration Types → Identifying Existing Versions
You typically need to access existing versions and their properties.
The interface ComponentInfo enables you to:
CommonIntegrator (sct-commons-1.0.0.jar) provides an additional Interface named ComponentInfo that has following methods:
This method provides the unique UUID of the component.
This method provides the name of the component, this source configuration type is attached to.
This method provides last created version with all its properties in the form of VersionInfo object.
This method provides all the versions created along with their properties in the form of VersionInfo list.
The ComponentInfo interface is automatically initialized when you define this in the class along with its getters and setters.
private ComponentInfo info; public ComponentInfo getInfo() { return info; } public void setInfo(ComponentInfo info) { this.info = info; }
Once initialized, you can use this for creating or identifying artifacts as follows.
Existing Versions
// For all the existing versions List<VersionInfo> existingVersions = (componentInfo == null) ? null : componentInfo.getAllVersions(); if(existingVersions != null && existingVersions.size() > 0) { for(VersionInfo info : existingVersions) { // your logic here } }
Latest Versions
// For latest versions VersionInfo singleLatestVersion = (componentInfo == null) ? null : componentInfo.getLatestVersion(); // your logic goes here.
Copyright © 2011–2017 Serena Software, Inc., a Micro Focus company. All rights reserved.