01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.geronimo.management.geronimo;
17:
18: import java.io.Serializable;
19:
20: /**
21: * A general log manager.
22: *
23: * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
24: */
25: public interface Log {
26: /**
27: * The most search lines that will ever be returned, no matter what you
28: * ask for. This is to conserve memory and transfer bandwidth.
29: */
30: public final static int MAX_SEARCH_RESULTS = 1000;
31:
32: public static class LogMessage implements Serializable {
33: private final int lineNumber;
34: private final String lineContent;
35:
36: public LogMessage(int lineNumber, String lineContent) {
37: this .lineNumber = lineNumber;
38: this .lineContent = lineContent;
39: }
40:
41: public int getLineNumber() {
42: return lineNumber;
43: }
44:
45: public String getLineContent() {
46: return lineContent;
47: }
48: }
49:
50: public static class SearchResults implements Serializable {
51: private final int lineCount; // total lines in log file
52: private final LogMessage[] results;
53: private final boolean capped; // whether there were more matched than are returned here
54:
55: public SearchResults(int lineCount, LogMessage[] results,
56: boolean capped) {
57: this .lineCount = lineCount;
58: this .results = results;
59: this .capped = capped;
60: }
61:
62: public int getLineCount() {
63: return lineCount;
64: }
65:
66: public LogMessage[] getResults() {
67: return results;
68: }
69:
70: public boolean isCapped() {
71: return capped;
72: }
73: }
74: }
|