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 |
|
---|
18 | #if !defined(_LOG4CXX_ROLLING_ROLLOVER_DESCRIPTION_H)
|
---|
19 | #define _LOG4CXX_ROLLING_ROLLOVER_DESCRIPTION_H
|
---|
20 |
|
---|
21 | #include <log4cxx/portability.h>
|
---|
22 | #include <log4cxx/rolling/action.h>
|
---|
23 |
|
---|
24 | namespace log4cxx {
|
---|
25 | namespace rolling {
|
---|
26 |
|
---|
27 |
|
---|
28 | class RolloverDescription : public log4cxx::helpers::ObjectImpl {
|
---|
29 | DECLARE_LOG4CXX_OBJECT(RolloverDescription)
|
---|
30 | BEGIN_LOG4CXX_CAST_MAP()
|
---|
31 | LOG4CXX_CAST_ENTRY(RolloverDescription)
|
---|
32 | END_LOG4CXX_CAST_MAP()
|
---|
33 | /**
|
---|
34 | * Active log file name after rollover.
|
---|
35 | */
|
---|
36 | LogString activeFileName;
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Should active file be opened for appending.
|
---|
40 | */
|
---|
41 | bool append;
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * Action to be completed after close of current active log file
|
---|
45 | * before returning control to caller.
|
---|
46 | */
|
---|
47 | ActionPtr synchronous;
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * Action to be completed after close of current active log file
|
---|
51 | * and before next rollover attempt, may be executed asynchronously.
|
---|
52 | */
|
---|
53 | ActionPtr asynchronous;
|
---|
54 |
|
---|
55 | public:
|
---|
56 | RolloverDescription();
|
---|
57 | /**
|
---|
58 | * Create new instance.
|
---|
59 | * @param activeFileName active log file name after rollover, may not be null.
|
---|
60 | * @param append true if active log file after rollover should be opened for appending.
|
---|
61 | * @param synchronous action to be completed after close of current active log file, may be null.
|
---|
62 | * @param asynchronous action to be completed after close of current active log file and
|
---|
63 | * before next rollover attempt.
|
---|
64 | */
|
---|
65 | RolloverDescription(
|
---|
66 | const LogString& activeFileName,
|
---|
67 | const bool append,
|
---|
68 | const ActionPtr& synchronous,
|
---|
69 | const ActionPtr& asynchronous);
|
---|
70 |
|
---|
71 | /**
|
---|
72 | * Active log file name after rollover.
|
---|
73 | * @return active log file name after rollover.
|
---|
74 | */
|
---|
75 | LogString getActiveFileName() const;
|
---|
76 |
|
---|
77 | bool getAppend() const;
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * Action to be completed after close of current active log file
|
---|
81 | * before returning control to caller.
|
---|
82 | *
|
---|
83 | * @return action, may be null.
|
---|
84 | */
|
---|
85 | ActionPtr getSynchronous() const;
|
---|
86 |
|
---|
87 | /**
|
---|
88 | * Action to be completed after close of current active log file
|
---|
89 | * and before next rollover attempt, may be executed asynchronously.
|
---|
90 | *
|
---|
91 | * @return action, may be null.
|
---|
92 | */
|
---|
93 | ActionPtr getAsynchronous() const;
|
---|
94 | };
|
---|
95 |
|
---|
96 | LOG4CXX_PTR_DEF(RolloverDescription);
|
---|
97 |
|
---|
98 | }
|
---|
99 | }
|
---|
100 | #endif
|
---|
101 |
|
---|