Package org.platformlayer.service.cloud.direct.model

Examples of org.platformlayer.service.cloud.direct.model.DirectHost


  private String getHostPrimaryInterface() {
    if (hostPrimaryInterface != null) {
      return hostPrimaryInterface;
    }

    DirectHost host = OpsContext.get().getInstance(DirectHost.class);
    return host.publicInterface;
  }
View Full Code Here


      NetworkTunDevice tun = injected(NetworkTunDevice.class);
      tun.interfaceName = getEthernetDeviceName();
      tun.bridgeName = new Provider<String>() {
        @Override
        public String get() {
          DirectHost host = OpsContext.get().getInstance(DirectHost.class);
          return host.bridge;
        }
      };
      instance.addChild(tun);
    }
View Full Code Here

    if (hosts.size() > 1) {
      // Huh?
      throw new OpsException("Multiple hosts already assigned");
    }

    DirectHost host;
    if (hosts.isEmpty()) {
      if (OpsContext.isDelete()) {
        host = null;
      } else {
        if (createInstance) {
          DirectCloudHost cloudHost = cloudMap.pickHost(instance);
          host = cloudHost.getModel();

          platformLayer.addTag(host.getKey(), tag);
        } else {
          throw new OpsException("Instance not yet assigned");
        }
      }
    } else {
View Full Code Here

    };
  }

  private static PlatformLayerKey getSharedNetworkKey() {
    DirectCloud cloud = OpsContext.get().getInstance(DirectCloud.class);
    DirectHost host = OpsContext.get().getInstance(DirectHost.class);

    PlatformLayerKey sharedNetwork = host.network;
    if (sharedNetwork == null) {
      sharedNetwork = cloud.network;
    }
View Full Code Here

  public OpsProvider<ResourcePool<InetSocketAddress>> getPublicAddressPool4(final int publicPort,
      final List<Integer> publicPortGroup) {
    OpsProvider<ResourcePool<InetSocketAddress>> pool = new OpsProvider<ResourcePool<InetSocketAddress>>() {
      @Override
      public ResourcePool<InetSocketAddress> get() throws OpsException {
        DirectHost host = OpsContext.get().getInstance(DirectHost.class);
        OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);

        PlatformLayerKey sharedNetworkKey = getSharedNetworkKey();

        // We don't skip here, at the moment.
View Full Code Here

  public static OpsProvider<ResourcePool<AddressModel>> getPrivateAddressPool4() {
    OpsProvider<PoolBuilder<AddressModel>> poolBuilder = new OpsProvider<PoolBuilder<AddressModel>>() {
      @Override
      public PoolBuilder<AddressModel> get() {
        DirectHost host = OpsContext.get().getInstance(DirectHost.class);
        String privateCidr = host.ipv4Private;
        if (privateCidr != null) {
          // Skip the first entries in the CIDR as it's probably not valid
          // 0: Network identifier
          // 1: Gateway (?)
View Full Code Here

  public OpsProvider<ResourcePool<AddressModel>> getAddressPool6() {
    OpsProvider<PoolBuilder<AddressModel>> poolBuilder = new OpsProvider<PoolBuilder<AddressModel>>() {
      @Override
      public PoolBuilder<AddressModel> get() throws OpsException {
        DirectHost host = OpsContext.get().getInstance(DirectHost.class);

        PlatformLayerKey sharedNetworkKey = getSharedNetworkKey();

        // Skip the first entries in the CIDR as it's probably not valid
        // 0: Network identifier
View Full Code Here

TOP

Related Classes of org.platformlayer.service.cloud.direct.model.DirectHost

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.