Package org.platformlayer.ids

Examples of org.platformlayer.ids.ServiceType


    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


      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

  public List<ServiceInfo> getAllServices() {
    return Collections.unmodifiableList(allServices);
  }

  public void addService(ServiceProvider serviceProvider) {
    ServiceType serviceType = serviceProvider.getServiceType();
    if (serviceProviders.containsKey(serviceType)) {
      throw new IllegalArgumentException("Duplicate service key: " + serviceType);
    }
    serviceProviders.put(serviceType, serviceProvider);
View Full Code Here

  @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

    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

        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

    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

      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

          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

    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

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.