nsf.playground.jobs.TestAction Maven / Gradle / Ivy
The newest version!
/*
* © Copyright IBM Corp. 2010
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package nsf.playground.jobs;
import lotus.domino.NotesException;
import lotus.domino.Session;
import com.ibm.commons.util.StringUtil;
public class TestAction extends AsyncAction {
public static final String ACTION_ID = "TestAction";
public static boolean cancel() {
return cancel(ACTION_ID);
}
public static synchronized boolean start(String databaseName, String sourceName) {
if(!actionExists(ACTION_ID)) {
registerAction(ACTION_ID, new TestAction());
}
return runAction(ACTION_ID);
}
public String getActionLabel() {
return "Test Action";
}
public void run(Session session, Object parameters) throws NotesException {
System.out.println("Start TASK");
System.out.println("Created session for task: "+session.getUserName()+", Effective User:"+session.getEffectiveUserName());
int numberOfTasks = 15;
main: for(int ts=0; ts