View Javadoc
1   package net.sf.logdistiller;
2   
3   /*
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  import java.io.IOException;
18  
19  /**
20   * Base class of report publishers, for both global and group reports.
21   */
22  public abstract class Publisher
23  {
24      /**
25       * Get the publisher-id for this class.
26       *
27       * @return a unique publisher id
28       */
29      public abstract String getId();
30  
31      /**
32       * Publish a global report.
33       *
34       * @param logdistillation the logdistillation containing the results to publish
35       * @param report the report configuration
36       * @throws IOException
37       * @throws PublishException
38       */
39      public abstract void publish( LogDistillation logdistillation, LogDistiller.Report report )
40          throws IOException, PublishException;
41  
42      /**
43       * Publish a group report.
44       *
45       * @param group the logdstillation group containing the results to publish
46       * @param report the report configuration
47       * @throws IOException
48       * @throws PublishException
49       */
50      public abstract void publish( LogDistillation.Group group, LogDistiller.Report report )
51          throws IOException, PublishException;
52  
53      public static class PublishException
54          extends Exception
55      {
56          private static final long serialVersionUID = 498326805296616769L;
57  
58          public PublishException( String message, Throwable nested )
59          {
60              super( message, nested );
61          }
62      }
63  }