summaryrefslogtreecommitdiff
path: root/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
blob: 1d2fdd0452009ec5b2cfa5a5c2563dd5ec5b60ff (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
 *
 * 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.model;

import java.net.SocketAddress;
import java.security.AccessControlException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;

import org.apache.qpid.server.logging.LogRecorder;
import org.apache.qpid.server.logging.RootMessageLogger;
import org.apache.qpid.server.configuration.updater.TaskExecutor;
import org.apache.qpid.server.security.SecurityManager;
import org.apache.qpid.server.security.SubjectCreator;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;

public interface Broker extends ConfiguredObject
{

    String BUILD_VERSION = "buildVersion";
    String BYTES_RETAINED = "bytesRetained";
    String OPERATING_SYSTEM = "operatingSystem";
    String PLATFORM = "platform";
    String PROCESS_PID = "processPid";
    String PRODUCT_VERSION = "productVersion";
    String SUPPORTED_STORE_TYPES = "supportedStoreTypes";
    String SUPPORTED_AUTHENTICATION_PROVIDERS = "supportedAuthenticationProviders";
    String CREATED = "created";
    String DURABLE = "durable";
    String ID = "id";
    String LIFETIME_POLICY = "lifetimePolicy";
    String NAME = "name";
    String STATE = "state";
    String TIME_TO_LIVE = "timeToLive";
    String UPDATED = "updated";
    String DEFAULT_AUTHENTICATION_PROVIDER = "defaultAuthenticationProvider";
    String DEFAULT_VIRTUAL_HOST = "defaultVirtualHost";

    String ALERT_THRESHOLD_MESSAGE_AGE = "alertThresholdMessageAge";
    String ALERT_THRESHOLD_MESSAGE_COUNT = "alertThresholdMessageCount";
    String ALERT_THRESHOLD_QUEUE_DEPTH = "alertThresholdQueueDepth";
    String ALERT_THRESHOLD_MESSAGE_SIZE = "alertThresholdMessageSize";
    String ALERT_REPEAT_GAP = "alertRepeatGap";
    String FLOW_CONTROL_SIZE_BYTES = "queueFlowControlSizeBytes";
    String FLOW_CONTROL_RESUME_SIZE_BYTES = "queueFlowResumeSizeBytes";
    String MAXIMUM_DELIVERY_ATTEMPTS = "maximumDeliveryAttempts";
    String DEAD_LETTER_QUEUE_ENABLED = "deadLetterQueueEnabled";
    String HOUSEKEEPING_CHECK_PERIOD = "housekeepingCheckPeriod";

    String SESSION_COUNT_LIMIT = "sessionCountLimit";
    String HEART_BEAT_DELAY = "heartBeatDelay";
    String STATISTICS_REPORTING_PERIOD = "statisticsReportingPeriod";
    String STATISTICS_REPORTING_RESET_ENABLED = "statisticsReportingResetEnabled";

    /*
     * A temporary attribute to pass the path to ACL file.
     * TODO: It should be a part of AuthorizationProvider.
     */
    String ACL_FILE = "aclFile";

    /*
     * A temporary attributes to set the broker default key/trust stores.
     * TODO: Remove them after adding a full support to configure KeyStore/TrustStore via management layers.
     */
    String KEY_STORE_PATH = "keyStorePath";
    String KEY_STORE_PASSWORD = "keyStorePassword";
    String KEY_STORE_CERT_ALIAS = "keyStoreCertAlias";
    String TRUST_STORE_PATH = "trustStorePath";
    String TRUST_STORE_PASSWORD = "trustStorePassword";
    String PEER_STORE_PATH = "peerStorePath";
    String PEER_STORE_PASSWORD = "peerStorePassword";

    /*
     * A temporary attributes to set the broker group file.
     * TODO: Remove them after adding a full support to configure authorization providers via management layers.
     */
    String GROUP_FILE = "groupFile";

    // Attributes
    Collection<String> AVAILABLE_ATTRIBUTES =
            Collections.unmodifiableList(
                Arrays.asList(BUILD_VERSION,
                              BYTES_RETAINED,
                              OPERATING_SYSTEM,
                              PLATFORM,
                              PROCESS_PID,
                              PRODUCT_VERSION,
                              SUPPORTED_STORE_TYPES,
                              SUPPORTED_AUTHENTICATION_PROVIDERS,
                              CREATED,
                              DURABLE,
                              ID,
                              LIFETIME_POLICY,
                              NAME,
                              STATE,
                              TIME_TO_LIVE,
                              UPDATED,
                              DEFAULT_AUTHENTICATION_PROVIDER,
                              DEFAULT_VIRTUAL_HOST,
                              ALERT_THRESHOLD_MESSAGE_AGE,
                              ALERT_THRESHOLD_MESSAGE_COUNT,
                              ALERT_THRESHOLD_QUEUE_DEPTH,
                              ALERT_THRESHOLD_MESSAGE_SIZE,
                              ALERT_REPEAT_GAP,
                              FLOW_CONTROL_SIZE_BYTES,
                              FLOW_CONTROL_RESUME_SIZE_BYTES,
                              MAXIMUM_DELIVERY_ATTEMPTS,
                              DEAD_LETTER_QUEUE_ENABLED,
                              HOUSEKEEPING_CHECK_PERIOD,
                              SESSION_COUNT_LIMIT,
                              HEART_BEAT_DELAY,
                              STATISTICS_REPORTING_PERIOD,
                              STATISTICS_REPORTING_RESET_ENABLED,

                              ACL_FILE,
                              KEY_STORE_PATH,
                              KEY_STORE_PASSWORD,
                              KEY_STORE_CERT_ALIAS,
                              TRUST_STORE_PATH,
                              TRUST_STORE_PASSWORD,
                              PEER_STORE_PATH,
                              PEER_STORE_PASSWORD,
                              GROUP_FILE
                              ));

    //children
    Collection < VirtualHost > getVirtualHosts();

    Collection<Port> getPorts();

    Collection<AuthenticationProvider> getAuthenticationProviders();

    VirtualHost createVirtualHost(String name, State initialState, boolean durable,
                                  LifetimePolicy lifetime, long ttl, Map<String, Object> attributes)
            throws AccessControlException, IllegalArgumentException;

    AuthenticationProvider getDefaultAuthenticationProvider();

    Collection<GroupProvider> getGroupProviders();

    /**
     * A temporary hack to expose root message logger via broker instance.
     * TODO We need a better way to do operational logging, for example, via logging listeners
     */
    RootMessageLogger getRootMessageLogger();

    /**
     * A temporary hack to expose security manager via broker instance.
     * TODO We need to add and implement an authorization provider configured object instead
     */
    SecurityManager getSecurityManager();

    /**
     * TODO: A temporary hack to expose log recorder via broker instance.
     */
    LogRecorder getLogRecorder();

    VirtualHost findVirtualHostByName(String name);

    /**
     * Get the SubjectCreator for the given socket address.
     * TODO: move the authentication related functionality into host aliases and AuthenticationProviders
     *
     * @param address The (listening) socket address for which the AuthenticationManager is required
     */
    SubjectCreator getSubjectCreator(SocketAddress localAddress);

    Collection<KeyStore> getKeyStores();

    Collection<TrustStore> getTrustStores();

    /*
     * TODO: Remove this method. Eventually the broker will become a registry.
     */
    VirtualHostRegistry getVirtualHostRegistry();

    KeyStore getDefaultKeyStore();

    TrustStore getDefaultTrustStore();

    TaskExecutor getTaskExecutor();
}