1 /*
2 * Demosys.
3 *
4 * Terms of license - http://opensource.org/licenses/apachepl.php
5 */
6 package org.demosys.web.story.impl;
7 import java.util.HashMap;
8 import org.demosys.web.story.CreateStoryException;
9 import org.demosys.web.story.StoryService;
10 import org.demosys.web.story.StoryView;
11 /***
12 */
13 public class MemoryStoryService implements StoryService {
14 private HashMap memory = new HashMap();
15
16 public synchronized void newStory(StoryView story)
17 throws CreateStoryException {
18 if (memory.containsKey(story.getTitle())) {
19 throw new CreateStoryException("Existe deja en Base");
20 }
21
22 memory.put(story.getTitle(), story.clone());
23 }
24 }
This page was automatically generated by Maven