private void processTopologyViewInstance(WBEMClient client,CIMInstance topins,Map<String,FCEndpoint> portConnections,Map<String,Set<String>> routedConnections,String fabricName,String fabricWwn,Map<String,String> deviceNameCache,Map<String,String> logicalToPhysicalSwitchMap) throws WBEMException {
  if (_XlatePhantomPort.equals(cimStringProperty(topins,_AntecedentFCPortElementName))) {
    Set<String> fabricRoutedEndpoints=routedConnections.get(fabricWwn);
    if (fabricRoutedEndpoints == null) {
      fabricRoutedEndpoints=new HashSet<String>();
      routedConnections.put(fabricWwn,fabricRoutedEndpoints);
    }
    fabricRoutedEndpoints.add(formatWWN(cimStringProperty(topins,_DependentFCPortWWN)));
    return;
  }
  if (cimIntegerProperty(topins,_AntecedentFCPortType) != _clientPort) {
    return;
  }
  String remotePortName=formatWWN(cimStringProperty(topins,_DependentFCPortWWN));
  String remoteNodeName=formatWWN(cimStringProperty(topins,_DependentElementWWN));
  String switchPortName=formatWWN(cimStringProperty(topins,_AntecedentFCPortWWN));
  String switchInterfaceName=cimStringProperty(topins,_AntecedentFCPortElementName);
  String switchWwn=formatWWN(cimStringProperty(topins,_AntecedentElementWWN));
  String switchName=switchWwn;
  if (deviceNameCache.get(switchWwn) != null) {
    switchName=deviceNameCache.get(switchWwn);
  }
 else {
    CIMProperty switchPathProperty=topins.getProperty(_AntecedentSystem);
    CIMObjectPath switchPath=null;
    if (switchPathProperty.getValue() instanceof String) {
      switchPath=new CIMObjectPath((String)switchPathProperty.getValue());
    }
 else {
      switchPath=(CIMObjectPath)switchPathProperty.getValue();
    }
    CloseableIterator<CIMInstance> switchIt=client.enumerateInstances(switchPath,false,true,true,null);
    while (switchIt.hasNext()) {
      CIMInstance swins=switchIt.next();
      String namex=formatWWN(cimStringProperty(swins,_name));
      String enamex=cimStringProperty(swins,_element_name);
      if (namex.equals(switchWwn)) {
        switchName=enamex;
        deviceNameCache.put(switchWwn,switchName);
      }
    }
  }
  String physicalSwitchName=logicalToPhysicalSwitchMap.get(switchName);
  _log.info("Switch Name : {} Physical SwitchName {}",switchName,physicalSwitchName);
  if (physicalSwitchName != null) {
    switchName=physicalSwitchName;
  }
  FCEndpoint conn=new FCEndpoint();
  conn.setFabricId(fabricName);
  conn.setRemotePortName(remotePortName);
  conn.setRemoteNodeName(remoteNodeName);
  conn.setSwitchPortName(switchPortName);
  conn.setSwitchInterface(switchInterfaceName);
  conn.setSwitchName(switchName);
  conn.setFabricWwn(fabricWwn);
  portConnections.put(remotePortName,conn);
}

private void processTopologyViewInstance ( WBEMClient client , CIMInstance topins , Map < String , FCEndpoint > portConnections , Map < String , Set < String > > routedConnections , String fabricName , String fabricWwn , Map < String , String > deviceNameCache , Map < String , String > logicalToPhysicalSwitchMap ) throws WBEMException { if ( _XlatePhantomPort . equals ( cimStringProperty ( topins , _AntecedentFCPortElementName ) ) ) { Set < String > fabricRoutedEndpoints = routedConnections . get ( fabricWwn ) ; if ( fabricRoutedEndpoints == null ) { fabricRoutedEndpoints = new HashSet < String > ( ) ; routedConnections . put ( fabricWwn , fabricRoutedEndpoints ) ; } fabricRoutedEndpoints . add ( formatWWN ( cimStringProperty ( topins , _DependentFCPortWWN ) ) ) ; return ; } if ( cimIntegerProperty ( topins , _AntecedentFCPortType ) != _clientPort ) { return ; } String remotePortName = formatWWN ( cimStringProperty ( topins , _DependentFCPortWWN ) ) ; String remoteNodeName = formatWWN ( cimStringProperty ( topins , _DependentElementWWN ) ) ; String switchPortName = formatWWN ( cimStringProperty ( topins , _AntecedentFCPortWWN ) ) ; String switchInterfaceName = cimStringProperty ( topins , _AntecedentFCPortElementName ) ; String switchWwn = formatWWN ( cimStringProperty ( topins , _AntecedentElementWWN ) ) ; String switchName = switchWwn ; if ( deviceNameCache . get ( switchWwn ) != null ) { switchName = deviceNameCache . get ( switchWwn ) ; } else { CIMProperty switchPathProperty = topins . getProperty ( _AntecedentSystem ) ; CIMObjectPath switchPath = null ; if ( switchPathProperty . getValue ( ) instanceof String ) { switchPath = new CIMObjectPath ( ( String ) switchPathProperty . getValue ( ) ) ; } else { switchPath = ( CIMObjectPath ) switchPathProperty . getValue ( ) ; } CloseableIterator < CIMInstance > switchIt = client . enumerateInstances ( switchPath , false , true , true , null ) ; while ( switchIt . hasNext ( ) ) { CIMInstance swins = switchIt . next ( ) ; String namex = formatWWN ( cimStringProperty ( swins , _name ) ) ; String enamex = cimStringProperty ( swins , _element_name ) ; if ( namex . equals ( switchWwn ) ) { switchName = enamex ; deviceNameCache . put ( switchWwn , switchName ) ; } } } String physicalSwitchName = logicalToPhysicalSwitchMap . get ( switchName ) ; _log . info ( "Switch Name : {} Physical SwitchName {}" , switchName , physicalSwitchName ) ; if ( physicalSwitchName != null ) { switchName = physicalSwitchName ; } FCEndpoint conn = new FCEndpoint ( ) ; conn . setFabricId ( fabricName ) ; conn . setRemotePortName ( remotePortName ) ; conn . setRemoteNodeName ( remoteNodeName ) ; conn . setSwitchPortName ( switchPortName ) ; conn . setSwitchInterface ( switchInterfaceName ) ; conn . setSwitchName ( switchName ) ; conn . setFabricWwn ( fabricWwn ) ; portConnections . put ( remotePortName , conn ) ; }
generate port connections from the topology details
