Examples of ServiceType


Examples of org.platformlayer.ids.ServiceType

  @Override
  @JdbcTransaction
  public ServiceAuthorization createAuthorization(ProjectId project, ServiceAuthorization authorization)
      throws RepositoryException {
    try {
      ServiceType serviceType = new ServiceType(authorization.serviceType);

      JdbcConnection connection = connectionProvider.get();
      int serviceId = JdbcRepositoryHelpers.getServiceKey(connection, serviceType);
      int projectId = JdbcRepositoryHelpers.getProjectKey(connection, project);
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

    for (ItemEntity entity : result.getAll(ItemEntity.class)) {
      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);
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

        throw new IllegalStateException();
      }

      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,
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

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

Examples of org.platformlayer.ids.ServiceType

      javaClasses.add(ValidateAction.class);
      javaClasses.add(DeleteAction.class);
      javaClasses.add(BackupAction.class);

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

        for (ModelClass<?> modelClass : serviceProvider.getModels().all()) {
          javaClasses.add(modelClass.getJavaClass());
          // String modelNamespace = modelClass.getJaxbHelper().getPrimaryNamespace();
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

          serviceTypes.add(service.getServiceType());
        }
      }
    }
    if (serviceTypes.size() == 1) {
      return new ServiceType(serviceTypes.get(0));
    }

    if (serviceTypes.size() == 0) {
      throw new OpsException("Item type cannot be resolved: " + findItemType);
    }
View Full Code Here

Examples of org.platformlayer.ids.ServiceType

    if (url.getScheme().equals("ssh")) {
      String myAddress = url.getHost();
      Machine machine = new OpaqueMachine(NetworkPoint.forPublicHostname(myAddress));
      // This is nasty; we're in the context of another service here...
      SshKey sshKey = sshKeys.findOtherServiceKey(new ServiceType("imagestore"));
      OpsTarget target = machine.getTarget("imagestore", sshKey.getKeyPair());

      DirectImageStore directImageStore = OpsContext.get().getInjector().getInstance(DirectImageStore.class);
      directImageStore.connect(target);
      return directImageStore;
View Full Code Here

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

Examples of org.platformlayer.ids.ServiceType

    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

Examples of org.platformlayer.ids.ServiceType

  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
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.