Search in sources :

Example 1 with SimpleLinkConsumer

use of org.platformlayer.ops.uses.SimpleLinkConsumer in project platformlayer by platformlayer.

the class SimpleApp method getConfigurationProperties.

protected Map<String, String> getConfigurationProperties() throws OpsException {
    Map<String, String> config = Maps.newHashMap();
    if (context.links != null) {
        NetworkPoint networkPoint = NetworkPoint.forTargetInContext();
        InetAddressChooser inetAddressChooser = NearestAddressChooser.build(networkPoint);
        SimpleLinkConsumer consumer = new SimpleLinkConsumer(consumerKey, inetAddressChooser);
        config.putAll(consumeHelper.buildLinkTargetProperties(consumer, context.links.getLinks()));
    }
    return config;
}
Also used : InetAddressChooser(org.platformlayer.InetAddressChooser) SimpleLinkConsumer(org.platformlayer.ops.uses.SimpleLinkConsumer) NetworkPoint(org.platformlayer.ops.networks.NetworkPoint)

Example 2 with SimpleLinkConsumer

use of org.platformlayer.ops.uses.SimpleLinkConsumer in project platformlayer by platformlayer.

the class StandardTemplateData method getConfigurationProperties.

protected Map<String, String> getConfigurationProperties() throws OpsException {
    Map<String, String> properties = Maps.newHashMap();
    List<Link> modelLinks = getLinks();
    if (modelLinks != null && !modelLinks.isEmpty()) {
        NetworkPoint networkPoint = NetworkPoint.forTargetInContext();
        InetAddressChooser inetAddressChooser = NearestAddressChooser.build(networkPoint);
        SimpleLinkConsumer consumer = new SimpleLinkConsumer(getModel().getKey(), inetAddressChooser);
        properties.putAll(links.buildLinkTargetProperties(consumer, modelLinks));
    }
    return properties;
}
Also used : InetAddressChooser(org.platformlayer.InetAddressChooser) SimpleLinkConsumer(org.platformlayer.ops.uses.SimpleLinkConsumer) Link(org.platformlayer.core.model.Link) NetworkPoint(org.platformlayer.ops.networks.NetworkPoint)

Aggregations

InetAddressChooser (org.platformlayer.InetAddressChooser)2 NetworkPoint (org.platformlayer.ops.networks.NetworkPoint)2 SimpleLinkConsumer (org.platformlayer.ops.uses.SimpleLinkConsumer)2 Link (org.platformlayer.core.model.Link)1