* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Bean
@Primary
- public RestTemplate restTemplate() {
- final RestTemplate restTemplate = new RestTemplate();
+ public RestTemplate restTemplate(RestTemplateBuilder builder) {
+ final RestTemplate restTemplate = builder.build();
restTemplate
.setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
restTemplate.getInterceptors().add(new SOSpringClientFilter());
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.onap.so.requestsdb.TimestampXMLAdapter;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.deser.std.DateDeserializers.TimestampDeserializer;
@MappedSuperclass
public abstract class InfraRequests implements java.io.Serializable {
private Long progress;
@Column(name = "START_TIME")
+ @JsonDeserialize(using = TimestampDeserializer.class)
private Timestamp startTime;
+ @JsonDeserialize(using = TimestampDeserializer.class)
@Column(name = "END_TIME")
private Timestamp endTime;
@Column(name = "SOURCE", length = 45)