Package org.platformlayer.service.cloud.google.model

Examples of org.platformlayer.service.cloud.google.model.GoogleCloudPublicEndpoint


    return rawMachine;
  }

  @Override
  public PublicEndpointBase buildEndpointTemplate() {
    return new GoogleCloudPublicEndpoint();
  }
View Full Code Here


  @Inject
  PlatformLayerHelpers client;

  @Override
  protected void addChildren() throws OpsException {
    final GoogleCloudPublicEndpoint model = OpsContext.get().getInstance(GoogleCloudPublicEndpoint.class);

    GoogleCloudInstance instance = client.getItem(model.instance, GoogleCloudInstance.class);

    CloudInstanceMapper instanceMapper;
    {
      instanceMapper = injected(CloudInstanceMapper.class);
      instanceMapper.instance = instance;
      addChild(instanceMapper);
    }

    final EnsureFirewallIngress ingress;
    {
      ingress = injected(EnsureFirewallIngress.class);
      ingress.model = model;
      instanceMapper.addChild(ingress);
    }

    {
      OpsProvider<TagChanges> tagChanges = new OpsProvider<TagChanges>() {
        @Override
        public TagChanges get() {
          TagChanges tagChanges = new TagChanges();
          String address = ingress.getPublicAddress();
          if (Strings.isNullOrEmpty(address)) {
            throw new IllegalStateException();
          }

          EndpointInfo endpoint = new EndpointInfo(address, model.publicPort);
          tagChanges.addTags.add(endpoint.toTag());

          return tagChanges;
        }
      };

      Tagger tagger = injected(Tagger.class);

      tagger.platformLayerKey = model.getKey();
      tagger.tagChangesProvider = tagChanges;

      instanceMapper.addChild(tagger);

      Tagger tagInstance = injected(Tagger.class);
View Full Code Here

TOP

Related Classes of org.platformlayer.service.cloud.google.model.GoogleCloudPublicEndpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.