Examples of ServiceType


Examples of org.platformlayer.ids.ServiceType

    String key = serviceAnnotation.value();

    // this.serviceType = serviceType;
    this.description = key;
    this.serviceType = new ServiceType(key);
  }
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

  }

  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) {
      key = key.withProject(OpsContext.get().getPlatformLayerClient().getProject());
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

      final ProjectAuthorization project = activeJob.getProjectAuthorization();

      final OpsContext opsContext = opsContextBuilder.buildOpsContext(activeJob);

      final ServiceType serviceType = activeJob.getServiceType();
      final ServiceProvider serviceProvider = opsSystem.getServiceProvider(serviceType);

      try {
        return OpsContext.runInContext(opsContext, new CheckedCallable<Object, Exception>() {
          @Override
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

    ProjectId runAsProjectId = new ProjectId(runAsProject.getName());
    return runAsProjectId;
  }

  public OpsContext buildOpsContext(ActiveJobExecution activeJob) throws OpsException {
    ServiceType serviceType = activeJob.getServiceType();
    ProjectAuthorization projectAuthz = activeJob.getProjectAuthorization();

    List<ProjectAuthorization> projects = Lists.newArrayList();

    ProjectAuthorization runAsProject = projectAuthz; // .getProject();
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

    ServiceInfo service = getServiceInfo(services, namespaceURI);
    if (service == null) {
      throw new PlatformLayerClientException("Cannot find service for " + namespaceURI);
    }

    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

Examples of org.platformlayer.ids.ServiceType

    String componentProject = components.get(0);
    ProjectId project = !Strings.isNullOrEmpty(componentProject) ? new ProjectId(componentProject) : null;

    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

Examples of org.platformlayer.ids.ServiceType

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

  public static PlatformLayerKey fromServiceAndItem(String serviceType, String itemType) {
    return new PlatformLayerKey(null, null, new ServiceType(serviceType), ItemType.wrap(itemType), null);
  }
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

  }

  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

Examples of org.platformlayer.ids.ServiceType

  public <T extends ItemBase> List<ModelClass<? extends T>> getModelSubclasses(Class<T> parent) {
    List<ModelClass<? extends T>> modelClasses = Lists.newArrayList();

    for (ServiceInfo serviceInfo : serviceProviderDictionary.getAllServices()) {
      ServiceType serviceType = new ServiceType(serviceInfo.serviceType);
      ServiceProvider serviceProvider = serviceProviderDictionary.getServiceProvider(serviceType);

      for (ModelClass<?> modelClass : serviceProvider.getModels().all()) {
        Class<?> javaClass = modelClass.getJavaClass();
        if (parent.isAssignableFrom(javaClass)) {
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

  public ModelClass<?> getModelClass(PlatformLayerKey platformLayerKey) {
    OpsContext ops = OpsContext.get();
    ServiceProviderDictionary serviceProviderDictionary = ops.getInjector().getInstance(
        ServiceProviderDictionary.class);

    ServiceType serviceType = platformLayerKey.getServiceType();
    ItemType itemType = platformLayerKey.getItemType();

    ServiceProvider serviceProvider = serviceProviderDictionary.getServiceProvider(serviceType);
    if (serviceProvider == null) {
      throw new IllegalArgumentException();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.