Class VirtualServiceController


  • @RestController("virtualServiceController")
    public class VirtualServiceController
    extends java.lang.Object
    This is a entry point to to record mock data in the Virtualan.

    Virtualan-UI and Virtualan-OpenAPI would interact through this web services.

    Author:
    Elan Thangamani
    • Field Detail

      • VS_REQUEST_BODY_MISMATCH

        public static final java.lang.String VS_REQUEST_BODY_MISMATCH
        The constant VS_REQUEST_BODY_MISMATCH.
        See Also:
        Constant Field Values
    • Constructor Detail

      • VirtualServiceController

        public VirtualServiceController()
    • Method Detail

      • getVirtualService

        public VirtualService getVirtualService()
        Gets virtual service.
        Returns:
        the virtual service
      • setVirtualService

        public void setVirtualService​(VirtualService virtualService)
        Sets virtual service.
        Parameters:
        virtualService - the virtual service
      • getVirtualServiceInfo

        public VirtualServiceInfo getVirtualServiceInfo()
        Gets virtual service info.
        Returns:
        the virtual service info
      • applicationName

        @GetMapping("/virtualservices/app-name")
        public java.lang.String applicationName()
        Application name string.
        Returns:
        the string
      • listAllMockLoadRequest

        @GetMapping("/virtualservices/load")
        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​VirtualServiceRequest>> listAllMockLoadRequest()
                                                                                                                                 throws java.lang.InstantiationException,
                                                                                                                                        java.lang.IllegalAccessException,
                                                                                                                                        java.lang.ClassNotFoundException,
                                                                                                                                        java.io.IOException
        List all mock load request map.
        Returns:
        the map
        Throws:
        java.lang.InstantiationException - the instantiation exception
        java.lang.IllegalAccessException - the illegal access exception
        java.lang.ClassNotFoundException - the class not found exception
        java.io.IOException - the io exception
      • listAllMockLoadRequests

        @GetMapping("/virtualservices")
        public org.springframework.http.ResponseEntity<java.util.List<VirtualServiceRequest>> listAllMockLoadRequests()
        List all mock load requests response entity.
        Returns:
        the response entity
      • getMockLoadRequest

        @GetMapping(value="/virtualservices/{id}",
                    produces="application/json")
        public org.springframework.http.ResponseEntity<VirtualServiceRequest> getMockLoadRequest​(@PathVariable("id")
                                                                                                 long id)
        Gets mock load request.
        Parameters:
        id - the id
        Returns:
        the mock load request
      • createVirtualanApis

        @PostMapping("/virtualservices/apis")
        public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​VirtualServiceRequest>>> createVirtualanApis​(@Valid @RequestPart(value="openApiUrl",required=true)
                                                                                                                                                                              @Valid org.springframework.web.multipart.MultipartFile openApiUrl,
                                                                                                                                                                              @Valid @RequestPart(value="skipValidation",required=false)
                                                                                                                                                                              @Valid java.lang.String skipValidation)
                                                                                                                                                                       throws java.io.IOException,
                                                                                                                                                                              java.lang.InstantiationException,
                                                                                                                                                                              java.lang.IllegalAccessException,
                                                                                                                                                                              java.lang.ClassNotFoundException
        Create mock request response entity.
        Returns:
        the response entity
        Throws:
        java.io.IOException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.ClassNotFoundException
      • deleteVirtualanApis

        @DeleteMapping("/virtualservices/apis")
        public org.springframework.http.ResponseEntity deleteVirtualanApis​(@Valid @RequestParam(value="apiName",required=false)
                                                                           @Valid java.lang.String apiName)
                                                                    throws java.lang.Exception
        remove virtual api by the name of the service.
        Returns:
        the response entity
        Throws:
        java.lang.Exception
      • createMockRequest

        @PostMapping("/virtualservices")
        public org.springframework.http.ResponseEntity createMockRequest​(@RequestBody
                                                                         VirtualServiceRequest virtualServiceRequest)
        Create mock request response entity.
        Parameters:
        virtualServiceRequest - the virtual service request
        Returns:
        the response entity
      • updateMockRequest

        @PutMapping("/virtualservices/{id}")
        public org.springframework.http.ResponseEntity<VirtualServiceRequest> updateMockRequest​(@PathVariable("id")
                                                                                                long id,
                                                                                                @RequestBody
                                                                                                VirtualServiceRequest mockLoadRequest)
                                                                                         throws java.lang.ClassNotFoundException,
                                                                                                java.lang.InstantiationException,
                                                                                                java.lang.IllegalAccessException,
                                                                                                com.fasterxml.jackson.core.JsonProcessingException
        Update mock request response entity.
        Parameters:
        id - the id
        mockLoadRequest - the mock load request
        Returns:
        the response entity
        Throws:
        java.lang.ClassNotFoundException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        com.fasterxml.jackson.core.JsonProcessingException
      • deleteMockRequest

        @DeleteMapping("/virtualservices/{id}")
        public org.springframework.http.ResponseEntity<VirtualServiceRequest> deleteMockRequest​(@PathVariable("id")
                                                                                                long id)
        Delete mock request response entity.
        Parameters:
        id - the id
        Returns:
        the response entity
      • readCatalog

        @GetMapping("/api-catalogs")
        public org.springframework.http.ResponseEntity<java.util.List<java.lang.String>> readCatalog()
        Read catalog response entity.
        Returns:
        the response entity
      • readCatalog

        @GetMapping("/api-catalogs/{name}")
        public org.springframework.http.ResponseEntity<java.util.List<java.lang.String>> readCatalog​(@PathVariable("name")
                                                                                                     java.lang.String name)
        Read catalog response entity.
        Parameters:
        name - the name
        Returns:
        the response entity