Package org.platformlayer.ids

Examples of org.platformlayer.ids.ServiceType


    // } else {
    targetAddress = NetworkPoint.forPublicHostname(model.host);
    // }

    Machine machine = new OpaqueMachine(targetAddress);
    OpsTarget machineTarget = machine.getTarget(sshKeys.findOtherServiceKey(new ServiceType("machines-direct")));

    CasStoreInfo casStoreOptions = new CasStoreInfo(true);
    FilesystemCasStore store = new FilesystemCasStore(casStoreOptions, new OpsCasTarget(machineTarget));
    return store;
  }
View Full Code Here


    Machine machine = getMachine(item);
    return getTarget(item, machine);
  }

  public OpsTarget getTarget(ItemBase item, Machine machine) throws OpsException {
    ServiceType serviceType = serviceProviders.getServiceType(item.getClass());

    // TODO: This is so evil...
    SshKey sshKey = sshKeys.findOtherServiceKey(serviceType);

    return machine.getTarget(sshKey);
View Full Code Here

  private List<ModelClass<?>> findModelsProviding(Class<?> serviceClass) throws OpsException {
    List<ModelClass<?>> models = Lists.newArrayList();

    for (ServiceInfo service : serviceProviderDictionary.getAllServices()) {
      ServiceType serviceType = new ServiceType(service.getServiceType());
      ServiceProvider serviceProvider = serviceProviderDictionary.getServiceProvider(serviceType);
      for (ModelClass<?> model : serviceProvider.getModels().all()) {
        Class<?> controllerClass = serviceProvider.getControllerClass(model.getJavaClass());
        if (serviceClass.isAssignableFrom(controllerClass)) {
          models.add(model);
View Full Code Here

    String key = serviceAnnotation.value();

    // this.serviceType = serviceType;
    this.description = key;
    this.serviceType = new ServiceType(key);
  }
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) {
      key = key.withProject(OpsContext.get().getPlatformLayerClient().getProject());
View Full Code Here

      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

    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

    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

    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

  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

TOP

Related Classes of org.platformlayer.ids.ServiceType

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.