本文整理匯總了Java中com.vmware.vim25.HostScsiTopologyTarget類的典型用法代碼示例。如果您正苦於以下問題:Java HostScsiTopologyTarget類的具體用法?Java HostScsiTopologyTarget怎麽用?Java HostScsiTopologyTarget使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
HostScsiTopologyTarget類屬於com.vmware.vim25包,在下文中一共展示了HostScsiTopologyTarget類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: printScsiTopology
import com.vmware.vim25.HostScsiTopologyTarget; //導入依賴的package包/類
static void printScsiTopology(HostScsiTopology hst)
{
HostScsiTopologyInterface[] hstis = hst.getAdapter();
for(int i=0; hstis!=null && i<hstis.length; i++)
{
System.out.println("Adapter:" + hstis[i].getAdapter());
System.out.println("Key:" + hstis[i].getKey());
HostScsiTopologyTarget[] hstts = hstis[i].getTarget();
for(int j=0; hstts!=null && j<hstts.length; j++)
{
System.out.println("Key:" + hstts[j].getKey());
System.out.println("Target:" + hstts[j].getTarget());
System.out.println("Transport:"
+ hstts[j].getTransport().getClass().getName());
HostScsiTopologyLun[] luns = hstts[j].getLun();
for(int k=0; luns!=null && k<luns.length; k++)
{
System.out.println("Key:" + luns[k].getKey());
System.out.println("LUN:" + luns[k].getLun());
System.out.println("ScsiLun:" + luns[k].getScsiLun());
}
}
}
}
示例2: getHostScsiDisk
import com.vmware.vim25.HostScsiTopologyTarget; //導入依賴的package包/類
private static HostScsiDisk getHostScsiDisk(HostScsiTopology hst, List<HostScsiDisk> lstHostScsiDisks, String iqn) {
for (HostScsiTopologyInterface adapter : hst.getAdapter()) {
if (adapter.getTarget() != null) {
for (HostScsiTopologyTarget target : adapter.getTarget()) {
if (target.getTransport() instanceof HostInternetScsiTargetTransport) {
String iScsiName = ((HostInternetScsiTargetTransport)target.getTransport()).getIScsiName();
if (iqn.equals(iScsiName)) {
for (HostScsiDisk hostScsiDisk : lstHostScsiDisks) {
for (HostScsiTopologyLun hstl : target.getLun()) {
if (hstl.getScsiLun().contains(hostScsiDisk.getUuid())) {
return hostScsiDisk;
}
}
}
}
}
}
}
}
return null;
}