Package org.platformlayer.core.model

Examples of org.platformlayer.core.model.PlatformLayerKey


  }

  protected abstract PlatformLayerKey getAuthDatabaseKey();

  public String getPlacementKey() {
    PlatformLayerKey databaseKey = getAuthDatabaseKey();
    return "platformlayer-" + databaseKey.getItemId().getKey();
  }
View Full Code Here


    ServiceType serviceType = new ServiceType(service.getServiceType());
    ItemType itemType = new ItemType(nodeName);

    FederationKey host = null;
    ProjectId project = null;
    return new PlatformLayerKey(host, project, serviceType, itemType, id);
  }
View Full Code Here

  }

  @Override
  public <T> List<T> listItems(Class<T> clazz) throws OpsException {
    JaxbHelper jaxbHelper = PlatformLayerClientBase.toJaxbHelper(clazz, ManagedItemCollection.class);
    PlatformLayerKey path = PlatformLayerClientBase.toKey(jaxbHelper, null, listServices(true));

    UntypedItemCollection untypedItems = listItemsUntyped(path);

    List<T> items = Lists.newArrayList();
View Full Code Here

  @Override
  public <T extends ItemBase> T putItemByTag(T item, Tag uniqueTag) throws OpsException {
    JaxbHelper jaxbHelper = PlatformLayerClientBase.toJaxbHelper(item);

    String xml = PlatformLayerClientBase.serialize(jaxbHelper, item);
    PlatformLayerKey key = PlatformLayerClientBase.toKey(jaxbHelper, item, listServices(true));

    UntypedItem ret = putItemByTag(key, uniqueTag, xml, Format.XML);
    Class<T> itemClass = (Class<T>) item.getClass();
    return promoteToTyped(ret, itemClass);
  }
View Full Code Here

  @Override
  public void buildTemplateModel(Map<String, Object> model) throws OpsException {
  }

  public String getPlacementKey() {
    PlatformLayerKey databaseKey = getDatabaseKey();
    return "platformlayer-" + databaseKey.getItemId().getKey();
  }
View Full Code Here

  @Override
  protected PublicEndpointBase buildItemTemplate() throws OpsException {
    InstanceBase instance = OpsContext.get().getInstance(InstanceBase.class);

    PlatformLayerKey instanceKey = instance.getKey();

    PublicEndpointBase publicEndpoint = platformLayerCloudHelpers.createPublicEndpoint(instance, parentItem);
    // publicEndpoint.network = network;
    publicEndpoint.publicPort = publicPort;
    publicEndpoint.publicPortCluster = publicPortCluster;
View Full Code Here

  protected void addChildren() throws OpsException {
    InstanceBuilder vm = InstanceBuilder.build(model.dnsName, this, model.getTags());

    // TODO: Do we need a DnsCluster concept?
    // For now, we fake it
    PlatformLayerKey key = model.getKey();
    String groupId = key.withId(new ManagedItemId("primary")).getUrl();
    groupId = groupId.replace("/dnsServer/", "/dnsCluster/");
    vm.hostPolicy.configureSpread(groupId);

    vm.addTagToManaged = true;
    vm.publicPorts.add(53);
View Full Code Here

    }
    return cluster;
  }

  public List<ZookeeperServer> getClusterServers() throws OpsException {
    PlatformLayerKey parent = getClusterKey();
    if (parent == null) {
      log.warn("Parent tag not set on Zookeeper server; assuming standalone server");
      return Lists.newArrayList(model);
    }
View Full Code Here

        TagFilter.byTag(Tag.PARENT.build(parent)));
    return servers;
  }

  private PlatformLayerKey getClusterKey() {
    PlatformLayerKey parent = Tag.PARENT.findUnique(model);
    return parent;
  }
View Full Code Here

    }

    Object contextMachine = ops.getInstance(machineItemClass);
    if (contextMachine != null) {
      // We are presumably building the machine item
      PlatformLayerKey targetItemKey = ops.getJobRecord().getTargetItemKey();
      ItemBase machineItem = (ItemBase) contextMachine;

      if (!Objects.equal(targetItemKey, machineItem.getKey())) {
        throw new OpsException("Expected to find same model");
      }
View Full Code Here

TOP

Related Classes of org.platformlayer.core.model.PlatformLayerKey

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.