001: /*
002: * Copyright 2005 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
007: * BI Platform. The Initial Developer is Pentaho Corporation.
008: *
009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
011: * the license for the specific language governing your rights and limitations.
012: *
013: * @created Oct 10, 2005
014: * @author James Dixon
015: */
016:
017: package com.pentaho.repository.subscribe;
018:
019: import java.util.List;
020:
021: import org.dom4j.Document;
022: import org.dom4j.Element;
023: import org.pentaho.core.repository.IContentItem;
024: import org.pentaho.core.session.IPentahoSession;
025:
026: import org.pentaho.core.subscribe.SubscriptionResultSet;
027: import org.pentaho.core.system.IPentahoInitializer;
028:
029: public interface ISubscriptionRepository extends IPentahoInitializer {
030:
031: public boolean addSubscription(Subscription subscription);
032:
033: public void addContent(SubscribeContent content);
034:
035: public SubscribeContent editContent(String id, String actionRef,
036: String contentType);
037:
038: public SubscribeContent addContent(String actionRef,
039: String contentType);
040:
041: public void setContent(String actionRefs[]) throws Exception;
042:
043: public List getAllContent();
044:
045: public List getAllSubscriptions();
046:
047: public List getUserSubscriptions(String user);
048:
049: public boolean deleteContentForSchedule(String contentId,
050: String schedId) throws Exception;
051:
052: public boolean deleteContentForSchedule(SubscribeContent content,
053: Schedule sched) throws Exception;
054:
055: public boolean addContentForSchedule(String contentId,
056: String schedId) throws Exception;
057:
058: public void setContentForSchedule(String contentId[], String schedId)
059: throws Exception;
060:
061: public boolean addContentForSchedule(SubscribeContent content,
062: Schedule sched) throws Exception;
063:
064: public void setSchedulesForContent(String scheduleId[],
065: String contentId) throws Exception;
066:
067: public Document getUserSubscriptions(String user, String contentId,
068: IPentahoSession session);
069:
070: public Schedule addSchedule(String title, String scheduleRef,
071: String description, String cronString, String group)
072: throws Exception;
073:
074: public Schedule editSchedule(String id, String title,
075: String scheduleRef, String description, String cronString,
076: String group) throws Exception;
077:
078: public void addSubscriptionToDocument(Subscription subscription,
079: Element subscriptionsNode, String editId,
080: IPentahoSession session);
081:
082: public void addSubscriptionsToDocument(String user,
083: String contentId, Element subscriptionsNode, String editId,
084: IPentahoSession session);
085:
086: public void addSchedulesToDocument(String user, String contentId,
087: Element schedulesNode, String editId);
088:
089: public SubscribeContent getContentByActionReference(
090: String actionReference);
091:
092: public SubscribeContent getContentById(String contentId);
093:
094: public List getContentBySchedule(Schedule schedule);
095:
096: public Subscription getSubscription(String subscriptionId,
097: IPentahoSession session);
098:
099: public boolean deleteSubscription(String subscriptionId,
100: IPentahoSession session);
101:
102: public boolean deleteSubscription(String subscriptionId)
103: throws Exception;
104:
105: public IContentItem getContentItem(String subscriptionName,
106: IPentahoSession session);
107:
108: public List getSchedules();
109:
110: public Schedule getSchedule(String id);
111:
112: public List getSubscriptionsForSchedule(String scheduleId);
113:
114: public List getSubscriptionsForSchedule(Schedule schedule);
115:
116: public SubscriptionResultSet getSubscriptions(String scheduleId,
117: IPentahoSession session, String solution, String path,
118: String action, String parameterNames[]);
119:
120: public boolean deleteSubscribeContentById(String subContentId)
121: throws Exception;
122:
123: public boolean deleteSubscribeContent(SubscribeContent subContent)
124: throws Exception;
125:
126: public boolean deleteScheduleById(String scheduleId)
127: throws Exception;
128:
129: public boolean deleteSchedule(Schedule sched) throws Exception;
130:
131: public Schedule getScheduleByScheduleReference(
132: String scheduleReference);
133:
134: public List getSchedulesByTitle(String title);
135:
136: public void deleteUserSubscriptions(String user);
137:
138: /**
139: * Returns true if the subscription name is unique for the user/contentId
140: *
141: * @param Name
142: * the schedule name to check for uniqueness
143: * @param user
144: * the user that owns the schedules
145: * @param contentId
146: * The action sequence separated by slashes
147: * @return
148: */
149: public boolean checkUniqueSubscriptionName(String name,
150: String user, String contentId);
151:
152: public Element importSchedules(Document doc);
153:
154: public Element importContent(Document doc);
155:
156: public List syncSchedules() throws Exception;
157:
158: }
|