View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.tools.logging.commons;
12  
13  import java.util.List;
14  
15  import psiprobe.tools.logging.DefaultAccessor;
16  import psiprobe.tools.logging.LogDestination;
17  
18  /**
19   * The Class CommonsLoggerAccessor.
20   */
21  public class CommonsLoggerAccessor extends DefaultAccessor {
22  
23    /**
24     * Gets the destinations.
25     *
26     * @return the destinations
27     */
28    public List<LogDestination> getDestinations() {
29      GetAllDestinationsVisitor visitor = new GetAllDestinationsVisitor();
30      visitor.setTarget(getTarget());
31      visitor.setApplication(getApplication());
32      visitor.visit();
33      return visitor.getDestinations();
34    }
35  
36    /**
37     * Gets the destination.
38     *
39     * @param logIndex the log index
40     *
41     * @return the destination
42     */
43    public LogDestination getDestination(String logIndex) {
44      GetSingleDestinationVisitor visitor = new GetSingleDestinationVisitor(logIndex);
45      visitor.setTarget(getTarget());
46      visitor.setApplication(getApplication());
47      visitor.visit();
48      return visitor.getDestination();
49    }
50  
51  }