Class PersistenceUtil
- java.lang.Object
-
- org.neotropic.kuwaiba.modules.commercial.sync.PersistenceUtil
-
@Component public class PersistenceUtil extends Object
- Author:
- Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
-
-
Field Summary
Fields Modifier and Type Field Description static ObjectGraphMappingService
ogmService
-
Constructor Summary
Constructors Constructor Description PersistenceUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GenericObjectList
createGenericObjectListFromNode(org.neo4j.graphdb.Node node)
Creates a generic object list (a list type) from a nodestatic SyncDataSourceConfiguration
createSyncDataSourceConfigFromNode(org.neo4j.graphdb.Node syncDataSourceConfigNode)
Converts a node to a SyncDataSourceConfiguration objectstatic SyncDataSourceCommonParameters
createSyncDSCommonPropertiesFromNode(org.neo4j.graphdb.Node syncDSCommonPropertiesNode)
Converts a node to a SyncDataSourceConfiguration objectstatic SynchronizationGroup
createSyncGroupFromNode(org.neo4j.graphdb.Node syncGroupNode)
Converts a node representing a Node into a SynchronizationGroup objectvoid
setObjectGraphMappingService(ObjectGraphMappingService ogmService)
Reference to the service that maps nodes to inventory/application objects
-
-
-
Field Detail
-
ogmService
public static ObjectGraphMappingService ogmService
-
-
Method Detail
-
createSyncGroupFromNode
public static SynchronizationGroup createSyncGroupFromNode(org.neo4j.graphdb.Node syncGroupNode) throws InvalidArgumentException, MetadataObjectNotFoundException, UnsupportedPropertyException
Converts a node representing a Node into a SynchronizationGroup object- Parameters:
syncGroupNode
- The source node- Returns:
- A SynchronizationGroup object built from the source node information
- Throws:
InvalidArgumentException
- if some element of the list of syncDataSourceConfiguration has more paramNames than paramValuesMetadataObjectNotFoundException
- If can not find the class name of the device related with the data source configuration.UnsupportedPropertyException
- If the sync group can not be mapped into a Java object.
-
createSyncDataSourceConfigFromNode
public static SyncDataSourceConfiguration createSyncDataSourceConfigFromNode(org.neo4j.graphdb.Node syncDataSourceConfigNode) throws UnsupportedPropertyException, InvalidArgumentException
Converts a node to a SyncDataSourceConfiguration object- Parameters:
syncDataSourceConfigNode
- The source node- Returns:
- A SyncDataSourceConfiguration object built from the source node information
- Throws:
InvalidArgumentException
- if some element of the list of syncDataSourceConfiguration has more paramNames than paramValuesUnsupportedPropertyException
- if any property of the sync data source node is malformed or if there is an error with the relationship between the syncNode and it InventoryObjectNode
-
createGenericObjectListFromNode
public static GenericObjectList createGenericObjectListFromNode(org.neo4j.graphdb.Node node) throws InvalidArgumentException
Creates a generic object list (a list type) from a node- Parameters:
node
- the list type node- Returns:
- a list type The specified list type node is malformed and lacks uuid property.
- Throws:
InvalidArgumentException
- if some element of the list of syncDataSourceConfiguration has more paramNames than paramValues
-
createSyncDSCommonPropertiesFromNode
public static SyncDataSourceCommonParameters createSyncDSCommonPropertiesFromNode(org.neo4j.graphdb.Node syncDSCommonPropertiesNode) throws UnsupportedPropertyException, InvalidArgumentException
Converts a node to a SyncDataSourceConfiguration object- Parameters:
syncDSCommonPropertiesNode
- The source node- Returns:
- A SyncDataSourceCommonParameters object built from the source node information
- Throws:
InvalidArgumentException
- if the size of the list of paramNames and paramValues are not the sameUnsupportedPropertyException
- if any property of the sync data source node is malformed or if there is an error with the relationship between the syncNode and it InventoryObjectNode
-
setObjectGraphMappingService
@Autowired public void setObjectGraphMappingService(ObjectGraphMappingService ogmService)
Reference to the service that maps nodes to inventory/application objects
-
-