2
2
3
3
import com .fasterxml .jackson .core .PrettyPrinter ;
4
4
import com .fasterxml .jackson .core .util .DefaultPrettyPrinter ;
5
- import com .fasterxml .jackson .databind .ObjectMapper ;
6
5
import org .apache .log4j .Logger ;
7
6
import org .avni_integration_service .integration_data .domain .IntegrationSystem ;
8
7
import org .avni_integration_service .integration_data .domain .MappingGroup ;
17
16
import org .avni_integration_service .integration_data .repository .MappingTypeRepository ;
18
17
import org .avni_integration_service .integration_data .repository .config .IntegrationSystemConfigRepository ;
19
18
import org .avni_integration_service .util .BundleFileName ;
20
- import org .avni_integration_service .util .ObjectMapperSingleton ;
21
19
import org .avni_integration_service .web .contract .ErrorTypeContract ;
22
20
import org .avni_integration_service .web .contract .IntegrationSystemConfigContract ;
23
21
import org .avni_integration_service .web .contract .MappingMetadataContract ;
33
31
import java .util .zip .ZipInputStream ;
34
32
import java .util .zip .ZipOutputStream ;
35
33
34
+ import static org .avni_integration_service .util .ObjectJsonMapper .objectMapper ;
35
+
36
36
@ Service
37
37
public class BundleService {
38
38
private static final Logger logger = Logger .getLogger (BundleService .class );
@@ -55,16 +55,14 @@ public class BundleService {
55
55
add (BundleFileName .INTEGRATION_SYSTEM_CONFIG );
56
56
}};
57
57
private static final int BUFFER_SIZE = 2048 ;
58
- private final ObjectMapper objectMapper ;
59
-
60
58
61
59
@ Autowired
62
60
public BundleService (MappingMetaDataRepository mappingMetaDataRepository , MappingGroupRepository mappingGroupRepository ,
63
61
MappingTypeRepository mappingTypeRepository , ErrorTypeRepository errorTypeRepository ,
64
62
IntegrationSystemConfigRepository integrationSystemConfigRepository ,
65
63
MappingTypeService mappingTypeService , MappingGroupService mappingGroupService ,
66
64
MappingMetadataService mappingMetadataService , ErrorTypeService errorTypeService ,
67
- IntegrationSystemConfigService integrationSystemConfigService , ObjectMapper objectMapper ) {
65
+ IntegrationSystemConfigService integrationSystemConfigService ) {
68
66
this .mappingMetaDataRepository = mappingMetaDataRepository ;
69
67
this .mappingGroupRepository = mappingGroupRepository ;
70
68
this .mappingTypeRepository = mappingTypeRepository ;
@@ -75,7 +73,6 @@ public BundleService(MappingMetaDataRepository mappingMetaDataRepository, Mappin
75
73
this .mappingMetadataService = mappingMetadataService ;
76
74
this .errorTypeService = errorTypeService ;
77
75
this .integrationSystemConfigService = integrationSystemConfigService ;
78
- this .objectMapper = objectMapper ;
79
76
}
80
77
81
78
public void exportMappingMetadataAsJsonToZip (IntegrationSystem integrationSystem , ZipOutputStream zos ) throws IOException {
@@ -232,7 +229,7 @@ private void addFileToZip(ZipOutputStream zos, String fileName, Object fileConte
232
229
zos .putNextEntry (entry );
233
230
if (fileContent != null ) {
234
231
PrettyPrinter prettyPrinter = new DefaultPrettyPrinter ();
235
- byte [] bytes = ObjectMapperSingleton . getObjectMapper () .writer (prettyPrinter ).writeValueAsBytes (fileContent );
232
+ byte [] bytes = objectMapper .writer (prettyPrinter ).writeValueAsBytes (fileContent );
236
233
zos .write (bytes );
237
234
}
238
235
zos .closeEntry ();
0 commit comments