Search in sources :

Example 1 with ThrowingProvider

use of org.platformlayer.ops.instances.ThrowingProvider in project platformlayer by platformlayer.

the class PrivateNetworkHelpers method findTunnelAddress.

public ThrowingProvider<String> findTunnelAddress(final PlatformLayerKey machineKey) {
    final NetworkPoint src = NetworkPoint.forPublicInternet();
    return new ThrowingProvider<String>() {

        @Override
        public String build() throws OpsException {
            ItemBase dest = platformLayer.getItem(machineKey);
            Machine machine = instanceHelpers.getMachine(dest, true);
            String address = machine.getNetworkPoint().getBestAddress(src);
            return address;
        }
    };
}
Also used : ItemBase(org.platformlayer.core.model.ItemBase) ThrowingProvider(org.platformlayer.ops.instances.ThrowingProvider) NetworkPoint(org.platformlayer.ops.networks.NetworkPoint) Machine(org.platformlayer.ops.Machine)

Aggregations

ItemBase (org.platformlayer.core.model.ItemBase)1 Machine (org.platformlayer.ops.Machine)1 ThrowingProvider (org.platformlayer.ops.instances.ThrowingProvider)1 NetworkPoint (org.platformlayer.ops.networks.NetworkPoint)1