Package org.platformlayer.ids

Examples of org.platformlayer.ids.ProjectId


  public <T extends ItemBase> T findItem(ProjectAuthorization auth, Class<T> itemClass, String id)
      throws OpsException {
    ModelClass<T> modelClass = serviceProviderDirectory.getModelClass(itemClass);
    // Class<T> javaClass = modelClass.getJavaClass();

    ProjectId project = getProjectId(auth);

    PlatformLayerKey modelKey = new PlatformLayerKey(null, project, modelClass.getServiceType(),
        modelClass.getItemType(), new ManagedItemId(id));

    boolean fetchTags = true;
View Full Code Here


    return managedItem;
  }

  @Override
  public List<ItemBase> findRoots(ProjectAuthorization authentication) throws OpsException {
    ProjectId project = getProjectId(authentication);

    boolean fetchTags = true;
    List<ItemBase> items;
    try {
      items = repository.findRoots(project, fetchTags, SecretProvider.from(authentication));
View Full Code Here

    return items;
  }

  @Override
  public List<ItemBase> listAll(ProjectAuthorization authentication, Filter filter) throws OpsException {
    ProjectId project = getProjectId(authentication);

    List<ItemBase> items;
    try {
      items = repository.listAll(project, filter, SecretProvider.from(authentication));
    } catch (RepositoryException e) {
View Full Code Here

  private ProjectId getProjectId(ProjectAuthorization authentication) {
    String key = authentication.getName();
    if (key == null) {
      throw new IllegalStateException();
    }
    return new ProjectId(key);
  }
View Full Code Here

    ProjectAuthorization project = getScopeParameter(ProjectAuthorization.class, true);
    return project;
  }

  protected ProjectId getProject() {
    ProjectId project = getScopeParameter(ProjectId.class, true);
    return project;
  }
View Full Code Here

    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)) {
        throw new OpsException("Item id mismatch");
      }
View Full Code Here

  public int getId() {
    // We have our own codes for projects

    if (projectId == 0) {
      try {
        projectId = repository.getProjectCode(new ProjectId(getName()));
      } catch (RepositoryException e) {
        throw new IllegalStateException("Error mapping project code", e);
      }
    }
    return projectId;
View Full Code Here

TOP

Related Classes of org.platformlayer.ids.ProjectId

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.