BrightSide Workbench Full Report + Source Code
org.turro.scheduler.entities.ScheduledEntitySet Class Reference
Inheritance diagram for org.turro.scheduler.entities.ScheduledEntitySet:
Collaboration diagram for org.turro.scheduler.entities.ScheduledEntitySet:

Static Public Member Functions

static void saveSet (Set set)
 
static void loadSet (Set set)
 
static void addEntity (ScheduledEntity scheduledEntity)
 
static void removeEntity (ScheduledEntity scheduledEntity)
 
static ScheduledEntity getScheduledEntity (String path)
 

Static Public Attributes

static final String SCHEDULER_FILE = "/WEB-INF/elephant/conf/scheduled-entities.xml"
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 41 of file ScheduledEntitySet.java.

Member Function Documentation

◆ addEntity()

static void org.turro.scheduler.entities.ScheduledEntitySet.addEntity ( ScheduledEntity  scheduledEntity)
static

Definition at line 92 of file ScheduledEntitySet.java.

92  {
93  ScheduledEntitySet ses = new ScheduledEntitySet();
94  ScheduledEntitySet.loadSet(ses);
95  ses.doAddEntity(scheduledEntity);
96  ScheduledEntitySet.saveSet(ses);
97  }
Here is the call graph for this function:

◆ getScheduledEntity()

static ScheduledEntity org.turro.scheduler.entities.ScheduledEntitySet.getScheduledEntity ( String  path)
static

Definition at line 106 of file ScheduledEntitySet.java.

106  {
107  ScheduledEntitySet ses = new ScheduledEntitySet();
108  ScheduledEntitySet.loadSet(ses);
109  for(ScheduledEntity se : ses) {
110  if(se.getEntityPath().equals(path)) {
111  return se;
112  }
113  }
114  return new DefaultEntity(path);
115  }
Here is the call graph for this function:

◆ loadSet()

static void org.turro.scheduler.entities.ScheduledEntitySet.loadSet ( Set  set)
static

Definition at line 62 of file ScheduledEntitySet.java.

62  {
63  SAXBuilder builder = new SAXBuilder();
64  Document doc;
65  try {
66  File confFile = new File(ElephantContext.getRealPath(SCHEDULER_FILE));
67  if(confFile.exists()) {
68  doc = builder.build(confFile);
69  readXML(doc.getRootElement(), set);
70  }
71  } catch (IOException ex) {
72  Logger.getLogger(ScheduledEntitySet.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
73  } catch (JDOMException ex) {
74  Logger.getLogger(ScheduledEntitySet.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
75  }
76  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeEntity()

static void org.turro.scheduler.entities.ScheduledEntitySet.removeEntity ( ScheduledEntity  scheduledEntity)
static

Definition at line 99 of file ScheduledEntitySet.java.

99  {
100  ScheduledEntitySet ses = new ScheduledEntitySet();
101  ScheduledEntitySet.loadSet(ses);
102  ses.remove(scheduledEntity);
103  ScheduledEntitySet.saveSet(ses);
104  }
Here is the call graph for this function:

◆ saveSet()

static void org.turro.scheduler.entities.ScheduledEntitySet.saveSet ( Set  set)
static

Definition at line 46 of file ScheduledEntitySet.java.

46  {
47  Document doc = new Document(new Element("elephant-entities"));
48  saveXML(doc.getRootElement(), set);
49  try {
50  OutputStreamWriter fw = FileUtil.getFileWriter(
51  ElephantContext.getRealPath(SCHEDULER_FILE));
52  Format fm = Format.getPrettyFormat();
53  fm.setEncoding(ElephantContext.getEncoding());
54  XMLOutputter xo = new XMLOutputter(fm);
55  xo.output(doc, fw);
56  fw.close();
57  } catch (IOException ex) {
58  Logger.getLogger(ScheduledEntitySet.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
59  }
60  }
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ SCHEDULER_FILE

final String org.turro.scheduler.entities.ScheduledEntitySet.SCHEDULER_FILE = "/WEB-INF/elephant/conf/scheduled-entities.xml"
static

Definition at line 44 of file ScheduledEntitySet.java.


The documentation for this class was generated from the following file: