1 /*
2 Copyright (c) 2025 Christoph Läubrich All rights reserved.
3
4 This program is licensed to you under the Apache License Version 2.0,
5 and you may not use this file except in compliance with the Apache License Version 2.0.
6 You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
8 Unless required by applicable law or agreed to in writing,
9 software distributed under the Apache License Version 2.0 is distributed on an
10 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12 */
13 package org.codehaus.plexus.build.connect;
14
15 import org.codehaus.plexus.build.connect.messages.Message;
16
17 /**
18 * Provides access to the configuration provided by the server
19 */
20 public interface Configuration {
21
22 /**
23 * If this property is set to <code>true</code> in reply to a InitMessage
24 */
25 public static final String CONFIG_SEND_PROJECTS = "sendProjectInfos";
26
27 /**
28 * @return <code>true</code> if {@link #CONFIG_SEND_PROJECTS} is
29 * provided
30 */
31 public boolean isSendProjects();
32
33 /**
34 * Creates a Configuration from a message
35 *
36 * @param message
37 * @return the configuration backed by the message payload
38 */
39 public static Configuration of(Message message) {
40 return new Configuration() {
41
42 @Override
43 public boolean isSendProjects() {
44 return message.getBooleanProperty(CONFIG_SEND_PROJECTS, false);
45 }
46 };
47 }
48 }