Package org.platformlayer.ids

Examples of org.platformlayer.ids.ManagedItemId


    return toKey(jaxbHelper, item, listServices(true));
  }

  public static <T> PlatformLayerKey toKey(JaxbHelper jaxbHelper, T item, Collection<ServiceInfo> services)
      throws PlatformLayerClientException {
    ManagedItemId id = item != null ? findId(item) : null;

    return toKey(jaxbHelper, id, item != null ? item.getClass() : null, services);
  }
View Full Code Here


      // We could ask the server to figure it out for us (PUT on collection?)
      // throw new PlatformLayerClientException("Cannot determine item id");
    }

    return new ManagedItemId(v);
  }
View Full Code Here

    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

  public <T extends ItemBase> T getItem(String id, Class<T> itemClass) throws OpsException, IOException {
    TypedPlatformLayerClient client = getTypedClient();

    JaxbHelper jaxbHelper = PlatformLayerClientBase.toJaxbHelper(itemClass, new Class[] {});

    PlatformLayerKey key = PlatformLayerClientBase.toKey(jaxbHelper, new ManagedItemId(id), itemClass,
        client.listServices(true));
    return client.getItem(key, itemClass);
  }
View Full Code Here

    String serviceComponent = components.get(1);
    ServiceType serviceType = !Strings.isNullOrEmpty(serviceComponent) ? new ServiceType(serviceComponent) : null;

    ItemType itemType = new ItemType(components.get(2));
    ManagedItemId itemId = new ManagedItemId(Joiner.on("/").join(components.subList(3, components.size())));

    return new PlatformLayerKey(hostKey, project, serviceType, itemType, itemId);
  }
View Full Code Here

  public PlatformLayerKey withId(ManagedItemId id2) {
    return new PlatformLayerKey(getHost(), getProject(), getServiceType(), getItemType(), id2);
  }

  public PlatformLayerKey withId(String id2) {
    return withId(new ManagedItemId(id2));
  }
View Full Code Here

    }
    return true;
  }

  public static PlatformLayerKey fromId(String id) {
    return new PlatformLayerKey(null, null, null, null, new ManagedItemId(id));
  }
View Full Code Here

  public static PlatformLayerKey build(String host, String project, String serviceType, String itemType, String itemId) {
    FederationKey federationKey = host != null ? FederationKey.build(host) : null;
    ProjectId projectKey = project != null ? new ProjectId(project) : null;
    ServiceType serviceKey = serviceType != null ? new ServiceType(serviceType) : null;
    ItemType itemKey = itemType != null ? new ItemType(itemType) : null;
    ManagedItemId idKey = itemId != null ? new ManagedItemId(itemId) : null;

    return new PlatformLayerKey(federationKey, projectKey, serviceKey, itemKey, idKey);
  }
View Full Code Here

  public void setKey(PlatformLayerKey key) {
    this.key = key;
  }

  public String getId() {
    ManagedItemId itemId = null;
    if (key != null) {
      itemId = key.getItemId();
    }
    if (itemId != null) {
      return itemId.getKey();
    }
    return null;
  }
View Full Code Here

  JsonMapper jsonHelper;

  @Path("{id}")
  @Produces({ XML, JSON })
  public ManagedItemResource retrieveSingleService(@PathParam("id") String id) {
    ManagedItemId itemId = new ManagedItemId(id);
    getScope().put(itemId);

    ManagedItemResource resource = objectInjector.getInstance(ManagedItemResource.class);
    return resource;
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.ids.ManagedItemId

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.