/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.fabric8.kubernetes.api.mbeans;

import io.fabric8.kubernetes.api.KubernetesHelper;
import io.fabric8.kubernetes.api.PodStatus;
import io.fabric8.kubernetes.api.model.Pod;

import java.util.Map;

/**
 */
public class AppPodSummaryDTO {
    private final String id;
    private final String namespace;
    private final PodStatus status;
    private final Map<String, String> labels;

    public AppPodSummaryDTO(Pod pod) {
        this.id = KubernetesHelper.getId(pod);
        this.namespace = pod.getNamespace();
        this.status = KubernetesHelper.getPodStatus(pod);
        this.labels = pod.getLabels();
    }

    @Override
    public String toString() {
        return "AppPodSummaryDTO{" +
                "id='" + id + '\'' +
                ", namespace='" + namespace + '\'' +
                ", status=" + status +
                '}';
    }

    public String getId() {
        return id;
    }

    public PodStatus getStatus() {
        return status;
    }

    public String getNamespace() {
        return namespace;
    }

    public Map<String, String> getLabels() {
        return labels;
    }
}

@@ -976,34 +976,307 @@
 del.
-Pod;%0A%0Aimport java.util.Map
+Container;%0Aimport io.fabric8.kubernetes.api.model.ContainerManifest;%0Aimport io.fabric8.kubernetes.api.model.Pod;%0Aimport io.fabric8.kubernetes.api.model.PodState;%0Aimport io.fabric8.kubernetes.api.model.Port;%0A%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set
 ;%0A%0A/
@@ -1460,16 +1460,132 @@
  labels;
+%0A    private final Set%3CInteger%3E containerPorts = new HashSet%3C%3E();%0A    private String podIP;%0A    private String host;
 %0A%0A    pu
@@ -1802,24 +1802,1023 @@
 etLabels();%0A
+        PodState currentState = pod.getCurrentState();%0A        if (currentState != null) %7B%0A            this.podIP = currentState.getPodIP();%0A            this.host = currentState.getHost();%0A            ContainerManifest manifest = currentState.getManifest();%0A            if (manifest != null) %7B%0A                List%3CContainer%3E containers = manifest.getContainers();%0A                if (containers != null) %7B%0A                    for (Container container : containers) %7B%0A                        List%3CPort%3E ports = container.getPorts();%0A                        if (ports != null) %7B%0A                            for (Port port : ports) %7B%0A                                Integer containerPort = port.getContainerPort();%0A                                if (containerPort != null) %7B%0A                                    containerPorts.add(containerPort);%0A                                %7D%0A                            %7D%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A
     %7D%0A%0A    @
@@ -3311,11 +3311,213 @@
 s;%0A    %7D
+%0A%0A    public Set%3CInteger%3E getContainerPorts() %7B%0A        return containerPorts;%0A    %7D%0A%0A    public String getPodIP() %7B%0A        return podIP;%0A    %7D%0A%0A    public String getHost() %7B%0A        return host;%0A    %7D
 %0A%7D%0A

add more default pod metadata on the summary