Package org.platformlayer.ids

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


  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

  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

  // return serviceUtils.listItems(getProject(), modelClass);
  // }

  @Path("{serviceType}")
  public ServiceResource getServiceResource(@PathParam("serviceType") String serviceType) {
    getScope().put(new ServiceType(serviceType));

    ServiceResource resource = objectInjector.getInstance(ServiceResource.class);
    return resource;
  }
View Full Code Here

import org.platformlayer.ids.ServiceType;

public class ServiceAuthorizationCollectionResource extends XaasResourceBase {
  @Path("{serviceType}")
  public ServiceAuthorizationResource getOne(@PathParam("serviceType") String serviceType) {
    getScope().put(new ServiceType(serviceType));

    ServiceAuthorizationResource resource = objectInjector.getInstance(ServiceAuthorizationResource.class);
    return resource;
  }
View Full Code Here

public class ServiceAuthorizationResource extends XaasResourceBase {
  @GET
  @Produces({ XML, JSON })
  public ServiceAuthorization retrieveItem() throws RepositoryException {
    ServiceType serviceType = getServiceType();

    ServiceAuthorization auth = authorizationRepository.findServiceAuthorization(serviceType, getProject());
    if (auth == null) {
      throw new WebApplicationException(404);
    }
View Full Code Here

  @POST
  @Consumes({ XML, JSON })
  @Produces({ XML, JSON })
  public <T> ServiceAuthorization createService(final ServiceAuthorization authorization) throws OpsException,
      RepositoryException {
    ServiceType serviceType = getServiceType();
    authorization.serviceType = serviceType.getKey();

    final ServiceProvider serviceProvider = opsSystem.getServiceProvider(serviceType);
    if (serviceProvider == null) {
      log.warn("Unknown serviceProvider: " + serviceType);
      throw new WebApplicationException(404);
View Full Code Here

  private void checkItemKey(ItemBase item) throws OpsException {
    PlatformLayerKey key = item.getKey();

    ManagedItemId itemId = getItemId();
    ServiceType serviceType = getServiceType();
    ItemType itemType = getItemType();
    ProjectId project = getProject();

    if (key != null) {
      if (key.getItemId() != null && !equal(key.getItemId(), itemId)) {
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.