Class SdhService
- java.lang.Object
-
- com.neotropic.kuwaiba.modules.commercial.sdh.SdhService
-
@Service public class SdhService extends Object
Service to manage SDH Networks- Author:
- Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASS_GENERICEQUIPMENT
Root of all equipment that can be connected using SDH linksstatic String
CLASS_GENERICLOGICALCONNECTION
Root of all logical connectionsstatic String
CLASS_GENERICSDHHIGHORDERCONTAINERLINK
Root of all high order container linksstatic String
CLASS_GENERICSDHHIGHORDERTRIBUTARYLINK
Root of all low order container linksstatic String
CLASS_GENERICSDHSERVICE
Root of all SDH (and over SDH) servicesstatic String
CLASS_VC12
Class representing a VC12static String
CLASS_VC3
Class representing a VC3static String
CLASS_VC4
Class representing a VC4static String
CLASS_VIEW
Class to identify all views made using the SDH module
-
Constructor Summary
Constructors Constructor Description SdhService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
calculateContainerLinkCapacity(String connectionClass)
Calculates a link capacity based on the class namestatic int
calculateTransportLinkCapacity(String connectionClass)
Calculates a link capacity based on the class nameString
createSDHContainerLink(String classNameEndpointA, String idEndpointA, String classNameEndpointB, String idEndpointB, String linkType, List<SdhPosition> positions, String defaultName)
Creates an SDH container link (VCX).String
createSDHTransportLink(String classNameEndpointA, String idEndpointA, String classNameEndpointB, String idEndpointB, String linkType, String defaultName)
Creates an SDH transport link (STMX)String
createSDHTributaryLink(String classNameEndpointA, String idEndpointA, String classNameEndpointB, String idEndpointB, String linkType, List<SdhPosition> positions, String defaultName)
Creates an SDH tributary link (VCXTributaryLink)void
deleteSDHContainerLink(String containerLinkClass, String containerLinkId, boolean forceDelete)
Deletes a container link.void
deleteSDHTransportLink(String transportLinkClass, String transportLinkId, boolean forceDelete)
Deletes a transport linkvoid
deleteSDHTributaryLink(String tributaryLinkClass, String tributaryLinkId)
Deletes a tributary link and its corresponding container link.List<BusinessObjectLightList>
findSDHRoutesUsingContainerLinks(String communicationsEquipmentClassA, String communicationsEquipmentIdA, String communicationsEquipmentClassB, String communicationsEquipmentIB)
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)List<BusinessObjectLightList>
findSDHRoutesUsingTransportLinks(String communicationsEquipmentClassA, String communicationsEquipmentIdA, String communicationsEquipmentClassB, String communicationsEquipmentIB)
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)List<SdhContainerLinkDefinition>
getSDHContainerLinkStructure(String containerLinkClass, String containerLinkId)
Gets the internal structure of a container link.List<SdhContainerLinkDefinition>
getSDHTransportLinkStructure(String transportLinkClass, String transportLinkId)
Retrieves the container links within a transport link (e.g.
-
-
-
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
-
CLASS_VC12
public static final String CLASS_VC12
Class representing a VC12- See Also:
- Constant Field Values
-
CLASS_VC3
public static final String CLASS_VC3
Class representing a VC3- See Also:
- Constant Field Values
-
CLASS_VC4
public static final String CLASS_VC4
Class representing a VC4- See Also:
- Constant Field Values
-
-
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 AclassNameEndpointB
- The class name of the endpoint B (some kind of port)idEndpointB
- Id of endpoint BlinkType
- 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 AclassNameEndpointB
- The class name of the endpoint B (GenericCommunicationsEquipment)idEndpointB
- Id of endpoint BlinkType
- 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 sorteddefaultName
- 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 AclassNameEndpointB
- The class name of the endpoint B (some kind of tributary port)idEndpointB
- Id of endpoint BlinkType
- 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 itdefaultName
- 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 classtransportLinkId
- Transport link idforceDelete
- Delete recursively all SDH elements transported by the transport link- Throws:
InvalidArgumentException
- If something goes wrongInventoryException
- 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 classcontainerLinkId
- Container class idforceDelete
- Delete recursively all sdh elements contained by the container link- Throws:
InvalidArgumentException
- If some high level thing goes wrongInventoryException
- 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 linktributaryLinkId
- the id of the tributary link- Throws:
InvalidArgumentException
- If some high level thing goes wrongInventoryException
- 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 endpointscommunicationsEquipmentIdA
- The id of one of the route endpointscommunicationsEquipmentClassB
- The class of the other route endpointcommunicationsEquipmentIB
- 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 existInvalidArgumentException
- 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 endpointscommunicationsEquipmentIdA
- The id of one of the route endpointscommunicationsEquipmentClassB
- The class of the other route endpointcommunicationsEquipmentIB
- 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 GenericCommunicationsEquipmentMetadataObjectNotFoundException
- If the core classes that support the SDH networks model don't exist
-
getSDHTransportLinkStructure
public List<SdhContainerLinkDefinition> getSDHTransportLinkStructure(String transportLinkClass, String transportLinkId) throws InvalidArgumentException, BusinessObjectNotFoundException, MetadataObjectNotFoundException
Retrieves the container links within a transport link (e.g. the VC4XX in and STMX)- Parameters:
transportLinkClass
- TransportLink's classtransportLinkId
- TransportLink's id- Returns:
- The list of the containers that go through that transport link
- Throws:
InvalidArgumentException
- If the given transport link is no subclass of GenericSDHTransportLinkBusinessObjectNotFoundException
- if the given transport link does not existMetadataObjectNotFoundException
- If any of the core classes that support the SDH networks model does not exist
-
getSDHContainerLinkStructure
public List<SdhContainerLinkDefinition> getSDHContainerLinkStructure(String containerLinkClass, String containerLinkId) throws InvalidArgumentException, BusinessObjectNotFoundException, MetadataObjectNotFoundException
Gets the internal structure of a container link. This is useful to provide information about the occupation of a link. This is only applicable to VC4XX- Parameters:
containerLinkClass
- Container classcontainerLinkId
- Container Id- Returns:
- The list of containers contained in the container
- Throws:
InvalidArgumentException
- If the container supplied is not subclass of GenericSDHHighOrderContainerLinkBusinessObjectNotFoundException
- If the container could not be foundMetadataObjectNotFoundException
- If the class could not be found
-
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
-
-