View Javadoc

1   /**
2    * Copyright 2005-2006 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.services.remoting;
16  
17  import org.figure8.join.core.DuplicateEntityException;
18  import org.figure8.join.core.InvalidParameterException;
19  import org.figure8.join.services.remoting.beans.RemoteQuartzCronInfo;
20  
21  import java.rmi.RemoteException;
22  /**
23   * Remote service interface definition. This service allows to interact
24   * with server-side crons : retrieving them, saving them (thus
25   * activation / deactivation) and removing them. All this services require
26   * authentication through the usage of the <code>login()</code> method.
27   * The security token returned by this method should then be used as a
28   * parameter of every service call.
29   * 
30   * @author <a href="mailto:jerome.evrard@gmail.com">Jerome Evrard</a>
31   * @version $Revision: 1.2 $
32   */
33  public interface CronService extends AuthenticatedService{
34  
35     /**
36      * Save a new cron on server-side. This is a crete or update method.
37      * @param token Authentication token provided earlier by login() method
38      * @param cron Informations about cron to save
39      * @throws InvalidSessionException if user has no valid session on server-side
40      * @throws InvalidParameterException if a property of RemoteQuartzCronInfo is not valid
41      * @throws DuplicateEntityException if a cron with same name already exists
42      * @throws RemoteException if an exception occurs during the remote conversation
43      */
44     public void saveCron(String token, RemoteQuartzCronInfo cron) throws InvalidSessionException,
45             InvalidParameterException, DuplicateEntityException, RemoteException;
46  
47     /**
48      * Remove an existing cron from cron table
49      * @param token Authentication token provided earlier by login() method
50      * @param cron Information about cron to remove
51      * @throws InvalidSessionException if user has no valid session on server-side
52      * @throws RemoteException if an exception occurs during the remote conversation
53      */
54     public void removeCron(String token, RemoteQuartzCronInfo cron) throws InvalidSessionException, RemoteException;
55  
56     /**
57      * Retrieve information onto a specified cron
58      * @param token Authentication token provided earlier by login() method
59      * @param name Name of cron to retrieve information for
60      * @throws InvalidSessionException if user has no valid session on server-side
61      * @throws RemoteException if an exception occurs during the remote conversation
62      * @return The bean representing information onto specified cron, or null if no one matches name
63      */
64     public RemoteQuartzCronInfo getQuartzCronInfo(String token, String name) throws InvalidSessionException, RemoteException;
65  
66     /**
67      * Retrieve the list of all existing cron on server-side
68      * @param token Authentication token provided earlier by login() method
69      * @throws InvalidSessionException if user has no valid session on server-side
70      * @throws RemoteException if an exception occurs during the remote conversation
71      * @return An array of beans representing information onto all existing cron
72      */
73     public RemoteQuartzCronInfo[] getQuartzCronInfo(String token) throws InvalidSessionException, RemoteException;
74  }