|
||||||||||
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). |
java.lang.String[] |
getAcceptedParams()
Deprecated. |
java.lang.String |
getDefaultProperty(java.lang.String propertyKey)
|
long |
getDelay()
The length of delay in milliseconds between runs of this service. |
java.lang.String |
getDescription()
A textual description of the service. |
long |
getLastRun()
The time that this service was last run. |
java.lang.Long |
getLongProperty(java.lang.String propertyKey)
|
ObjectConfiguration |
getObjectConfiguration()
|
PropertySet |
getProperties()
|
java.lang.String |
getProperty(java.lang.String propertyKey)
|
boolean |
hasProperty(java.lang.String propertyKey)
|
void |
init(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 |
setRunning(boolean running)
|
java.lang.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(PropertySet props) throws 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
ObjectConfigurationException
public java.lang.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(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 java.lang.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 java.lang.String toString()
public ObjectConfiguration getObjectConfiguration() throws ObjectConfigurationException
ObjectConfigurationException
public boolean hasProperty(java.lang.String propertyKey) throws ObjectConfigurationException
ObjectConfigurationException
public java.lang.String getProperty(java.lang.String propertyKey) throws ObjectConfigurationException
ObjectConfigurationException
public java.lang.Long getLongProperty(java.lang.String propertyKey) throws ObjectConfigurationException
ObjectConfigurationException
public java.lang.String getDefaultProperty(java.lang.String propertyKey) throws ObjectConfigurationException
ObjectConfigurationException
public PropertySet getProperties() throws ObjectConfigurationException
ObjectConfigurationException
public boolean isRunning()
public void setRunning(boolean running)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |