java.lang.Object |
↳ |
com.atlassian.jira.entity.remotelink.AbstractRemoteEntityLinkService |
Known Direct Subclasses
|
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
Base tools for implementing a remote entity link service that uses the
JsonEntityPropertyManager
to store the link data.
Summary
Protected Methods |
@Nullable
String
|
getEntityPropertyValue(Long entityId, String globalId)
Retrieve the stored JSON for an entity link.
|
String
|
putEntityPropertyDryRun(Long entityId, String globalId, String json)
|
@Nonnull
String
|
putEntityPropertyValue(Long entityId, String globalId, String json)
Store JSON data representing an entity link.
|
static
void
|
verifyNotBlank(ErrorCollection errors, I18nHelper i18n, String field, String value)
|
static
void
|
verifyNotNull(ErrorCollection errors, I18nHelper i18n, String field, Object value)
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Constants
protected
static
final
String
MSG_APPLICATION_NAME
Constant Value:
"remotelink.service.applicationname"
protected
static
final
String
MSG_APPLICATION_TYPE
Constant Value:
"remotelink.service.applicationtype"
protected
static
final
String
MSG_DOES_NOT_EXIST
Constant Value:
"remotelink.service.does.not.exist"
protected
static
final
String
MSG_ERROR_CREATING
Constant Value:
"remotelink.service.error.creating"
protected
static
final
String
MSG_ERROR_REMOVING
Constant Value:
"remotelink.service.error.removing"
protected
static
final
String
MSG_ERROR_UPDATING
Constant Value:
"remotelink.service.error.updating"
protected
static
final
String
MSG_FIELD_TOO_LONG
Constant Value:
"remotelink.service.field.too.long"
protected
static
final
String
MSG_GLOBAL_ID
Constant Value:
"remotelink.service.globalid"
protected
static
final
String
MSG_INVALID_JSON
Constant Value:
"remotelink.service.invalid.json"
protected
static
final
String
MSG_INVALID_URI
Constant Value:
"remotelink.service.invalid.uri"
protected
static
final
String
MSG_IS_REQUIRED
Constant Value:
"admin.common.words.is.required"
protected
static
final
String
MSG_TITLE
Constant Value:
"remotelink.service.title"
protected
static
final
String
MSG_URL
Constant Value:
"remotelink.service.url"
Fields
protected
final
String
entityName
Protected Constructors
protected
AbstractRemoteEntityLinkService
(String entityName, JsonEntityPropertyManager jsonEntityPropertyManager)
Super-constructor for all remote entity link services that use JSON entity properties for storage.
Parameters
entityName
| the entity name that should be used when storing the JSON properties for this link service.
this MUST be unique to the service. To reduce the risk of collision, it
SHOULD NOT be the same as the name of the entity itself. For example,
RemoteVersionLinkService
uses "RemoteVersionLink", not "Version". |
jsonEntityPropertyManager
| the injected JsonEntityPropertyManager component
|
Protected Methods
@Nullable
protected
String
getEntityPropertyValue
(Long entityId, String globalId)
Retrieve the stored JSON for an entity link.
Parameters
entityId
| the ID of the specific entity that this remote entity link was stored against |
globalId
| the global ID against which the entity link was stored. See the return value of
putEntityPropertyValue(Long, String, String) for more information. |
Returns
- the stored JSON, or
null
if the remote entity link does not exist
protected
String
putEntityPropertyDryRun
(Long entityId, String globalId, String json)
Returns
- the global ID that would have been used to store the link. If this method is used to
perform validation, then this value may be passed in as the
globalId
parameter in
the following call to putEntityPropertyValue(Long, String, String)
to guarantee
that the same value will be used even if it is a generated UUID.
@Nonnull
protected
String
putEntityPropertyValue
(Long entityId, String globalId, String json)
Store JSON data representing an entity link.
Parameters
entityId
| the ID of the specific entity that this remote entity link will be stored against |
globalId
| the global ID against which to store the remote entity link, or null . If
it is null , then the supplied json value is examined to see if it is a
valid JSON object with a value specified for GLOBAL_ID
generate a new unique identifier to serve as the global ID |
json
| the content to be stored |
Returns
- the global ID used to store the link. If the supplied JSON is an an object that contains
a string field called {@value RemoteEntityLink#GLOBAL_ID} at its top level, then that value
will be extracted and used as the global ID for storage. Otherwise, a global ID will be
generated by this method and returned in its place.