@ExperimentalApi @Immutable public final class

RemoteProject

extends Object
java.lang.Object
   ↳ com.atlassian.jira.project.RemoteProject

@ExperimentalApi

This class is considered usable by external developers but its contracts have not stabilized.

Experimental APIs may be changed at any time before being marked @Internal or @PublicApi.

Class Overview

Represents a JIRA Project within our "network" of federated JIRA servers.

Normally this will represent a project coming from one of the JIRA servers that we have an app link with. However, because it can be useful to create a list with both local and remote projects, one can construct an instance of this class that represents a local project.

This class is considered experimental while RemoteProjectService is still being developed.

Summary

Nested Classes
class RemoteProject.Builder  
Public Constructors
RemoteProject(long id, String key, String name, String description, RemoteUser leadUser, String url, ApplicationLink applicationLink, RemoteAvatar avatar)
Public Methods
@Nonnull static RemoteProject from(ApplicationLink applicationLink, JSONObject jsonObject)
@Nonnull static RemoteProject from(Project project)
Build a Network project instance from a local Project.
@Nullable ApplicationLink getApplicationLink()
Returns the AppLink for the server that this remote project lives on.
@Nonnull RemoteAvatar getAvatar()
@Nonnull String getBrowseProjectUrl()
Returns the URL for the "Browse Project" page of this project.
@Nullable String getDescription()
Returns the description for the underlying project, or null if the description was not supplied in the JSON response.
long getId()
@Nonnull String getKey()
@Nullable RemoteUser getLeadUser()
Returns the Project Lead for this project.
@Nonnull String getName()
@Nonnull String getServerBaseUrl()
Returns the Base URL for the server that this project lives on.
@Nullable String getUrl()
Returns the configured "URL" value for this project.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RemoteProject (long id, String key, String name, String description, RemoteUser leadUser, String url, ApplicationLink applicationLink, RemoteAvatar avatar)

Public Methods

@Nonnull public static RemoteProject from (ApplicationLink applicationLink, JSONObject jsonObject)

Throws
JSONException

@Nonnull public static RemoteProject from (Project project)

Build a Network project instance from a local Project.

Parameters
project the local project
Returns
  • a NetworkProject instance representing the given local project.

@Nullable public ApplicationLink getApplicationLink ()

Returns the AppLink for the server that this remote project lives on.

Will return null if the project is representing a local project on this server.

Returns
  • the AppLink for the server that this remote project lives on, or null for a local project.

@Nonnull public RemoteAvatar getAvatar ()

@Nonnull public String getBrowseProjectUrl ()

Returns the URL for the "Browse Project" page of this project.

Returns
  • the URL for the "Browse Project" page of this project.

@Nullable public String getDescription ()

Returns the description for the underlying project, or null if the description was not supplied in the JSON response.

An empty String is returned if the project has a blank description. A null return value indicates that the description was not returned over the wire, and should be treated as an "unknown" value.

Returns
  • the description for the underlying project, or null if the description was not supplied in the JSON response.

public long getId ()

@Nonnull public String getKey ()

@Nullable public RemoteUser getLeadUser ()

Returns the Project Lead for this project.

In the REST API for JIRA 6.1, this value is returned when getting a single project, but not when getting all projects, so this value can sometimes be null even if the underlying project has a lead. Developers should treat a null value as "unknown".

Returns
  • the Project Lead for this project.

@Nonnull public String getName ()

@Nonnull public String getServerBaseUrl ()

Returns the Base URL for the server that this project lives on.

Returns
  • the Base URL for the server that this project lives on.

@Nullable public String getUrl ()

Returns the configured "URL" value for this project.

In the REST API for JIRA 6.1, this value is returned when getting a single project, but not when getting all projects, so this value can sometimes be null even if the underlying project has a URL specified. Consumers should treat a null value as "unknown".

Returns
  • the configured "URL" value for this project, or null if not known.