Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
firstline1
titleAlgorithm
writeDataJob(dataJobId, DataJobMetadata, DataJobWriteRequest) {

	Map<ProducerKey, Collection> producerKeyMap = new HashMap()
	
	FOR writeRequest in DataJobWriteRequest

		dataNode = inventoryPersistence.getCmHandleDataNodeByLongestMatchAlternateId(writeOperation.path())		
		ProducerKey prodKey = new ProducerKey( dataNode.dmiServiceName, dataProducerIdentifier)
		SubJob sjwr = createSubJobWriteRequestcreateSubJob(DataJobMetadata, dataNode, dataJobId) // method to create the request
		
		if (producerKeyMap.contains(prodKey)
			// update the Map's collection with the new request
		else
			producerKeyMap.put(prodKey, sjwr)
	END FOR
	
	FOR value in producerKeyMap
		dmiUrl = DmiServiceUrlBuilder.createUrlForSubJob() // new method
		dmiRestClient.postOperation( value ) // send each collection of subjobs to the right DMI plugin
	END FOR
}

...