| 1 | |
package com.aurea.maven.plugins.sonic.sdm.util; |
| 2 | |
|
| 3 | |
import java.util.ArrayList; |
| 4 | |
import java.util.List; |
| 5 | |
|
| 6 | |
import com.sonicsw.deploy.artifact.ESBArtifact; |
| 7 | |
import com.sonicsw.sonicxq.ServiceDocument.Service; |
| 8 | |
|
| 9 | |
public class ESBServicesContribution extends AbstractModelContribution { |
| 10 | |
|
| 11 | |
public ESBServicesContribution(String name, ESBDeploymentModelBuilder builder) { |
| 12 | 0 | super(name, builder); |
| 13 | 0 | } |
| 14 | |
|
| 15 | |
@SuppressWarnings("unchecked") |
| 16 | |
public Object getContribution() throws Exception { |
| 17 | |
|
| 18 | 0 | ESBDeploymentModel model = getBuilder().getModel(); |
| 19 | |
|
| 20 | 0 | List<Service> result = (List<Service>)model.getModelObject(getContributionName()); |
| 21 | |
|
| 22 | 0 | if (result == null) { |
| 23 | 0 | result = new ArrayList<Service>(); |
| 24 | 0 | for(Object obj: getArtifactList(ESBArtifact.SERVICE, Service.class)) result.add((Service)obj); |
| 25 | |
} |
| 26 | 0 | return result; |
| 27 | |
} |
| 28 | |
|
| 29 | |
} |