Package org.platformlayer.ids

Examples of org.platformlayer.ids.ItemType


    if (Strings.isNullOrEmpty(itemId)) {
      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


    if (Strings.isNullOrEmpty(hostPolicy.groupId)) {
      sameGroupId = DEFAULT_GROUP;
    } else {
      sameGroupId = hostPolicy.groupId;
    }
    final ItemType sameItemType;
    if (hostPolicy.scoreSameItemType != 0) {
      PlatformLayerKey owner = findOwner(newInstance);
      if (owner == null) {
        throw new OpsException();
      }
View Full Code Here

      serviceType = getServiceTypeFromItemType(client, itemType);
    }

    FederationKey host = null;
    ProjectId project = client.getProject();
    return new PlatformLayerKey(host, project, new ServiceType(serviceType), new ItemType(itemType), null);
  }
View Full Code Here

      ElementInfo elementInfo = XmlHelper.getXmlElementInfo(itemClass);

      if (elementInfo != null) {
        ServiceProvider serviceProvider = serviceProvidersByNamespace.get(elementInfo.namespace);
        if (serviceProvider != null) {
          ItemType itemType = new ItemType(elementInfo.elementName);
          modelClass = (ModelClass<T>) serviceProvider.getModelClass(itemType);
        }
      }
    }
    return modelClass;
View Full Code Here

    return build(serviceProvider, clazz);
  }

  public static <T extends ItemBase> ModelClass<T> build(ServiceProvider serviceProvider, Class<T> clazz) {
    JaxbHelper jaxbHelper = JaxbHelper.get(clazz);
    ItemType itemType = new ItemType(JaxbHelper.getXmlElementName(clazz));
    return new ModelClass<T>(serviceProvider, clazz, itemType);
  }
View Full Code Here

      if (entity == null) {
        throw new IllegalStateException();
      }

      ServiceType serviceType = db.getServiceType(entity.service);
      ItemType itemType = db.getItemType(entity.model);

      JaxbHelper jaxbHelper = getJaxbHelper(db, serviceType, itemType);
      T item = mapToModel(project, serviceType, itemType, entity, jaxbHelper, secretProvider);

      int itemId = entity.id;
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);
View Full Code Here

    public ItemType getItemType(int code) throws SQLException {
      String v = mapCodeToKey(ItemType.class, code);
      if (v == null) {
        return null;
      }
      return new ItemType(v);
    }
View Full Code Here

    serviceInfo.serviceType = getServiceType().getKey();
    serviceInfo.description = description;
    // serviceInfo.schema =

    for (ModelClass<?> modelClass : getModels().all()) {
      ItemType itemType = modelClass.getItemType();

      if (serviceInfo.getNamespace() == null) {
        serviceInfo.namespace = modelClass.getPrimaryNamespace();
      }

      if (serviceInfo.itemTypes == null) {
        serviceInfo.itemTypes = Lists.newArrayList();
      }
      serviceInfo.itemTypes.add(itemType.getKey());
    }

    return serviceInfo;
  }
View Full Code Here

    }
  }

  private PlatformLayerKey resolveKey(PlatformLayerKey key) throws OpsException {
    if (key.getServiceType() == null) {
      ItemType itemType = key.getItemType();
      ServiceType serviceType = OpsContext.get().getOpsSystem().getServiceType(itemType);
      key = key.withServiceType(serviceType);
    }

    if (key.getProject() == null) {
View Full Code Here

TOP

Related Classes of org.platformlayer.ids.ItemType

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.