|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.service.JiraServiceContainer
Proxies calls to JiraService & manages delay between calls.
Constructor Summary | |
JiraServiceContainer(JiraService service)
|
Method Summary | |
void |
destroy()
This method is called when the service is unloaded (usually when the web application or server is being shut down). |
String[] |
getAcceptedParams()
Deprecated. |
String |
getDefaultProperty(String propertyKey)
|
long |
getDelay()
The length of delay in milliseconds between runs of this service. |
String |
getDescription()
A textual description of the service. |
String |
getKey()
|
long |
getLastRun()
The time that this service was last run. |
Long |
getLongProperty(String propertyKey)
|
String |
getName()
A textual name of the service as entered by the user from the web interface. |
com.atlassian.configurable.ObjectConfiguration |
getObjectConfiguration()
|
com.opensymphony.module.propertyset.PropertySet |
getProperties()
|
String |
getProperty(String propertyKey)
|
String |
getTextProperty(String propertyKey)
|
boolean |
hasProperty(String propertyKey)
|
void |
init(com.opensymphony.module.propertyset.PropertySet props)
Initialise the service. |
boolean |
isInternal()
Indicates whether administrators can delete this service from within the web interface. |
boolean |
isRunning()
Whether a service is currently running. |
boolean |
isUnique()
Whether this service class should be unique. |
void |
run()
Perform the action of this service. |
void |
setDelay(long delay)
Sets the delay between invocation of each service. |
void |
setLastRun()
Set the last run time to be the current time. |
void |
setName(String name)
Used to set the service's name. |
void |
setRunning(boolean running)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JiraServiceContainer(JiraService service)
Method Detail |
public void init(com.opensymphony.module.propertyset.PropertySet props) throws com.atlassian.configurable.ObjectConfigurationException
JiraService
As 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 JiraService
com.atlassian.configurable.ObjectConfigurationException
public String[] getAcceptedParams()
public void run()
init() 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 JiraService
JiraService.init(com.opensymphony.module.propertyset.PropertySet)
public void destroy()
You may wish to remove any connections that you have established, eg. database connections.
destroy
in interface JiraService
public boolean isInternal()
Generally only Atlassian services should return true from this.
isInternal
in interface JiraService
public final long getLastRun()
public final void setLastRun()
run()
public void setDelay(long delay)
delay
- The time in milliseconds between runs of the service.public long getDelay()
public boolean isUnique()
JiraService
Having 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 JiraService
public String getDescription()
JiraService
A 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 JiraService
public 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 JiraService
public void setName(String name)
JiraService
JiraService.getName()
setName
in interface JiraService
public String toString()
public com.atlassian.configurable.ObjectConfiguration getObjectConfiguration() throws com.atlassian.configurable.ObjectConfigurationException
getObjectConfiguration
in interface com.atlassian.configurable.ObjectConfigurable
com.atlassian.configurable.ObjectConfigurationException
public boolean hasProperty(String propertyKey) throws com.atlassian.configurable.ObjectConfigurationException
hasProperty
in interface com.atlassian.configurable.ObjectConfigurable
com.atlassian.configurable.ObjectConfigurationException
public String getProperty(String propertyKey) throws com.atlassian.configurable.ObjectConfigurationException
getProperty
in interface com.atlassian.configurable.ObjectConfigurable
com.atlassian.configurable.ObjectConfigurationException
public String getTextProperty(String propertyKey) throws com.atlassian.configurable.ObjectConfigurationException
getTextProperty
in interface com.atlassian.configurable.ObjectConfigurable
com.atlassian.configurable.ObjectConfigurationException
public Long getLongProperty(String propertyKey) throws com.atlassian.configurable.ObjectConfigurationException
getLongProperty
in interface com.atlassian.configurable.ObjectConfigurable
com.atlassian.configurable.ObjectConfigurationException
public String getDefaultProperty(String propertyKey) throws com.atlassian.configurable.ObjectConfigurationException
getDefaultProperty
in interface com.atlassian.configurable.ObjectConfigurable
com.atlassian.configurable.ObjectConfigurationException
public com.opensymphony.module.propertyset.PropertySet getProperties() throws com.atlassian.configurable.ObjectConfigurationException
getProperties
in interface com.atlassian.configurable.ObjectConfigurable
com.atlassian.configurable.ObjectConfigurationException
public boolean isRunning()
public void setRunning(boolean running)
public String getKey()
getKey
in interface com.atlassian.configurable.ObjectConfigurable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |