Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/flexstor/flexdbserver/services/asset/EmptyService.java


1   /*
2    * EmptyService.java
3    *
4    * Copyright $Date: 2003/08/11 02:22:29 $ FLEXSTOR.net Inc.
5    *
6    * This work is licensed for use and distribution under license terms found at
7    * http://www.flexstor.org/license.html
8    *
9    */
10  
11  package com.flexstor.flexdbserver.services.asset;
12  
13  import com.flexstor.common.data.ActionData;
14  import com.flexstor.common.data.ActionResult;
15  import com.flexstor.common.importprocessor.ImportData;
16  import com.flexstor.common.importprocessor.ImportResult;
17  import com.flexstor.flexdbserver.services.Service;
18  import com.flexstor.flexdbserver.services.ServiceContext;
19  
20  
21  /**
22   * <P>
23   * EmptyService <BR>
24   * <BLOCKQUOTE>
25   *    A service that does nothing. It is used in the roletype_services.config file so the process doesn't fail
26   *    if no service is supposed to run for specific files.<BR>
27   *    For instance, if you have assets for which you only want preservices running against them, then
28   *    you can create a section in the roletype_services.config file for that kind of file containing
29   *    the EmptyService, or just create a default section like: <BR>
30   *    <BLOCKQUOTE>
31   *       [Default.Default] <BR>
32   *       service1 = EmptyService <BR>
33   *    </BLOCKQUOTE>
34   *
35   * </BLOCKQUOTE>
36   * </P>
37   *
38   * <P>
39   * Input Data Object <BR>
40   * <BLOCKQUOTE>
41   *    com.flexstor.common.importprocessor.ImportData <BR>
42   * </BLOCKQUOTE>
43   * </P>
44   *
45   * <P>
46   * Output Data Object <BR>
47   * <BLOCKQUOTE>
48   *    com.flexstor.common.importprocessor.ImportResult <BR>
49   * </BLOCKQUOTE>
50   * </P>
51   */
52  public class EmptyService
53     implements Service
54  {
55     public static final String IDENTIFIER = "$Id: EmptyService.java,v 1.4 2003/08/11 02:22:29 aleric Exp $";
56  
57     private ActionData data;
58  
59     public EmptyService()
60     {
61        super();
62     }
63  
64     /**
65      * Calls before the service is initialized (before initData is called) to 
66      * pass information about the environment in which the service is running.
67      * This environment consists of information about the properties set for the
68      * service in one of these files (services.config, roletype_services.config,
69      * or *.ctl), plus methods to access other information such as an instance
70      * of the service broker to invoke other services, the transaction id for
71      * the service, file separator character and local path for the installation
72      * directory and configuration directory.
73      * 
74      * @param context Holds information about the environment in which the service
75      *                is running.
76      */
77     public void setServiceContext( ServiceContext context )
78     {
79     }
80     
81     /**
82      * Data initialization method called at the beginning of the service.
83      *
84      * @param QItem is the super class of the ImportData wrapper object
85      *        which contains DisguiseRecords, which again contains more
86      *        DisguiseBucketRecord(s) and/or ElementRecord(s).
87      */
88     public void initData( ActionData data )
89     {
90        this.data = data;
91     }
92  
93     /**
94      * Start of the  Service
95      *
96      * @return a Result object with the updated ImportDataObject.
97      */
98     public ActionResult go()
99     {
100       ImportResult result = new ImportResult(true);
101       result.setImportData((ImportData)data);
102       return result;
103    }
104 }