All Downloads are FREE. Search and download functionalities are using the official Maven repository.

brooklyn.location.access.PortMapping Maven / Gradle / Ivy

There is a newer version: 0.7.0-M1
Show newest version
package brooklyn.location.access;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.base.Objects;

import brooklyn.location.Location;

public class PortMapping {
    
    public PortMapping(String publicIpId, int publicPort, Location target, int privatePort) {
        super();
        this.publicIpId = checkNotNull(publicIpId, "publicIpId");
        this.publicPort = publicPort;
        this.target = target;
        this.privatePort = privatePort;
    }

    final String publicIpId;
    final int publicPort;

    final Location target;
    final int privatePort;
    // CIDR's ?

    public int getPublicPort() {
        return publicPort;
    }

    public Location getTarget() {
        return target;
    }
    public int getPrivatePort() {
        return privatePort;
    }
    
    @Override
    public String toString() {
        return Objects.toStringHelper(this).add("public", publicIpId+":"+publicPort).
                add("private", target+":"+privatePort).toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy