Package org.platformlayer.ids

Examples of org.platformlayer.ids.ManagedItemId


      throw new IllegalArgumentException("Cannot resolve path (item id not resolved): " + path);
    }

    FederationKey host = null;
    return new PlatformLayerKey(host, project, new ServiceType(serviceType), new ItemType(itemType),
        new ManagedItemId(itemId));
  }
View Full Code Here


      model.state = ManagedItemState.fromCode(stateCode);

      model.secret = secret;

      PlatformLayerKey plk = new PlatformLayerKey(null, project, serviceType, itemType, new ManagedItemId(key));
      model.setKey(plk);

      return model;
    } catch (JAXBException e) {
      throw new RepositoryException("Error deserializing data", e);
View Full Code Here

      ModelClass<?> modelClass = serviceProvider.getModelClass(key.getItemType());

      ServiceType serviceType = key.getServiceType();
      ItemType itemType = key.getItemType();
      ProjectId project = key.getProject();
      ManagedItemId itemId = key.getItemId();

      return fetchItem(db, serviceType, itemType, project, itemId, modelClass.getJavaClass(), secretProvider,
          fetchTags);
    } catch (SQLException e) {
      throw new RepositoryException("Error running query", e);
View Full Code Here

    Class<T> itemClass = (Class<T>) item.getClass();

    DbHelper db = new DbHelper(itemClass, project);

    try {
      ManagedItemId itemId = new ManagedItemId(item.getId());

      ModelClass<T> modelClass = serviceProviderDirectory.getModelClass(itemClass);

      int projectId = db.mapToValue(project);
      int modelId = db.mapToValue(modelClass.getItemType());
      int serviceId = db.mapToValue(modelClass.getServiceType());

      ItemEntity rs = db.queries.findItem(serviceId, modelId, projectId, itemId.getKey());
      if (rs == null) {
        throw new RepositoryException("Item not found");
      }

      byte[] secretData = rs.secret;
View Full Code Here

    if (plk.getItemId() != null) {
      throw new IllegalArgumentException();
    }

    FederationMapping childKey = federationMap.getClientForCreate(plk);
    ManagedItemId childItemId;

    ChildClient childClient = getClient(childKey);
    childItemId = null;

    MappedPlatformLayerKey mapped = new MappedPlatformLayerKey();
View Full Code Here

    return mapped;
  }

  private MappedPlatformLayerKey mapToChildForPut(PlatformLayerKey plk) {
    FederationMapping childKey = federationMap.getClientForCreate(plk);
    ManagedItemId childItemId = plk.getItemId();

    ChildClient childClient = getClient(childKey);

    MappedPlatformLayerKey mapped = new MappedPlatformLayerKey();
    mapped.child = childClient;
View Full Code Here

  private MappedPlatformLayerKey mapToChild(PlatformLayerKey plk) {
    // if (plk.getHost() != null) {
    //
    // }

    ManagedItemId itemId = plk.getItemId();
    if (itemId == null || itemId.isEmpty()) {
      throw new IllegalArgumentException();
    }

    FederationKey host = plk.getHost();
    if (host == null) {
View Full Code Here

    jobData.action = action;
    jobData.targetId = targetItem;

    try {
      String jobId = repository.insertJob(projectId, jobData);
      jobData.key = JobData.buildKey(projectId, new ManagedItemId(jobId));
    } catch (RepositoryException e) {
      throw new OpsException("Error inserting job", e);
    }

    operationQueue.submit(auth, jobData);
View Full Code Here

      // TODO: Include currently running jobs...
      List<JobEntity> results = db.queries.listRecentJobs(project, maxAge, filterTarget, limit);
      List<JobData> ret = Lists.newArrayList();
      for (JobEntity job : results) {
        ManagedItemId jobId = new ManagedItemId(job.jobId);
        PlatformLayerKey jobKey = JobData.buildKey(projectId, jobId);
        JobData jobData = mapFromEntity(job, jobKey);
        ret.add(jobData);
      }
View Full Code Here

    return findItem(key, itemClass);
  }

  public <T> PlatformLayerKey toKey(Class<T> itemClass, String id) throws PlatformLayerClientException {
    JaxbHelper jaxbHelper = PlatformLayerClientBase.toJaxbHelper(itemClass, new Class[0]);
    ManagedItemId itemId = new ManagedItemId(id);

    PlatformLayerKey key = PlatformLayerClientBase.toKey(jaxbHelper, itemId, itemClass,
        platformLayerClient.listServices(true));
    return key;
  }
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.