List of usage examples for com.amazonaws.services.elasticloadbalancing.model LoadBalancerDescription getScheme
public String getScheme()
The type of load balancer.
From source file:com.haskins.cloudtrailviewer.dialog.resourcedetail.detailpanels.ElbDetail.java
License:Open Source License
private void buildUI(DescribeLoadBalancersResult detail) { JTabbedPane tabs = new JTabbedPane(); tabs.add("Load Balancer", primaryScrollPane); final JTable healthCheckTable = new JTable(healthCheckTableModel); JScrollPane healthCheckScrollPane = new JScrollPane(healthCheckTable); tabs.add("Health Check", healthCheckScrollPane); final JTable listenersTable = new JTable(listenersTableModel); JScrollPane listenersScrollPane = new JScrollPane(listenersTable); tabs.add("Listeners", listenersScrollPane); this.add(tabs, BorderLayout.CENTER); List<LoadBalancerDescription> elbs = detail.getLoadBalancerDescriptions(); if (!elbs.isEmpty()) { LoadBalancerDescription elb = elbs.get(0); if (!elb.getAvailabilityZones().isEmpty()) { StringBuilder azs = new StringBuilder(); for (String az : elb.getAvailabilityZones()) { azs.append(az).append(", "); }//from ww w .j av a 2 s. c om primaryTableModel.addRow(new Object[] { "Availability Zones", azs.toString() }); } if (elb.getCanonicalHostedZoneName() != null) { primaryTableModel .addRow(new Object[] { "Canonical Hosted Zone name", elb.getCanonicalHostedZoneName() }); } if (elb.getCanonicalHostedZoneNameID() != null) { primaryTableModel.addRow( new Object[] { "Canonical Hosted Zone name Id", elb.getCanonicalHostedZoneNameID() }); } if (elb.getCreatedTime() != null) { primaryTableModel.addRow(new Object[] { "Created", elb.getCreatedTime() }); } if (elb.getDNSName() != null) { primaryTableModel.addRow(new Object[] { "DNS Name", elb.getDNSName() }); } if (!elb.getInstances().isEmpty()) { StringBuilder instances = new StringBuilder(); for (Instance instance : elb.getInstances()) { instances.append(instance.getInstanceId()).append(", "); } primaryTableModel.addRow(new Object[] { "Instances", instances.toString() }); } if (elb.getLoadBalancerName() != null) { primaryTableModel.addRow(new Object[] { "Load Balander Name", elb.getLoadBalancerName() }); } if (elb.getScheme() != null) { primaryTableModel.addRow(new Object[] { "Scheme", elb.getScheme() }); } if (!elb.getSecurityGroups().isEmpty()) { StringBuilder sgs = new StringBuilder(); for (String sg : elb.getSecurityGroups()) { sgs.append(sg).append(", "); } primaryTableModel.addRow(new Object[] { "Security Groups", sgs.toString() }); } if (elb.getSourceSecurityGroup() != null) { primaryTableModel.addRow( new Object[] { "Source Security Group", elb.getSourceSecurityGroup().getGroupName() }); } if (!elb.getSubnets().isEmpty()) { StringBuilder subnets = new StringBuilder(); for (String subnet : elb.getSubnets()) { subnets.append(subnet).append(", "); } primaryTableModel.addRow(new Object[] { "Subnets", subnets.toString() }); } if (elb.getVPCId() != null) { primaryTableModel.addRow(new Object[] { "VPC Id", elb.getVPCId() }); } /** * Health Check */ healthCheckTableModel.addColumn("Property"); healthCheckTableModel.addColumn("Value"); HealthCheck healthCheck = elb.getHealthCheck(); if (healthCheck.getHealthyThreshold() != null) { healthCheckTableModel.addRow(new Object[] { "Threshold", healthCheck.getHealthyThreshold() }); } if (healthCheck.getInterval() != null) { healthCheckTableModel.addRow(new Object[] { "Interval", healthCheck.getInterval() }); } if (healthCheck.getTarget() != null) { healthCheckTableModel.addRow(new Object[] { "Target", healthCheck.getTarget() }); } if (healthCheck.getTimeout() != null) { healthCheckTableModel.addRow(new Object[] { "Timeout", healthCheck.getTimeout() }); } if (healthCheck.getUnhealthyThreshold() != null) { healthCheckTableModel .addRow(new Object[] { "Unhealth Threshold", healthCheck.getUnhealthyThreshold() }); } /** * Listeners */ listenersTableModel.addColumn("Instance Port"); listenersTableModel.addColumn("Instance Protocol"); listenersTableModel.addColumn("Load Balancer Port"); listenersTableModel.addColumn("Load Balancer Protocol"); listenersTableModel.addColumn("SSL Certificate Id"); List<ListenerDescription> listenerDescriptions = elb.getListenerDescriptions(); for (ListenerDescription description : listenerDescriptions) { Listener listener = description.getListener(); String ssl = ""; if (listener.getSSLCertificateId() != null) { ssl = listener.getSSLCertificateId(); } listenersTableModel .addRow(new Object[] { listener.getInstancePort(), listener.getInstanceProtocol(), listener.getLoadBalancerPort(), listener.getProtocol(), ssl }); } } }