Class SdhService


  • @Service
    public class SdhService
    extends Object
    Service to manage SDH Networks
    Author:
    Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
    • Field Detail

      • CLASS_VIEW

        public static String CLASS_VIEW
        Class to identify all views made using the SDH module
      • CLASS_GENERICSDHHIGHORDERCONTAINERLINK

        public static String CLASS_GENERICSDHHIGHORDERCONTAINERLINK
        Root of all high order container links
      • CLASS_GENERICSDHHIGHORDERTRIBUTARYLINK

        public static String CLASS_GENERICSDHHIGHORDERTRIBUTARYLINK
        Root of all low order container links
      • CLASS_GENERICEQUIPMENT

        public static String CLASS_GENERICEQUIPMENT
        Root of all equipment that can be connected using SDH links
      • CLASS_GENERICSDHSERVICE

        public static String CLASS_GENERICSDHSERVICE
        Root of all SDH (and over SDH) services
      • CLASS_GENERICLOGICALCONNECTION

        public static String CLASS_GENERICLOGICALCONNECTION
        Root of all logical connections
    • Constructor Detail

      • SdhService

        public SdhService()
    • Method Detail

      • createSDHTransportLink

        public String createSDHTransportLink​(String classNameEndpointA,
                                             String idEndpointA,
                                             String classNameEndpointB,
                                             String idEndpointB,
                                             String linkType,
                                             String defaultName)
                                      throws InvalidArgumentException,
                                             BusinessObjectNotFoundException,
                                             InventoryException
        Creates an SDH transport link (STMX)
        Parameters:
        classNameEndpointA - The class name of the endpoint A (some kind of port)
        idEndpointA - Id of endpoint A
        classNameEndpointB - The class name of the endpoint B (some kind of port)
        idEndpointB - Id of endpoint B
        linkType - Type of link (STM1, STM4, STM16, STM256, etc)
        defaultName - The default name of the element
        Returns:
        The id of the newly created transport link
        Throws:
        InvalidArgumentException - If the module can not contact the persistence service or the class provided is not eligible to be used as an SDH entity.
        BusinessObjectNotFoundException - If any of the ports involved could not be found.
        InventoryException - If an unexpected error occurs.
      • createSDHContainerLink

        public String createSDHContainerLink​(String classNameEndpointA,
                                             String idEndpointA,
                                             String classNameEndpointB,
                                             String idEndpointB,
                                             String linkType,
                                             List<SdhPosition> positions,
                                             String defaultName)
                                      throws InvalidArgumentException
        Creates an SDH container link (VCX). In practical terms, it's always a high order container, such a VC4XXX
        Parameters:
        classNameEndpointA - The class name of the endpoint A (a GenericCommunicationsEquipment)
        idEndpointA - Id of endpoint A
        classNameEndpointB - The class name of the endpoint B (GenericCommunicationsEquipment)
        idEndpointB - Id of endpoint B
        linkType - Type of link (VC4, VC3, V12, etc. A VC12 alone doesn't make much sense, though)
        positions - This param specifies the transport links and positions used by the container. For more details on how this works, please read the "SDH Model: Technical Design and Tools" document. Please note that is greatly advisable to provide them already sorted
        defaultName - the name to be assigned to the new element. If null, an empty string will be used
        Returns:
        The id of the newly created container link
        Throws:
        InvalidArgumentException - In case something goes wrong with the creation process
      • createSDHTributaryLink

        public String createSDHTributaryLink​(String classNameEndpointA,
                                             String idEndpointA,
                                             String classNameEndpointB,
                                             String idEndpointB,
                                             String linkType,
                                             List<SdhPosition> positions,
                                             String defaultName)
                                      throws InvalidArgumentException
        Creates an SDH tributary link (VCXTributaryLink)
        Parameters:
        classNameEndpointA - The class name of the endpoint A (some kind of tributary port)
        idEndpointA - Id of endpoint A
        classNameEndpointB - The class name of the endpoint B (some kind of tributary port)
        idEndpointB - Id of endpoint B
        linkType - Type of link (VC4TributaryLink, VC3TributaryLink, V12TributaryLink, etc)
        positions - This param specifies the transport links and positions used by the container. For more details on how this works, please read the SDH Model: Technical Design and Tools document. Please note that is greatly advisable to provide them already sorted. Please note that creating a tributary link automatically creates a container link to deliver it
        defaultName - the name to be assigned to the new element
        Returns:
        The id of the newly created tributary link
        Throws:
        InvalidArgumentException - In case something goes wrong with the creation process
      • deleteSDHTransportLink

        public void deleteSDHTransportLink​(String transportLinkClass,
                                           String transportLinkId,
                                           boolean forceDelete)
                                    throws InvalidArgumentException,
                                           InventoryException
        Deletes a transport link
        Parameters:
        transportLinkClass - Transport Link class
        transportLinkId - Transport link id
        forceDelete - Delete recursively all SDH elements transported by the transport link
        Throws:
        InvalidArgumentException - If something goes wrong
        InventoryException - If the transport link could not be found
      • deleteSDHContainerLink

        public void deleteSDHContainerLink​(String containerLinkClass,
                                           String containerLinkId,
                                           boolean forceDelete)
                                    throws InventoryException
        Deletes a container link.
        Parameters:
        containerLinkClass - Container link class
        containerLinkId - Container class id
        forceDelete - Delete recursively all sdh elements contained by the container link
        Throws:
        InvalidArgumentException - If some high level thing goes wrong
        InventoryException - If some low level thing goes wrong
      • deleteSDHTributaryLink

        public void deleteSDHTributaryLink​(String tributaryLinkClass,
                                           String tributaryLinkId)
                                    throws InvalidArgumentException,
                                           InventoryException
        Deletes a tributary link and its corresponding container link. This method will delete all the object relationships
        Parameters:
        tributaryLinkClass - The class of the tributary link
        tributaryLinkId - the id of the tributary link
        Throws:
        InvalidArgumentException - If some high level thing goes wrong
        InventoryException - If some low level thing goes wrong
      • findSDHRoutesUsingTransportLinks

        public List<BusinessObjectLightList> findSDHRoutesUsingTransportLinks​(String communicationsEquipmentClassA,
                                                                              String communicationsEquipmentIdA,
                                                                              String communicationsEquipmentClassB,
                                                                              String communicationsEquipmentIB)
                                                                       throws InvalidArgumentException,
                                                                              MetadataObjectNotFoundException
        Finds a route between two GenericCommunicationsEquipment based on the TransportLinks network map (for more details on how this works, please read the SDH Model: Technical Design and Tools document)
        Parameters:
        communicationsEquipmentClassA - The class of one of the route endpoints
        communicationsEquipmentIdA - The id of one of the route endpoints
        communicationsEquipmentClassB - The class of the other route endpoint
        communicationsEquipmentIB - The id of the other route endpoint
        Returns:
        A sorted list of RemoteObjectLights containing the route. This list includes the transport links and the nodes in between, including the very endpoints
        Throws:
        MetadataObjectNotFoundException - If the core classes that support the SDH networks model don't exist
        InvalidArgumentException - If the given communication equipment is no subclass of GenericCommunicationsEquipment
      • findSDHRoutesUsingContainerLinks

        public List<BusinessObjectLightList> findSDHRoutesUsingContainerLinks​(String communicationsEquipmentClassA,
                                                                              String communicationsEquipmentIdA,
                                                                              String communicationsEquipmentClassB,
                                                                              String communicationsEquipmentIB)
                                                                       throws InvalidArgumentException,
                                                                              MetadataObjectNotFoundException
        Finds a route between two GenericcommunicationsEquipment based on the ContainerLinks network map (for more details on how this works, please read the SDH Model: Technical Design and Tools document)
        Parameters:
        communicationsEquipmentClassA - The class of one of the route endpoints
        communicationsEquipmentIdA - The id of one of the route endpoints
        communicationsEquipmentClassB - The class of the other route endpoint
        communicationsEquipmentIB - The id of the other route endpoint
        Returns:
        A sorted list of RemoteObjectLights containing the route. This list includes the transport links and the nodes in between, including the very endpoints
        Throws:
        InvalidArgumentException - If the given communication equipment is no subclass of GenericCommunicationsEquipment
        MetadataObjectNotFoundException - If the core classes that support the SDH networks model don't exist
      • calculateTransportLinkCapacity

        public static int calculateTransportLinkCapacity​(String connectionClass)
        Calculates a link capacity based on the class name
        Parameters:
        connectionClass - The class of the link to be evaluated
        Returns:
        The maximum number of timeslots in a transport link
      • calculateContainerLinkCapacity

        public static int calculateContainerLinkCapacity​(String connectionClass)
        Calculates a link capacity based on the class name
        Parameters:
        connectionClass - The class of the link to be evaluated
        Returns:
        The maximum number of timeslots in a container or transport link