Tabnine Logo
EntityIdentifier
Code IndexAdd Tabnine to your IDE (free)

How to use
EntityIdentifier
in
com.atlassian.streams.spi

Best Java code snippets using com.atlassian.streams.spi.EntityIdentifier (Showing top 20 results out of 315)

origin: com.atlassian.streams/streams-testing

@Test
public void assertThatIdentifierOfUnknownTypeReturnsNoFilterKey()
{
  assertThat(provider.getFilterKey(new EntityIdentifier(UNKNOWN_ENTITY_TYPE, PROJECT_ENTITY_KEY, URI.create(UNKNOWN_BASE_URL))),
        equalTo(none(String.class)));
}

origin: com.atlassian.streams/streams-crucible-plugin

@Override
public Option<URI> getEntityURI(EntityIdentifier identifier)
{
  if (identifier.getType().equals(project().iri()))
  {
    return some(URI.create(applicationProperties.getBaseUrl() + PROJECT_URL_PREFIX + identifier.getValue()));
  }
  return none();
}

origin: com.atlassian.streams/streams-testing

@Override
protected boolean matchesSafely(EntityIdentifier identifier, Description mismatchDescription)
{
  if (!matcher.matches(identifier.getUri()))
  {
    mismatchDescription.appendText("uri ");
    matcher.describeMismatch(identifier.getUri(), mismatchDescription);
    return false;
  }
  return true;
}
origin: com.atlassian.streams/streams-testing

@Override
protected boolean matchesSafely(EntityIdentifier identifier, Description mismatchDescription)
{
  if (!matcher.matches(identifier.getType()))
  {
    mismatchDescription.appendText("type ");
    matcher.describeMismatch(identifier.getType(), mismatchDescription);
    return false;
  }
  return true;
}
origin: com.atlassian.streams/streams-testing

@Override
protected boolean matchesSafely(EntityIdentifier identifier, Description mismatchDescription)
{
  if (!matcher.matches(identifier.getValue()))
  {
    mismatchDescription.appendText("value ");
    matcher.describeMismatch(identifier.getValue(), mismatchDescription);
    return false;
  }
  return true;
}
origin: com.atlassian.streams/streams-confluence-plugin

@Override
public Option<String> getFilterKey(EntityIdentifier identifier)
{
  if (identifier.getType().equals(space().iri()))
  {
    return some(PROJECT_KEY);
  }
  return none();
}

origin: com.atlassian.streams/streams-fisheye-plugin

@Override
public Option<URI> getEntityURI(EntityIdentifier identifier)
{
  if (identifier.getType().equals(repository().iri()))
  {
    return some(URI.create(applicationProperties.getBaseUrl() + PROJECT_URL_PREFIX + identifier.getValue()));
  }
  return none();
}
origin: com.atlassian.streams/streams-testing

protected EntityIdentifier getIssueEntityIdentifier(String key)
{
  return new EntityIdentifier(getIssueEntityType(),
                key,
                getIssueUri(key));
}

origin: com.atlassian.streams/streams-fisheye-plugin

@Override
public Option<String> getFilterKey(EntityIdentifier identifier)
{
  if (identifier.getType().equals(repository().iri()))
  {
    return some(PROJECT_KEY);
  }
  return none();
}

origin: com.atlassian.streams/streams-jira-plugin

@Override
public Option<URI> getEntityURI(EntityIdentifier identifier)
{
  if (identifier.getType().equals(project().iri())
    || identifier.getType().equals(issue().iri()))
  {
    return some(URI.create(applicationProperties.getBaseUrl() + BROWSE + identifier.getValue()));
  }
  return none();
}
origin: com.atlassian.streams/streams-testing

protected EntityIdentifier getProjectEntityIdentifier(String key)
{
  return new EntityIdentifier(getProjectEntityType(),
                key,
                getProjectUri(key));
}

origin: com.atlassian.streams/streams-jira-plugin

@Override
public Option<Boolean> getCurrentUserEditPermission(EntityIdentifier identifier)
{
  if (identifier.getType().equals(issue().iri()))
  {
    // JIRA only defines an Edit permission for issues, not for projects
    return getCurrentUserPermission(identifier, Permissions.EDIT_ISSUE);
  }
  return getCurrentUserViewPermission(identifier);
}
origin: com.atlassian.streams/streams-confluence-plugin

@Override
public Option<URI> getEntityURI(EntityIdentifier identifier)
{
  if (identifier.getType().equals(space().iri()))
  {
    return some(URI.create(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + URL_PREFIX + encode(identifier.getValue())));
  }
  return none();
}
origin: com.atlassian.streams/streams-fisheye-plugin

  private Iterable<EntityIdentifier> matchEntities(String input)
  {
    Matcher matcher = PROJECT_PATTERN.matcher(input);
    //the target URI is of an unknown format
    if (!matcher.matches())
    {
      return ImmutableList.of();
    }

    String repoKey = matcher.group(1);
    RepositoryHandle repo = repositoryManager.getRepository(repoKey);
    if (repo != null)
    {
      URI canonicalUri = URI.create(applicationProperties.getBaseUrl() + PROJECT_URL_PREFIX + repoKey);
      return ImmutableList.of(new EntityIdentifier(repository().iri(),
                             repoKey,
                             canonicalUri));
    }
    else
    {
      return ImmutableList.of();
    }
  }
}
origin: com.atlassian.streams/streams-crucible-plugin

@Override
public Option<String> getFilterKey(EntityIdentifier identifier)
{
  if (identifier.getType().equals(project().iri()))
  {
    return some(PROJECT_KEY);
  }
  return none();
}

origin: com.atlassian.streams/streams-fisheye-plugin

@Override
public Option<Boolean> getCurrentUserViewPermission(EntityIdentifier identifier)
{
  if (identifier.getType().equals(repository().iri()))
  {
    RepositoryHandle repo = repositoryManager.getRepository(identifier.getValue());
    if (repo != null)
    {
      return some(Boolean.valueOf(permissionAccessor.currentUserCanView(repo)));
    }
  }
  return none();
}

origin: com.atlassian.streams/streams-crucible-plugin

  private Iterable<EntityIdentifier> matchEntities(String input)
  {   
    Matcher matcher = PROJECT_PATTERN.matcher(input);
    //the target URI is of an unknown format
    if (!matcher.matches())
    {
      return ImmutableList.of();
    }

    String projectKey = matcher.group(1);
    ProjectData project = projectService.getProject(projectKey);
    if (project != null)
    {
      URI canonicalUri = URI.create(applicationProperties.getBaseUrl()+ PROJECT_URL_PREFIX + projectKey);
      return ImmutableList.of(new EntityIdentifier(project().iri(),
                             projectKey,
                             canonicalUri));
    }
    else
    {
      return ImmutableList.of();
    }
  }
}
origin: com.atlassian.streams/streams-jira-plugin

@Override
public Option<String> getFilterKey(EntityIdentifier identifier)
{
  if (identifier.getType().equals(project().iri()))
  {
    return some(PROJECT_KEY);
  }
  else if (identifier.getType().equals(issue().iri()))
  {
    return some(ISSUE_KEY.getKey());
  }
  return none();
}
origin: com.atlassian.streams/streams-crucible-plugin

@Override
public Option<Boolean> getCurrentUserViewPermission(EntityIdentifier identifier)
{
  if (identifier.getType().equals(project().iri()))
  {
    ProjectData projectData = projectService.getProject(identifier.getValue());
    if (projectData != null)
    {
      return some(Boolean.valueOf(projectService.hasPermission(projectData.getKey(), UserActionManager.ACTION_VIEW)));
    }
  }
  return none();
}
origin: com.atlassian.streams/streams-confluence-plugin

  private Iterable<EntityIdentifier> matchEntities(String input)
  {
    Matcher spaceMatcher = SPACE_PATTERN.matcher(input);
    if (spaceMatcher.matches())
    {
      String spaceKey = spaceMatcher.group(1);
      Space space = spaceManager.getSpace(spaceKey);
      if (space != null)
      {
        URI canonicalUri = URI.create(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + URL_PREFIX + encode(spaceKey));
        return ImmutableList.of(new EntityIdentifier(space().iri(),
                               spaceKey,
                               canonicalUri));
      }
    }

    return ImmutableList.of();
  }
}
com.atlassian.streams.spiEntityIdentifier

Javadoc

Abstract representation of a provider-defined entity that can be associated with any number of entries in a stream: for example, a JIRA project or issue.

Most used methods

  • <init>
    Constructs a new immutable EntityIdentifier.
  • getType
    An IRI describing the type of entity that this identifier refers to.
  • getValue
    The canonical unique identifier of this entity within its type. For instance, for a JIRA issue, this
  • getUri
    The canonical URI for the entity.

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now