diff options
author | libujacob <libu.jacob@huawei.com> | 2018-01-05 15:49:56 +0530 |
---|---|---|
committer | libujacob <libu.jacob@huawei.com> | 2018-01-05 16:02:40 +0530 |
commit | 929c29a9c6a9a7e91fe01d18e353cdb6a29bc3d9 (patch) | |
tree | 96f45566c674fa4d71b048afd3813610ff318f50 /src/main/java | |
parent | c2671c5c1e249b513c2e624d65406e02d4986200 (diff) |
Add private constructor in all static member class
Add @override annotation to overridden functions
Issue-ID: DCAEGEN2-207
Change-Id: I7bf8ad7afec645cbe28fceaaa8f4c04001a0ef6a
Signed-off-by: libujacob <libu.jacob@huawei.com>
Diffstat (limited to 'src/main/java')
5 files changed, 28 insertions, 16 deletions
diff --git a/src/main/java/io/swagger/api/factories/DcaeServiceTypesApiServiceFactory.java b/src/main/java/io/swagger/api/factories/DcaeServiceTypesApiServiceFactory.java index fecd8fe..61d7638 100644 --- a/src/main/java/io/swagger/api/factories/DcaeServiceTypesApiServiceFactory.java +++ b/src/main/java/io/swagger/api/factories/DcaeServiceTypesApiServiceFactory.java @@ -24,9 +24,13 @@ import io.swagger.api.DcaeServiceTypesApiService; import io.swagger.api.impl.DcaeServiceTypesApiServiceImpl; @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-04-18T20:16:22.119Z") -public class DcaeServiceTypesApiServiceFactory { +public final class DcaeServiceTypesApiServiceFactory { - private final static DcaeServiceTypesApiService service = new DcaeServiceTypesApiServiceImpl(); + private static final DcaeServiceTypesApiService service = new DcaeServiceTypesApiServiceImpl(); + + //Utility classes, which are a collection of static members, are not meant to be instantiated. + private DcaeServiceTypesApiServiceFactory(){ + } public static DcaeServiceTypesApiService getDcaeServiceTypesApi() { diff --git a/src/main/java/io/swagger/api/factories/DcaeServicesApiServiceFactory.java b/src/main/java/io/swagger/api/factories/DcaeServicesApiServiceFactory.java index 47f213d..3c47b84 100644 --- a/src/main/java/io/swagger/api/factories/DcaeServicesApiServiceFactory.java +++ b/src/main/java/io/swagger/api/factories/DcaeServicesApiServiceFactory.java @@ -26,12 +26,16 @@ import io.swagger.api.DcaeServicesApiService; import io.swagger.api.impl.DcaeServicesApiServiceImpl; @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-04-18T20:16:22.119Z") -public class DcaeServicesApiServiceFactory { +public final class DcaeServicesApiServiceFactory { // Yes I agree this code is not great and I blame for Swagger for putting me in this spot. private static DCAEControllerClient dcaeControllerClient; private static DatabusControllerClient databusControllerClient; + //Utility classes, which are a collection of static members, are not meant to be instantiated. + private DcaeServicesApiServiceFactory(){ + } + public static void setDcaeControllerClient(DCAEControllerClient dcaeControllerClient) { DcaeServicesApiServiceFactory.dcaeControllerClient = dcaeControllerClient; } diff --git a/src/main/java/io/swagger/api/factories/DcaeServicesGroupbyApiServiceFactory.java b/src/main/java/io/swagger/api/factories/DcaeServicesGroupbyApiServiceFactory.java index 041fbaf..509ac2a 100644 --- a/src/main/java/io/swagger/api/factories/DcaeServicesGroupbyApiServiceFactory.java +++ b/src/main/java/io/swagger/api/factories/DcaeServicesGroupbyApiServiceFactory.java @@ -24,9 +24,13 @@ import io.swagger.api.DcaeServicesGroupbyApiService; import io.swagger.api.impl.DcaeServicesGroupbyApiServiceImpl; @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-04-18T20:16:22.119Z") -public class DcaeServicesGroupbyApiServiceFactory { +public final class DcaeServicesGroupbyApiServiceFactory { - private final static DcaeServicesGroupbyApiService service = new DcaeServicesGroupbyApiServiceImpl(); + private static final DcaeServicesGroupbyApiService service = new DcaeServicesGroupbyApiServiceImpl(); + + //Utility classes, which are a collection of static members, are not meant to be instantiated. + private DcaeServicesGroupbyApiServiceFactory(){ + } public static DcaeServicesGroupbyApiService getDcaeServicesGroupbyApi() { diff --git a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java index 34d8a4b..e12b6fc 100644 --- a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java +++ b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java @@ -48,7 +48,7 @@ import java.util.UUID; @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-04-18T20:16:22.119Z") public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService { - private final static Logger LOG = LoggerFactory.getLogger(DcaeServiceTypesApiServiceImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(DcaeServiceTypesApiServiceImpl.class); private static int PAGINATION_PAGE_SIZE = 25; private DCAEServiceType createDCAEServiceType(DCAEServiceTypeObject serviceTypeObject, UriInfo uriInfo) { diff --git a/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java index d1e790c..4ef1a46 100644 --- a/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java +++ b/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java @@ -49,14 +49,19 @@ import java.util.*; @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-04-18T20:16:22.119Z") public class DcaeServicesApiServiceImpl extends DcaeServicesApiService { - private final static Logger LOG = LoggerFactory.getLogger(DcaeServicesApiServiceImpl.class); - private static int PAGINATION_PAGE_SIZE = 25; - private static String COMPONENT_SOURCE_DCAE_CONTROLLER = "DCAECONTROLLER"; - private static String COMPONENT_SOURCE_DATA_BUS_CONTROLLER = "DMAAPCONTROLLER"; + private static final Logger LOG = LoggerFactory.getLogger(DcaeServicesApiServiceImpl.class); + private static final int PAGINATION_PAGE_SIZE = 25; + private static final String COMPONENT_SOURCE_DCAE_CONTROLLER = "DCAECONTROLLER"; + private static final String COMPONENT_SOURCE_DATA_BUS_CONTROLLER = "DMAAPCONTROLLER"; private final DCAEControllerClient dcaeControllerClient; private final DatabusControllerClient databusControllerClient; + public DcaeServicesApiServiceImpl(DCAEControllerClient dcaeControllerClient, DatabusControllerClient databusControllerClient) { + this.dcaeControllerClient = dcaeControllerClient; + this.databusControllerClient = databusControllerClient; + } + private DCAEService createDCAEService(DCAEServiceObject serviceObject, Collection<DCAEServiceComponentObject> componentObjects, UriInfo uriInfo) { // TODO: Complete links: come back and do links for vnf @@ -67,7 +72,6 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService { service.setCreated(serviceObject.getCreated().toDate()); service.setModified(serviceObject.getModified().toDate()); service.setVnfId(serviceObject.getVnfId()); - //service.setVnfLink(vnfLink); service.setVnfType(serviceObject.getVnfType()); service.setVnfLocation(serviceObject.getVnfLocation()); service.setDeploymentRef(serviceObject.getDeploymentRef()); @@ -380,6 +384,7 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService { return Response.ok().entity(service).build(); } + @Override public Response dcaeServicesServiceIdDelete(String serviceId, SecurityContext securityContext) throws NotFoundException { DCAEServicesDAO servicesDAO = InventoryDAOManager.getInstance().getDCAEServicesDAO(); @@ -393,9 +398,4 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService { return Response.ok().build(); } - public DcaeServicesApiServiceImpl(DCAEControllerClient dcaeControllerClient, DatabusControllerClient databusControllerClient) { - this.dcaeControllerClient = dcaeControllerClient; - this.databusControllerClient = databusControllerClient; - } - } |