@PublicApi
public interface ServiceManager
Modifier and Type | Interface and Description |
---|---|
static interface |
ServiceManager.ServiceScheduleSkipper
Deprecated.
v6.2 This is no longer used.
|
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_ID_KEY |
Modifier and Type | Method and Description |
---|---|
JiraServiceContainer |
addService(String name,
Class<? extends JiraService> serviceClass,
long delay)
Deprecated.
Use
addService(String, String, String) instead. Since v6.4. |
JiraServiceContainer |
addService(String name,
Class<? extends JiraService> serviceClass,
long delay,
Map<String,String[]> params)
Deprecated.
Use
addService(String, Class, String, java.util.Map) instead. Since v6.4. |
JiraServiceContainer |
addService(String name,
Class<? extends JiraService> serviceClass,
String cronExpression)
This will add a service configuration to the JIRA DB and the service to the list of services which are running.
|
JiraServiceContainer |
addService(String name,
Class<? extends JiraService> serviceClass,
String cronExpression,
long delay,
Map<String,String[]> params)
This will add a service configuration to the JIRA DB and the service to the list of services which are running with
an optional list of params.
|
JiraServiceContainer |
addService(String name,
Class<? extends JiraService> serviceClass,
String cronExpression,
Map<String,String[]> params)
This will add a service configuration to the JIRA DB and the service to the list of services which are running with
an optional list of params.
|
JiraServiceContainer |
addService(String name,
String className,
long delay)
Deprecated.
Use
addService(String, String, String) instead. Since v6.4. |
JiraServiceContainer |
addService(String name,
String className,
long delay,
Map<String,String[]> params)
Deprecated.
Use
addService(String, String, String, java.util.Map) instead. Since v6.4. |
JiraServiceContainer |
addService(String name,
String className,
String cronExpression)
This will add a service configuration to the JIRA DB and the service to the list of services which are running.
|
JiraServiceContainer |
addService(String name,
String className,
String cronExpression,
long delay,
Map<String,String[]> params)
This will add a service configuration to the JIRA DB and the service to the list of services which are running with
an optional list of params.
|
JiraServiceContainer |
addService(String name,
String className,
String cronExpression,
Map<String,String[]> params)
This will add a service configuration to the JIRA DB and the service to the list of services which are running with
an optional list of params.
|
boolean |
containsServiceWithId(Long id)
Quick way of telling whether a service with a specific id is registered or not.
|
void |
editService(Long id,
long delay,
Map<String,String[]> params)
Deprecated.
Use
editService(Long, String, java.util.Map) instead. Since v6.4. |
void |
editService(Long id,
String cronExpression,
Map<String,String[]> params)
This will update the service if a service with this id can be found.
|
void |
editServiceByName(String name,
long delay,
Map<String,String[]> params)
Deprecated.
Use
editServiceByName(String, String, java.util.Map) instead. Since v6.4. |
void |
editServiceByName(String name,
String cronExpression,
Map<String,String[]> params)
This will update the service if a service by this name can be found.
|
ServiceManager.ServiceScheduleSkipper |
getScheduleSkipper()
Deprecated.
v6.2 This is no longer used. Just call
runNow(long) |
Collection<JiraServiceContainer> |
getServices()
This gets all currently registered services with JIRA.
|
Iterable<JiraServiceContainer> |
getServicesForExecution(long currentTime)
Deprecated.
since v6.2 This is going away, it was always only meant for internal use.
|
Iterable<JiraServiceContainer> |
getServicesManageableBy(ApplicationUser user)
Gets the services that can be managed by an specific user.
|
JiraServiceContainer |
getServiceWithId(Long id)
This will return a JiraServiceContainer for the provided id if one is registered otherwise it will return null.
|
JiraServiceContainer |
getServiceWithName(String name)
This will return a JiraServiceContainer for the provided name if one is registered, otherwise this will return
null.
|
void |
refreshAll()
This will force a complete re-sync of the service cache with the values stored in the db.
|
void |
refreshService(Long id)
This will update the in-memory cache with the values from the db for the service with the id if it can be resolved.
|
void |
refreshServiceByName(String name)
This will update the in-memory cache with the values from the db for the named service if it can be resolved.
|
void |
removeService(Long id)
This will remove a service from the db and cache and it will try to resolve the service by id.
|
void |
removeServiceByName(String name)
This will remove a service from the db and cache and it will try to resolve the service by name.
|
void |
runNow(long serviceId)
Runs the service immediately.
|
static final String SERVICE_ID_KEY
Collection<JiraServiceContainer> getServices()
JiraServiceContainer addService(String name, String className, long delay) throws ServiceException, ClassNotFoundException
addService(String, String, String)
instead. Since v6.4.It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byclassName
- the class defining the servicedelay
- how often the service should run in millisecondsServiceException
- If there is an error creating the Service.ClassNotFoundException
- If the className could not be resolved.addService(String, Class, long)
,
addService(String, String, long, java.util.Map)
JiraServiceContainer addService(String name, String className, String cronExpression) throws ServiceException, ClassNotFoundException
It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byclassName
- the class defining the servicecronExpression
- how the service should be scheduledServiceException
- If there is an error creating the Service.ClassNotFoundException
- If the className could not be resolved.addService(String, Class, String)
,
addService(String, String, String, java.util.Map)
JiraServiceContainer addService(String name, Class<? extends JiraService> serviceClass, long delay) throws ServiceException
addService(String, String, String)
instead. Since v6.4.It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byserviceClass
- the class defining the servicedelay
- how often the service should run in millisecondsServiceException
- If there is an error creating the Service.addService(String, String, long)
,
addService(String, Class, long, java.util.Map)
JiraServiceContainer addService(String name, Class<? extends JiraService> serviceClass, String cronExpression) throws ServiceException
It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byserviceClass
- the class defining the servicecronExpression
- how the service should be scheduledServiceException
- If there is an error creating the Service.addService(String, String, String)
,
addService(String, Class, String, java.util.Map)
JiraServiceContainer addService(String name, String className, long delay, Map<String,String[]> params) throws ServiceException, ClassNotFoundException
addService(String, String, String, java.util.Map)
instead. Since v6.4.It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byclassName
- the class defining the servicedelay
- how often the service should run in millisecondsparams
- Additional params to specify for the serviceServiceException
- If there is an error creating the Service.ClassNotFoundException
- If the className could not be resolved.addService(String, Class, long, java.util.Map)
,
addService(String, String, long)
JiraServiceContainer addService(String name, String className, String cronExpression, Map<String,String[]> params) throws ServiceException, ClassNotFoundException
It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byclassName
- the class defining the servicecronExpression
- how the service should be scheduledparams
- Additional params to specify for the serviceServiceException
- If there is an error creating the Service.ClassNotFoundException
- If the className could not be resolved.addService(String, Class, String, java.util.Map)
,
addService(String, String, String)
JiraServiceContainer addService(String name, String className, String cronExpression, long delay, Map<String,String[]> params) throws ServiceException, ClassNotFoundException
It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byclassName
- the class defining the servicecronExpression
- how the service should be scheduleddelay
- How often the service should run in milliseconds. This is not used, but the value will be retained and
will be used in place of the cron expression if the instance is downgraded to a JIRA version prior to 6.4.params
- Additional params to specify for the serviceServiceException
- If there is an error creating the Service.ClassNotFoundException
- If the className could not be resolved.addService(String, Class, String, java.util.Map)
,
addService(String, String, String)
JiraServiceContainer addService(String name, Class<? extends JiraService> serviceClass, long delay, Map<String,String[]> params) throws ServiceException
addService(String, Class, String, java.util.Map)
instead. Since v6.4.It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byserviceClass
- the class defining the servicedelay
- how often the service should run in millisecondsparams
- Additional params to specify for the serviceServiceException
- If there is an error creating the Service.addService(String, String, long, java.util.Map)
,
addService(String, Class, long)
JiraServiceContainer addService(String name, Class<? extends JiraService> serviceClass, String cronExpression, @Nullable Map<String,String[]> params) throws ServiceException
It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byserviceClass
- the class defining the servicecronExpression
- how the service should be scheduledparams
- Additional params to specify for the serviceServiceException
- If there is an error creating the Service.addService(String, String, String, java.util.Map)
,
addService(String, Class, String)
@Internal JiraServiceContainer addService(String name, Class<? extends JiraService> serviceClass, String cronExpression, long delay, @Nullable Map<String,String[]> params) throws ServiceException
It is preferred to pass the actual Class rather than the class name when adding services to JIRA from plugins, because it avoids possible ClassLoader issues. See http://jira.atlassian.com/browse/JRA-18578.
name
- the key this service is to be known byserviceClass
- the class defining the servicecronExpression
- how the service should be scheduleddelay
- How often the service should run in milliseconds. This is not used, but the value will be retained and
will be used in place of the cron expression if the instance is downgraded to a JIRA version prior to 6.4.params
- Additional params to specify for the serviceServiceException
- If there is an error creating the Service.addService(String, String, String, java.util.Map)
,
addService(String, Class, String)
@Nullable JiraServiceContainer getServiceWithId(Long id) throws Exception
id
- service idException
- if there is a problem looking up the value in the db.@Nullable JiraServiceContainer getServiceWithName(String name) throws Exception
name
- the name of the JiraServiceContainerException
- if there is a problem looking up the value in the db.boolean containsServiceWithId(Long id)
id
- service idvoid editServiceByName(String name, long delay, Map<String,String[]> params) throws Exception
editServiceByName(String, String, java.util.Map)
instead. Since v6.4.name
- the name of the service to find.delay
- the delay to set on the service in millisecondsparams
- the params to set on the serviceIllegalArgumentException
- if the name can not be resolvedException
void editServiceByName(String name, String cronExpression, Map<String,String[]> params) throws Exception
name
- the name of the service to find.cronExpression
- how the service should be scheduledparams
- the params to set on the serviceIllegalArgumentException
- if the name can not be resolvedException
void editService(Long id, long delay, Map<String,String[]> params) throws Exception
editService(Long, String, java.util.Map)
instead. Since v6.4.id
- the id of the service to find.delay
- the delay to set on the service in millisecondsparams
- the params to set on the serviceException
- if there is a problem updating the valuevoid editService(Long id, String cronExpression, Map<String,String[]> params) throws Exception
id
- the id of the service to find.cronExpression
- how the service should be scheduledparams
- the params to set on the serviceException
- if there is a problem updating the valuevoid refreshServiceByName(String name) throws Exception
name
- the name of the service to find.IllegalArgumentException
- if the name can not be resolvedException
void refreshService(Long id) throws Exception
id
- the id of the service to find.Exception
- if the value can not be refreshedvoid removeServiceByName(String name) throws Exception
name
- the name of the service to find.IllegalArgumentException
- if the name can not be resolvedException
void removeService(Long id) throws Exception
id
- the id of the service to find.Exception
- if there is a problem removing the servicevoid refreshAll()
ServiceManager.ServiceScheduleSkipper getScheduleSkipper()
runNow(long)
Iterable<JiraServiceContainer> getServicesForExecution(long currentTime)
currentTime
- the time to check for due services.Iterable<JiraServiceContainer> getServicesManageableBy(ApplicationUser user)
user
- The user in play.Copyright © 2002-2024 Atlassian. All Rights Reserved.