Class SimpleTemplateRepository
- java.lang.Object
-
- com.levigo.jadice.server.rest.impl.SimpleTemplateRepository
-
- All Implemented Interfaces:
TemplateRepository
,org.springframework.beans.factory.InitializingBean
public class SimpleTemplateRepository extends Object implements TemplateRepository, org.springframework.beans.factory.InitializingBean
A simple implementation of aTemplateRepository
that lists all the Job Templates that are stored as XML files in a given directory
-
-
Constructor Summary
Constructors Constructor Description SimpleTemplateRepository(File baseDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
File
getBaseDirectory()
String
getTemplate(String id)
Retrieve a single job templateList<String>
listTemplates()
void
setBaseDirectory(File baseDirectory)
Configure the directory where all available job templates are stored
-
-
-
Constructor Detail
-
SimpleTemplateRepository
public SimpleTemplateRepository(File baseDirectory)
-
-
Method Detail
-
listTemplates
public List<String> listTemplates()
- Specified by:
listTemplates
in interfaceTemplateRepository
- Returns:
- The list of all available job template IDs
-
getTemplate
public String getTemplate(String id) throws IOException
Description copied from interface:TemplateRepository
Retrieve a single job template- Specified by:
getTemplate
in interfaceTemplateRepository
- Parameters:
id
- the ID of the job template- Returns:
- The content of the job template
- Throws:
IOException
- if the job template could not be retrieved
-
getBaseDirectory
public File getBaseDirectory()
- Returns:
- The directory where all available job templates are stored
-
setBaseDirectory
public void setBaseDirectory(File baseDirectory)
Configure the directory where all available job templates are stored
-
-