import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;\r
import org.openecomp.sdc.utils.DistributionActionResultEnum;\r
import org.openecomp.sdc.utils.DistributionStatusEnum;\r
-import org.springframework.beans.factory.annotation.Autowired;\r
\r
/**\r
- * This class handles one sdc controller defined in the config. It's\r
- * instantiated by Spring config.\r
+ * This class handles one sdc controller defined in the config.\r
*/\r
public class SdcSingleController {\r
\r
private static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcSingleController.class);\r
protected boolean isAsdcClientAutoManaged = false;\r
- @Autowired\r
- protected CsarInstaller resourceInstaller;\r
- @Autowired\r
+ protected CsarInstaller csarInstaller;\r
protected ClampProperties refProp;\r
public static final String CONFIG_SDC_FOLDER = "sdc.csarFolder";\r
\r
protected SdcSingleControllerConfiguration sdcConfig;\r
private IDistributionClient distributionClient;\r
\r
- public SdcSingleController(SdcSingleControllerConfiguration sdcSingleConfig, boolean isClientAutoManaged) {\r
+ public SdcSingleController(ClampProperties clampProp, CsarInstaller csarInstaller,\r
+ SdcSingleControllerConfiguration sdcSingleConfig, boolean isClientAutoManaged) {\r
this.isAsdcClientAutoManaged = isClientAutoManaged;\r
- sdcConfig = sdcSingleConfig;\r
+ this.sdcConfig = sdcSingleConfig;\r
+ this.refProp = clampProp;\r
+ this.csarInstaller = csarInstaller;\r
}\r
\r
/**\r
this.changeControllerStatus(SdcSingleControllerStatus.BUSY);\r
csar = new CsarHandler(iNotif, this.sdcConfig.getSdcControllerName(),\r
refProp.getStringValue(CONFIG_SDC_FOLDER));\r
- if (resourceInstaller.isCsarAlreadyDeployed(csar)) {\r
+ if (csarInstaller.isCsarAlreadyDeployed(csar)) {\r
csar.save(downloadTheArtifact(csar.getArtifactElement()));\r
this.sendASDCNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(),\r
sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.DOWNLOAD_OK, null,\r
System.currentTimeMillis());\r
- resourceInstaller.installTheCsar(csar);\r
+ csarInstaller.installTheCsar(csar);\r
this.sendASDCNotification(NotificationType.DEPLOY, csar.getArtifactElement().getArtifactURL(),\r
sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.DEPLOY_OK, null,\r
System.currentTimeMillis());\r