View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements. See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache license, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License. You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the license for the specific language governing permissions and
15   * limitations under the license.
16   */
17  package org.apache.logging.log4j.catalog.api;
18  
19  import java.time.LocalDateTime;
20  import java.util.Map;
21  
22  /**
23   *
24   */
25  public interface CatalogReader {
26  
27      /**
28       * Returns the Catalog object.
29       * @return the Catalog.
30       */
31      CatalogData read();
32  
33      /**
34       * Returns a String representation of the Catalog. The representation format is implementation specific.
35       * @return a String containing the Catalog data.
36       */
37      String readCatalog();
38  
39      /**
40       * Return all the Attributes as a Map.
41       * @return A map of the attributes where the key is the Attribute's name.
42       */
43      Map<String, Attribute> getAttributes();
44  
45      /**
46       * Retrieves an Attribute.
47       * @param name The attribute name.
48       * @return The Attribute or null if no attribute with the specified name exists.
49       */
50      Attribute getAttribute(String name);
51  
52      /**
53       * Retrieves a Category.
54       * not called.
55       * @param name The category name.
56       * @return The Category.
57       */
58      Category getCategory(String name);
59  
60      /**
61       *
62       * @param name
63       * @return
64       */
65      Event getEvent(String name);
66  
67      /**
68       *
69       * @param name
70       * @return
71       */
72      Product getProduct(String name);
73  
74      /**
75       * Returns the last update time of the catalog.
76       * @return The last update time of the catalog.
77       */
78      LocalDateTime getLastUpdated();
79  }