public class MockJiraServiceContainer extends Object implements JiraServiceContainer
| Modifier and Type | Class and Description |
|---|---|
static class |
MockJiraServiceContainer.Builder |
NAME_COMPARATOR| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
This method is called when the service is unloaded (usually when the web application or server
is being shut down).
|
boolean |
equals(Object obj) |
String |
getCronExpression()
Get the cron expression.
|
String |
getDefaultProperty(String propertyKey)
Returns the default property value for a key
|
long |
getDelay()
Get the delay time for this service.
|
String |
getDescription()
A textual description of the service.
|
Long |
getId() |
String |
getKey()
Return the key of this object
|
long |
getLastRun() |
Long |
getLongProperty(String propertyKey)
Returns a property of this object with the specified key as a long
|
String |
getName()
A textual name of the service as entered by the user from the web interface.
|
ObjectConfiguration |
getObjectConfiguration()
Retrieves an object configuration object with properties that can be set
|
com.opensymphony.module.propertyset.PropertySet |
getProperties()
Retrieve all the specified Properties for this object
|
String |
getProperty(String propertyKey)
Returns a property of this object with the specified key
|
String |
getServiceClass() |
Class |
getServiceClassObject() |
String |
getTextProperty(String propertyKey)
Returns a property of this object with the specified key, the property is of type text
|
boolean |
hasProperty(String propertyKey)
Checks if this object has a particular property
|
void |
init(com.opensymphony.module.propertyset.PropertySet props)
Initialise the service.
|
boolean |
isDueAt(long time)
Is this service due to run at the specified time.
|
boolean |
isInternal()
Indicates whether administrators can delete this service from within the web interface.
|
boolean |
isLocalService()
Returns true if in a clustered environment this service should run locally on every node.
|
boolean |
isRunning() |
boolean |
isUnique()
Whether this service class should be unique.
|
boolean |
isUsable() |
void |
run()
Perform the action of this service.
|
void |
setCronExpression(String cron)
Set the cron expression.
|
void |
setDelay(long delay)
Set the delay time for this service.
|
void |
setLastRun()
Record when run.
|
void |
setName(String name)
Used to set the service's name.
|
void |
setRunning(boolean running) |
String |
toString() |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinitpublic long getDelay()
JiraServiceContainergetDelay in interface JiraServiceContainerpublic String getCronExpression()
JiraServiceContainergetCronExpression in interface JiraServiceContainerpublic void setCronExpression(String cron)
JiraServiceContainersetCronExpression in interface JiraServiceContainercron - Cron Expressionpublic Long getId()
getId in interface JiraServiceContainerpublic long getLastRun()
getLastRun in interface JiraServiceContainerpublic boolean isDueAt(long time)
JiraServiceContainerisDueAt in interface JiraServiceContainertime - the time to check whether it is due.public String getServiceClass()
getServiceClass in interface JiraServiceContainerpublic Class getServiceClassObject()
getServiceClassObject in interface JiraServiceContainerpublic boolean isRunning()
isRunning in interface JiraServiceContainerpublic boolean isLocalService()
JiraServiceContainerisLocalService in interface JiraServiceContainerpublic boolean isUsable()
isUsable in interface JiraServiceContainerpublic void setDelay(long delay)
JiraServiceContainersetDelay in interface JiraServiceContainerpublic void setLastRun()
JiraServiceContainersetLastRun in interface JiraServiceContainerpublic void setRunning(boolean running)
public void destroy()
JiraServiceYou may wish to remove any connections that you have established, eg. database connections.
destroy in interface JiraServicepublic String getDescription()
JiraServiceA good description will describe what this service does, and then explains the parameters required for configuring the service.
If no description is appropriate, return null.
getDescription in interface JiraServicepublic String getName()
JiraService
The name should be unique to identify services of the same class.
This is enforced when adding new services via the web interface.
The value of name does not effect the service, hence can be set to null
getName in interface JiraServicepublic void init(com.opensymphony.module.propertyset.PropertySet props)
throws ObjectConfigurationException
JiraServiceAs the parameters are gained from the user's interaction with the website, it is not guaranteed to be called with the correct, or indeed with any parameters.
init() may be called multiple times during the services lifetime.
init in interface JiraServiceprops - initialisation parametersObjectConfigurationException - in case of an error with initialisation parametersJiraService.init(PropertySet, long)public boolean isInternal()
JiraServiceGenerally only Atlassian services should return true from this.
isInternal in interface JiraServicepublic boolean isUnique()
JiraServiceHaving multiple backup services could be fine - perhaps you want to backup once an hour, and also once a day.
With other services, you may wish to enforce their uniqueness
isUnique in interface JiraServicepublic void run()
JiraServiceinit() is guaranteed to be called before run(), but the parameters passed to init() are not guaranteed to be correct. Any parameters expected to be set by init() should be checked in this method upon each invocation.
run in interface JiraServicerun in interface RunnableJiraService.init(com.opensymphony.module.propertyset.PropertySet)public void setName(String name)
JiraServiceJiraService.getName()setName in interface JiraServicename - service name to setpublic String getDefaultProperty(String propertyKey) throws ObjectConfigurationException
ObjectConfigurablegetDefaultProperty in interface ObjectConfigurablepropertyKey - String key used to retrieve the properties default valueObjectConfigurationExceptionpublic String getKey()
ObjectConfigurablegetKey in interface ObjectConfigurablepublic Long getLongProperty(String propertyKey) throws ObjectConfigurationException
ObjectConfigurablegetLongProperty in interface ObjectConfigurablepropertyKey - String key used to retrieve the property valueObjectConfigurationExceptionpublic ObjectConfiguration getObjectConfiguration() throws ObjectConfigurationException
ObjectConfigurablegetObjectConfiguration in interface ObjectConfigurableObjectConfigurationExceptionpublic com.opensymphony.module.propertyset.PropertySet getProperties()
throws ObjectConfigurationException
ObjectConfigurablegetProperties in interface ObjectConfigurableObjectConfigurationExceptionpublic String getProperty(String propertyKey) throws ObjectConfigurationException
ObjectConfigurablegetProperty in interface ObjectConfigurablepropertyKey - String key used to retrieve the property valueObjectConfigurationExceptionpublic String getTextProperty(String propertyKey) throws ObjectConfigurationException
ObjectConfigurablegetTextProperty in interface ObjectConfigurablepropertyKey - String key used to retrieve the property valueObjectConfigurationExceptionpublic boolean hasProperty(String propertyKey) throws ObjectConfigurationException
ObjectConfigurablehasProperty in interface ObjectConfigurablepropertyKey - to look forObjectConfigurationExceptionCopyright © 2002-2018 Atlassian. All Rights Reserved.