question: private URI createEthernetStoragePort ( Map < String , Object > keyMap , StoragePort port , String name , String portInstanceID , List < StoragePort > newPorts , List < StoragePort > existingPorts ) throws IOException { StoragePort portinMemory = ( StoragePort ) keyMap . get ( portInstanceID ) ; if ( null == port ) { portinMemory . setPortNetworkId ( name ) ; portinMemory . setPortEndPointID ( name ) ; String portNativeGuid = NativeGUIDGenerator . generateNativeGuid ( _dbClient , portinMemory ) ; portinMemory . setNativeGuid ( portNativeGuid ) ; portinMemory . setLabel ( portNativeGuid ) ; _dbClient . createObject ( portinMemory ) ; newPorts . add ( portinMemory ) ; return portinMemory . getId ( ) ; } else { port . setPortName ( portinMemory . getPortName ( ) ) ; port . setPortSpeed ( portinMemory . getPortSpeed ( ) ) ; port . setPortEndPointID ( name ) ; port . setCompatibilityStatus ( portinMemory . getCompatibilityStatus ( ) ) ; port . setDiscoveryStatus ( portinMemory . getDiscoveryStatus ( ) ) ; port . setOperationalStatus ( portinMemory . getOperationalStatus ( ) ) ; port . setPortType ( portinMemory . getPortType ( ) ) ; _dbClient . persistObject ( port ) ; existingPorts . add ( port ) ; return port . getId ( ) ; } }
target:  create Ethernet Storage Port. StoragePorts would have been created in SToragePorts Processor, but for ethernet those will not get updated to DB, as to get SCSIAddress ,we need a different SMI Class ProtocolEndPoint Algo : 1. Check if StorageEthernet Port available in DB. 2. If not, then get already created StoragePort, update SCSI Address and persist. 3. If yes, then just update the properties alone.