KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > runtime > IBackgroundExecution


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12 */

13 package org.pentaho.core.runtime;
14
15 import java.util.List JavaDoc;
16
17 import org.pentaho.core.repository.IContentItem;
18 import org.pentaho.core.session.IPentahoSession;
19 import org.pentaho.core.solution.IOutputHandler;
20 import org.pentaho.core.solution.IParameterProvider;
21
22 public interface IBackgroundExecution {
23
24   public static final String JavaDoc BACKGROUND_ACTION_NAME_STR = "background_action_name"; //$NON-NLS-1$
25
public static final String JavaDoc BACKGROUND_SUBMITTED = "background_submit_time"; //$NON-NLS-1$
26
public static final String JavaDoc DEFAULT_USER_NAME = "SYSTEM"; //$NON-NLS-1$
27

28   /**
29    * Queues the action specified in the request parameters for execution in the background
30    * @param userSession IPentahoSession of the session executing in background
31    * @param parameterProvider Provides the parameters containing the action to execute in the background
32    * @return String response that will be used for user feedback.
33    */

34   public String JavaDoc backgroundExecuteAction( IPentahoSession userSession, IParameterProvider parameterProvider );
35   /**
36    * Gets the list of items scheduled for background execution, and those currently executing
37    * @param userSession The usersession
38    * @return List of scheduled/executing jobs
39    */

40   public List JavaDoc getScheduledAndExecutingBackgroundJobs(IPentahoSession userSession);
41   /**
42    * Removes the content generated by background execution
43    * @param contentGUID The GUID of the content generated
44    * @param userSession The user session
45    */

46   public void removeBackgroundExecutedContentForID(String JavaDoc contentGUID, IPentahoSession userSession);
47   /**
48    * Gets the content generated by background execution
49    * @param contentGUID The GUID for the content
50    * @param userSession The user session
51    * @return IContentItem pointing to the generated content
52    */

53   public IContentItem getBackgroundContent(String JavaDoc contentGUID, IPentahoSession userSession);
54   /**
55    * Gets a list of content GUIDs of background executed jobs
56    * @param userSession User session
57    * @return List of executed content ids
58    */

59   public List JavaDoc getBackgroundExecutedContentList(IPentahoSession userSession);
60   
61   /**
62    * When the job runs in background, gets the effective user session for the user executing the job
63    * @param user The user name
64    * @return IPentahoSession for the user as if the user was clicking to run the job in realtime.
65    */

66   public IPentahoSession getEffectiveUserSession(String JavaDoc user);
67   
68   /**
69    * This provides an entry point for tracking the created background execution task
70    * @param userSession
71    * @param GUID
72    */

73   public void trackBackgroundExecution(IPentahoSession userSession, String JavaDoc GUID);
74   
75   /**
76    * Returns the output handler for content, specific to the implementation of the background execution helper.
77    * @param location Location for the content
78    * @param fileName File name for the content
79    * @param solutionName Solution name
80    * @param userSession IPentahoSession of the caller
81    * @param parameterProvider parameter provider containing request parameters
82    * @return IOutputHandler implementation for storing the content.
83    */

84   public IOutputHandler getContentOutputHandler(String JavaDoc location, String JavaDoc fileName, String JavaDoc solutionName, IPentahoSession userSession, IParameterProvider parameterProvider);
85   
86 }
87
Popular Tags