Class OutsidePlantRestController

  • All Implemented Interfaces:
    OutsidePlantRestOpenApi

    @RestController
    @RequestMapping("/v2.1.1/osp-manager/")
    public class OutsidePlantRestController
    extends Object
    implements OutsidePlantRestOpenApi
    Outside Plant Rest Controller.
    Author:
    Mauricio Ruiz Beltrán <mauricio.ruiz@kuwaiba.org>
    • Constructor Detail

      • OutsidePlantRestController

        public OutsidePlantRestController()
    • Method Detail

      • createOSPView

        @RequestMapping(method=POST,
                        value="createOSPView/{name}/{description}/{structure}/{sessionId}",
                        produces="application/json")
        public long createOSPView​(@PathVariable("name")
                                  String name,
                                  @PathVariable("description")
                                  String description,
                                  @PathVariable("structure")
                                  String structure,
                                  @PathVariable("sessionId")
                                  String sessionId)
        Creates an Outside Plant View.
        Specified by:
        createOSPView in interface OutsidePlantRestOpenApi
        Parameters:
        name - The name of the new view.
        description - The description of the new view.
        structure - The structure of the view as string Base64, from the XML document with the contents of the view. The format of the XML document is consistent with the other views:
         
          <view version="">
              <class>OSPView</class>
              <center lon="" lat=""></center>
              <zoom>0</zoom>
              <nodes>
                  <node lon="" lat="" class="businessObjectClass">businessObjectId</node>
              </nodes>
              <edges>
                  <edge id="" class="" asideid="" asideclass="" bsideid="" bsideclass="">
                      <controlpoint lon="" lat=""></controlpoint>
                  </edge>
              </edges>
          </view>
         
         
        sessionId - The session token id.
        Returns:
        The id of the newly created view.
      • getOSPView

        @RequestMapping(method=GET,
                        value="getOSPView/{id}/{sessionId}",
                        produces="application/json")
        public ViewObject getOSPView​(@PathVariable("id")
                                     long id,
                                     @PathVariable("sessionId")
                                     String sessionId)
        Retrieves the specific information about an existing OSP view.
        Specified by:
        getOSPView in interface OutsidePlantRestOpenApi
        Parameters:
        id - The id of the view.
        sessionId - The session token id.
        Returns:
        An object containing the view details and structure.
      • getOSPViews

        @RequestMapping(method=GET,
                        value="getOSPViews/{sessionId}",
                        produces="application/json")
        public List<ViewObjectLight> getOSPViews​(@PathVariable("sessionId")
                                                 String sessionId)
        Retrieves the existing OSP views.
        Specified by:
        getOSPViews in interface OutsidePlantRestOpenApi
        Parameters:
        sessionId - The session token id.
        Returns:
        The list of existing OSP views.
      • updateOSPView

        @RequestMapping(method=PUT,
                        value="updateOSPView/{id}/{name}/{description}/{structure}/{sessionId}",
                        produces="application/json")
        public void updateOSPView​(@PathVariable("id")
                                  long id,
                                  @PathVariable("name")
                                  String name,
                                  @PathVariable("description")
                                  String description,
                                  @PathVariable("structure")
                                  String structure,
                                  @PathVariable("sessionId")
                                  String sessionId)
        Updates an existing OSP view.
        Specified by:
        updateOSPView in interface OutsidePlantRestOpenApi
        Parameters:
        id - The id of the view.
        name - The new name of the view. Null if to remain unchanged.
        description - The new description of the view. Null if to remain unchanged.
        structure - The structure of the view as string Base64, from the XML document with the contents of the view. The format of the XML document is consistent with the other views:
         
          <view version="">
              <class>OSPView</class>
              <center lon="" lat=""></center>
              <zoom>0</zoom>
              <nodes>
                  <node lon="" lat="" class="businessObjectClass">businessObjectId</node>
              </nodes>
              <edges>
                  <edge id="" class="" asideid="" asideclass="" bsideid="" bsideclass="">
                      <controlpoint lon="" lat=""></controlpoint>
                  </edge>
              </edges>
          </view>
         
         
        sessionId - The session token id.
      • deleteOSPView

        @RequestMapping(method=DELETE,
                        value="deleteOSPView/{id}/{sessionId}",
                        produces="application/json")
        public void deleteOSPView​(@PathVariable("id")
                                  long id,
                                  @PathVariable("sessionId")
                                  String sessionId)
        Deletes an existing OSP view.
        Specified by:
        deleteOSPView in interface OutsidePlantRestOpenApi
        Parameters:
        id - The id of the view to be deleted.
        sessionId - The session token id.