Class AbstractSyncProvider
- java.lang.Object
-
- org.neotropic.kuwaiba.modules.commercial.sync.model.AbstractSyncProvider
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BridgeDomainSyncProvider
public abstract class AbstractSyncProvider extends Object implements Serializable
This class describes the generic behavior of all the synchronization providers. A sync provider is just a bunch of logic that actually performs the actions associated to a set of business rules when differences are found between the information retrieved from sync data sources (SNMP-enabled devices, NMS, legacy systems, third-party monitoring systems, etc) and the information in the inventory. The flow is basically the following:- A Sync Job (a simple Java EE batch job) is started.
- The sync job connects to the sync data sources (devices, databases, etc) and retrieves the information defined in the Sync Data Definition Artifact, which is a file or a Kuwaiba database entry (depends on the implementation) that contains what information will be retrieved from the sync data sources (columns of a table, OIDs, etc)
- The next stage of the Sync Job asks the Sync Provider to find the differences between the info extracted from the sync data source and the corresponding info in Kuwaiba. The sync provider will return the differences
- The Sync Job either forward the differences to the user requesting for authorization to perform actions (create/delete elements, update properties, etc) or will perform them automatically
- The sync job performs the actions with external intervention (e.g. human approval) or automatically, depending on how the sync provider is configured
- Author:
- Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractSyncProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract List<SyncResult>
automatedSync(List<AbstractDataEntity> originalData)
Implement this method if the supervised synchronization process won't be associated to a single object in the inventory, for example, if you want to see what virtual circuits were re-routed after switching to a backup link during a network failureabstract List<SyncResult>
automatedSync(PollResult pollResult)
Implement this method if the supervised synchronization process will be associated to an object in the inventory, for example, you will retrieve the hardware information about a network element and find what has changed overnight.abstract List<SyncResult>
finalize(List<SyncAction> actions)
Performs the actual actionsabstract String
getDisplayName()
Display name/description of what the providers doesabstract String
getId()
A string that uniquely identifies the current sync providerabstract boolean
isAutomated()
Should the actions defined after finding the differences between the information retrieved from the sync data sources and the objects in the inventory be performed automatically or wait for approvalabstract PollResult
mappedPoll(SynchronizationGroup syncGroup)
Some synchronization processes are related to a specific inventory object (for example when syncing the hardware of a given device).abstract List<SyncFinding>
supervisedSync(List<AbstractDataEntity> originalData)
Implement this method if the supervised synchronization process won't be associated to a single object in the inventory, for example, if you want to see what virtual circuits were re-routed after switching to a backup link during a network failureabstract List<SyncFinding>
supervisedSync(PollResult pollResult)
Implement this method if the supervised synchronization process will be associated to an object in the inventory, for example, you will retrieve the hardware information about a network element and find what has changed overnight.abstract List<AbstractDataEntity>
unmappedPoll(SynchronizationGroup syncGroup)
Some synchronization processes are related to a specific inventory object (for example when syncing the hardware of a given device).
-
-
-
Method Detail
-
getDisplayName
public abstract String getDisplayName()
Display name/description of what the providers does- Returns:
- The configured name/description (typically a hard-coded string)
-
getId
public abstract String getId()
A string that uniquely identifies the current sync provider- Returns:
-
isAutomated
public abstract boolean isAutomated()
Should the actions defined after finding the differences between the information retrieved from the sync data sources and the objects in the inventory be performed automatically or wait for approval- Returns:
- True if it doesn't require approval, False otherwise
-
unmappedPoll
public abstract List<AbstractDataEntity> unmappedPoll(SynchronizationGroup syncGroup)
Some synchronization processes are related to a specific inventory object (for example when syncing the hardware of a given device). But there are some other scenarios where the the sync process uses information from many sources and none of them are necessarily mapped to an inventory object. A common example is when the sync process does not retrieve information from particular devices, but from an NMS, and the NMS provides information about the whole network, e.g. the logical circuits between different nodes in the network. This method should be implemented for the latter.- Parameters:
syncGroup
- The sync group to be synchronized- Returns:
- The raw information necessary to actually perform the synchronization process. This information is not related to any particular inventory object.
-
mappedPoll
public abstract PollResult mappedPoll(SynchronizationGroup syncGroup)
Some synchronization processes are related to a specific inventory object (for example when syncing the hardware of a given device). But there are some other scenarios where the the sync process uses information from many sources and none of them are necessarily mapped to an inventory object. A common example is when the sync process does not retrieve information from particular devices, but from an NMS, and the NMS provides information about the whole network, e.g. the logical circuits between different nodes in the network. This method should be implemented for the former.- Parameters:
syncGroup
- The sync group to be synchronized- Returns:
- The raw information necessary to actually perform the synchronization process. Each PollResult object contains the information of how the polling process turned out per each one of the Sync Configurations contained in the Sync Group, that is, each PollResult maps an inventory object
-
supervisedSync
public abstract List<SyncFinding> supervisedSync(PollResult pollResult)
Implement this method if the supervised synchronization process will be associated to an object in the inventory, for example, you will retrieve the hardware information about a network element and find what has changed overnight.- Parameters:
pollResult
- A set of high-level representations of the info coming from the sync data source and the corresponding inventory object it should be mapped against (for example, a Java matrix representing an SNMP table)- Returns:
- A set of results (e.g. new board on slot xxx, different serial number found for router yyyy)
-
supervisedSync
public abstract List<SyncFinding> supervisedSync(List<AbstractDataEntity> originalData)
Implement this method if the supervised synchronization process won't be associated to a single object in the inventory, for example, if you want to see what virtual circuits were re-routed after switching to a backup link during a network failure- Parameters:
originalData
- A set of high-level representations of the info coming from the sync data source (for example, a Java list representing the hops of a virtual circuits)- Returns:
- A set of results (circuit YYY has a new route zzzz)
-
automatedSync
public abstract List<SyncResult> automatedSync(List<AbstractDataEntity> originalData)
Implement this method if the supervised synchronization process won't be associated to a single object in the inventory, for example, if you want to see what virtual circuits were re-routed after switching to a backup link during a network failure- Parameters:
originalData
- A set of high-level representations of the info coming from the sync data source (for example, a Java list representing the hops of a virtual circuits)- Returns:
- A set of results (e.g. circuit YYY was re-routed to zzzz)
-
automatedSync
public abstract List<SyncResult> automatedSync(PollResult pollResult)
Implement this method if the supervised synchronization process will be associated to an object in the inventory, for example, you will retrieve the hardware information about a network element and find what has changed overnight.- Parameters:
pollResult
- A set of high-level representations of the info coming from the sync data source and the corresponding inventory object it should be mapped against (for example, a Java matrix representing an SNMP table)- Returns:
- A set of results (e.g. new board on slot xxx was created, different serial number was set to router yyyy)
-
finalize
public abstract List<SyncResult> finalize(List<SyncAction> actions)
Performs the actual actions- Parameters:
actions
-- Returns:
-
-