Search in sources :

Example 26 with HandleAssetUtil

use of com.vmware.flowgate.nlyteworker.scheduler.job.common.HandleAssetUtil in project flowgate by vmware.

the class NlyteDataService method generateAssets.

public List<Asset> generateAssets(String nlyteSource, List<NlyteAsset> nlyteAssets, HashMap<Integer, LocationGroup> locationMap, HashMap<Integer, Manufacturer> manufacturerMap, HashMap<Integer, Material> materialMap, AssetCategory category, HashMap<Long, String> chassisMountedAssetNumberAndChassisIdMap) {
    HandleAssetUtil assetUtil = new HandleAssetUtil();
    List<Asset> oldAssetsFromWormhole = restClient.getAllAssetsBySourceAndType(nlyteSource, category);
    Map<Long, Asset> assetsFromWormholeMap = assetUtil.generateAssetsMap(oldAssetsFromWormhole);
    List<Asset> allAssetsFromNlyte = assetUtil.getAssetsFromNlyte(nlyteSource, nlyteAssets, locationMap, materialMap, manufacturerMap, chassisMountedAssetNumberAndChassisIdMap);
    return assetUtil.handleAssets(allAssetsFromNlyte, assetsFromWormholeMap);
}
Also used : HandleAssetUtil(com.vmware.flowgate.nlyteworker.scheduler.job.common.HandleAssetUtil) NlyteAsset(com.vmware.flowgate.nlyteworker.model.NlyteAsset) Asset(com.vmware.flowgate.common.model.Asset)

Aggregations

HandleAssetUtil (com.vmware.flowgate.nlyteworker.scheduler.job.common.HandleAssetUtil)26 Test (org.junit.Test)21 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)21 NlyteAsset (com.vmware.flowgate.nlyteworker.model.NlyteAsset)18 ArrayList (java.util.ArrayList)17 Asset (com.vmware.flowgate.common.model.Asset)16 FlowgateChassisSlot (com.vmware.flowgate.common.model.FlowgateChassisSlot)13 HashMap (java.util.HashMap)12 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)7 ChassisMountedAssetMap (com.vmware.flowgate.nlyteworker.model.ChassisMountedAssetMap)6 List (java.util.List)6 Map (java.util.Map)6 ArgumentMatchers.anyList (org.mockito.ArgumentMatchers.anyList)6 Tenant (com.vmware.flowgate.common.model.Tenant)5 ChassisSlot (com.vmware.flowgate.nlyteworker.model.ChassisSlot)3 LocationGroup (com.vmware.flowgate.nlyteworker.model.LocationGroup)3 Manufacturer (com.vmware.flowgate.nlyteworker.model.Manufacturer)3 Material (com.vmware.flowgate.nlyteworker.model.Material)3 IntegrationStatus (com.vmware.flowgate.common.model.IntegrationStatus)2