summaryrefslogtreecommitdiff
path: root/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/LogSubjectFormat.java
blob: 7611ee1a88ad03858b68f7e570295671a00faccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 */

package org.apache.qpid.server.logging.subjects;

/**
 *  LogSubjectFormat class contains a list of formatting string 
 *  that can be statically imported where needed.
 *  The formatting strings are to be used via a MessageFormat call
 *  to insert the required values at the corresponding place holder
 *  indices.
 *    
 */

public class LogSubjectFormat
{

    private LogSubjectFormat()
    {
    }

    /**
     * LOG FORMAT for the ManagementActors,
     * 0 - User ID
     * 1 - IP[:Port]
     */
    public static final String MANAGEMENT_FORMAT = "mng:{0}({1})";

    /**
     * LOG FORMAT for the Subscription Log Subject
     * 0 - Subscription ID
     */
    public static final String SUBSCRIPTION_FORMAT = "sub:{0}";
    
    /** 
     * LOG FORMAT for Connection Log Subject - SOCKET format 
     * 0 - Connection ID
     * 1 - Remote Address
     */
    public static final String SOCKET_FORMAT = "con:{0}({1})";
    
    /** 
     * LOG FORMAT for Connection Log Subject - USER format
     * 0 - Connection ID
     * 1 - User ID
     * 2 - IP
     */
    public static final String USER_FORMAT = "con:{0}({1}@{2})";
    
    /**
     * LOG FORMAT for the Connection Log Subject - CON format
     * 0 - Connection ID
     * 1 - User ID
     * 2 - IP
     * 3 - Virtualhost
     */
    public static final String CONNECTION_FORMAT = "con:{0}({1}@{2}/{3})";
    
    /**
     * LOG FORMAT for the Channel LogSubject
     * 0 - Connection ID
     * 1 - User ID
     * 2 - IP
     * 3 - Virtualhost
     * 4 - Channel ID
     */
    public static final String CHANNEL_FORMAT = CONNECTION_FORMAT + "/ch:{4}";
    
    /**
     * LOG FORMAT for the Exchange LogSubject,
     * 0 - Virtualhost Name
     * 1 - Exchange Type
     * 2 - Exchange Name
     */
    public static final String EXCHANGE_FORMAT = "vh(/{0})/ex({1}/{2})";
    
    /**
     * LOG FORMAT for a Binding LogSubject
     * 0 - Virtualhost Name
     * 1 - Exchange Type
     * 2 - Exchange Name
     * 3 - Queue Name
     * 4 - Binding RoutingKey
     */
    public static final String BINDING_FORMAT = "vh(/{0})/ex({1}/{2})/qu({3})/rk({4})";
    
    /**
     * LOG FORMAT for the MessagesStore LogSubject
     * 0 - Virtualhost Name
     * 1 - Message Store Type
     */
    public static final String STORE_FORMAT = "vh(/{0})/ms({1})";
    
    /**
     * LOG FORMAT for the Queue LogSubject,
     * 0 - Virtualhost name
     * 1 - queue name
     */
    public static final String QUEUE_FORMAT = "vh(/{0})/qu({1})";
}