31 import java.util.*; |
31 import java.util.*; |
32 import java.util.List; |
32 import java.util.List; |
33 import javax.swing.*; |
33 import javax.swing.*; |
34 import javax.swing.border.Border; |
34 import javax.swing.border.Border; |
35 import javax.swing.table.DefaultTableCellRenderer; |
35 import javax.swing.table.DefaultTableCellRenderer; |
36 import com.oracle.solaris.rad.ObjectException; |
36 import com.oracle.solaris.rad.client.RadObjectException; |
37 import com.oracle.solaris.vp.panel.common.api.network.NetworkMXBean; |
37 import com.oracle.solaris.vp.panel.common.api.network.Network; |
38 import com.oracle.solaris.vp.util.misc.finder.Finder; |
38 import com.oracle.solaris.vp.util.misc.finder.Finder; |
39 import com.oracle.solaris.vp.util.swing.*; |
39 import com.oracle.solaris.vp.util.swing.*; |
40 import com.oracle.solaris.vp.util.swing.layout.*; |
40 import com.oracle.solaris.vp.util.swing.layout.*; |
41 |
41 |
42 @SuppressWarnings({"serial"}) |
42 @SuppressWarnings({"serial"}) |
526 if (!entry.equals(curEntry)) |
526 if (!entry.equals(curEntry)) |
527 table.setValueAt(entry.get(0), row, 0); |
527 table.setValueAt(entry.get(0), row, 0); |
528 } |
528 } |
529 |
529 |
530 // |
530 // |
531 // Methods for interaction with NetworkMXBean from |
531 // Methods for interaction with NetworkBean from |
532 // FirewallPanelDescriptor |
532 // FirewallPanelDescriptor |
533 // |
533 // |
534 |
534 |
535 public void setPanelDescriptor(FirewallPanelDescriptor descriptor) { |
535 public void setPanelDescriptor(FirewallPanelDescriptor descriptor) { |
536 this.descriptor = descriptor; |
536 this.descriptor = descriptor; |
537 } |
537 } |
538 |
538 |
539 public String getHostNameForIP(String ip) { |
539 public String getHostNameForIP(String ip) { |
540 try { |
540 try { |
541 return (descriptor == null ? ip : |
541 return (descriptor == null ? ip : |
542 descriptor.getNetworkMXBean().getHostNameForIP(ip)); |
542 descriptor.getNetworkBean().getHostNameForIP(ip)); |
543 } catch (ObjectException e) { |
543 } catch (RadObjectException e) { |
544 return ip; |
544 return ip; |
545 } |
545 } |
546 } |
546 } |
547 |
547 |
548 public List<String> getNetworkInterfaces() { |
548 public List<String> getNetworkInterfaces() { |
549 try { |
549 try { |
550 return descriptor.getNetworkMXBean().getnetworkInterfaces(); |
550 return descriptor.getNetworkBean().getnetworkInterfaces(); |
551 } catch (ObjectException e) { |
551 } catch (RadObjectException e) { |
552 return Collections.emptyList(); |
552 return Collections.emptyList(); |
553 } |
553 } |
554 } |
554 } |
555 |
555 |
556 public List<String> hostGetIPs(String hostName) { |
556 public List<String> hostGetIPs(String hostName) { |
557 try { |
557 try { |
558 return descriptor.getNetworkMXBean().hostGetIPs(hostName); |
558 return descriptor.getNetworkBean().hostGetIPs(hostName); |
559 } catch (ObjectException e) { |
559 } catch (RadObjectException e) { |
560 return Collections.emptyList(); |
560 return Collections.emptyList(); |
561 } |
561 } |
562 } |
562 } |
563 |
563 |
564 public boolean validateHostName(String hostName) { |
564 public boolean validateHostName(String hostName) { |