|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.service.DefaultServiceManager
public class DefaultServiceManager
| Nested Class Summary | |
|---|---|
protected static class |
DefaultServiceManager.ServiceScheduleSkipperImpl
Implementation of ServiceScheduleSkipper that has synchronized access. |
| Nested classes/interfaces inherited from interface com.atlassian.jira.service.ServiceManager |
|---|
ServiceManager.ServiceScheduleSkipper |
| Constructor Summary | |
|---|---|
DefaultServiceManager(ServiceConfigStore serviceConfigStore,
ComponentClassManager componentClassManager,
com.atlassian.event.api.EventPublisher eventPublisher,
PermissionManager permissionManager,
InBuiltServiceTypes inBuiltServiceTypes)
|
|
| Method Summary | |
|---|---|
JiraServiceContainer |
addService(String name,
Class<? extends JiraService> serviceClass,
long delay)
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,
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 serviceClassName,
long delay)
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 serviceClassName,
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. |
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)
This will update the service if a service with this id can be found. |
void |
editServiceByName(String name,
long delay,
Map<String,String[]> params)
This will update the service if a service by this name can be found. |
ServiceManager.ServiceScheduleSkipper |
getScheduleSkipper()
Returns service schedule skipper |
Collection<JiraServiceContainer> |
getServices()
This gets all currently registered services with JIRA. |
Iterable<JiraServiceContainer> |
getServicesForExecution(long time)
Gets the services that are ready for execution at a particular time. |
Iterable<JiraServiceContainer> |
getServicesManageableBy(com.atlassian.crowd.embedded.api.User 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 |
onClearCache(ClearCacheEvent event)
|
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 |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultServiceManager(ServiceConfigStore serviceConfigStore,
ComponentClassManager componentClassManager,
com.atlassian.event.api.EventPublisher eventPublisher,
PermissionManager permissionManager,
InBuiltServiceTypes inBuiltServiceTypes)
| Method Detail |
|---|
public void start()
throws Exception
Startable
start in interface StartableException - Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public Collection<JiraServiceContainer> getServices()
ServiceManager
getServices in interface ServiceManagerpublic Iterable<JiraServiceContainer> getServicesManageableBy(com.atlassian.crowd.embedded.api.User user)
ServiceManager
getServicesManageableBy in interface ServiceManageruser - The user in play.
public Iterable<JiraServiceContainer> getServicesForExecution(long time)
ServiceManager
getServicesForExecution in interface ServiceManagertime - the time to check for due services.
public boolean containsServiceWithId(Long id)
ServiceManager
containsServiceWithId in interface ServiceManagerid - service id
public void refreshAll()
ServiceManager
refreshAll in interface ServiceManager
public JiraServiceContainer getServiceWithId(Long id)
throws Exception
ServiceManager
getServiceWithId in interface ServiceManagerid - service id
Exception - if there is a problem looking up the value in the db.
public JiraServiceContainer getServiceWithName(String name)
throws Exception
ServiceManager
getServiceWithName in interface ServiceManagername - the name of the JiraServiceContainer
Exception - if there is a problem looking up the value in the db.
public JiraServiceContainer addService(String name,
String serviceClassName,
long delay)
throws org.ofbiz.core.entity.GenericEntityException,
ServiceException,
ClassNotFoundException
ServiceManagerIt 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.
addService in interface ServiceManagername - the key this service is to be known byserviceClassName - the class defining the servicedelay - how often the service should run in milliseconds
org.ofbiz.core.entity.GenericEntityException - If there is a DB error.
ServiceException - If there is an error creating the Service.
ClassNotFoundException - If the className could not be resolved.ServiceManager.addService(String, Class, long),
ServiceManager.addService(String, String, long, java.util.Map)
public JiraServiceContainer addService(String name,
String serviceClassName,
long delay,
Map<String,String[]> params)
throws org.ofbiz.core.entity.GenericEntityException,
ServiceException,
ClassNotFoundException
ServiceManagerIt 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.
addService in interface ServiceManagername - the key this service is to be known byserviceClassName - the class defining the servicedelay - how often the service should run in millisecondsparams - Additional params to specify for the service
org.ofbiz.core.entity.GenericEntityException - If there is a Db error.
ServiceException - If there is an error creating the Service.
ClassNotFoundException - If the className could not be resolved.ServiceManager.addService(String, Class, long, java.util.Map),
ServiceManager.addService(String, String, long)
public JiraServiceContainer addService(String name,
Class<? extends JiraService> serviceClass,
long delay)
throws org.ofbiz.core.entity.GenericEntityException,
ServiceException
ServiceManagerIt 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.
addService in interface ServiceManagername - the key this service is to be known byserviceClass - the class defining the servicedelay - how often the service should run in milliseconds
org.ofbiz.core.entity.GenericEntityException - If there is a DB error.
ServiceException - If there is an error creating the Service.ServiceManager.addService(String, String, long),
ServiceManager.addService(String, Class, long, java.util.Map)
public JiraServiceContainer addService(String name,
Class<? extends JiraService> serviceClass,
long delay,
Map<String,String[]> params)
throws org.ofbiz.core.entity.GenericEntityException,
ServiceException
ServiceManagerIt 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.
addService in interface ServiceManagername - 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 service
org.ofbiz.core.entity.GenericEntityException - If there is a Db error.
ServiceException - If there is an error creating the Service.ServiceManager.addService(String, String, long, java.util.Map),
ServiceManager.addService(String, Class, long)
public void editServiceByName(String name,
long delay,
Map<String,String[]> params)
throws Exception
ServiceManager
editServiceByName in interface ServiceManagername - the name of the service to find.delay - the delay to set on the service in millisecondsparams - the params to set on the service
IllegalArgumentException - if the name can not be resolved
Exception
public void editService(Long id,
long delay,
Map<String,String[]> params)
throws Exception
ServiceManager
editService in interface ServiceManagerid - the id of the service to find.delay - the delay to set on the service in millisecondsparams - the params to set on the service
Exception - if there is a problem updating the value
public void removeServiceByName(String name)
throws Exception
ServiceManager
removeServiceByName in interface ServiceManagername - the name of the service to find.
IllegalArgumentException - if the name can not be resolved
Exception
public void removeService(Long id)
throws Exception
ServiceManager
removeService in interface ServiceManagerid - the id of the service to find.
Exception - if there is a problem removing the service
public void refreshService(Long id)
throws Exception
ServiceManager
refreshService in interface ServiceManagerid - the id of the service to find.
Exception - if the value can not be refreshed
public void refreshServiceByName(String name)
throws Exception
ServiceManager
refreshServiceByName in interface ServiceManagername - the name of the service to find.
IllegalArgumentException - if the name can not be resolved
Exceptionpublic ServiceManager.ServiceScheduleSkipper getScheduleSkipper()
getScheduleSkipper in interface ServiceManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||