2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.apex.service.parameters.eventprotocol;
24 import org.onap.policy.common.parameters.annotations.NotBlank;
25 import org.onap.policy.common.parameters.annotations.NotNull;
28 * An event protocol parameter class for token delimited textual event protocols that may be specialized by event
29 * protocol plugins that require plugin specific parameters.
31 * <p>The following parameters are defined:
33 * <li>startDelimiterToken: the token string that delimits the start of text blocks that contain events.
34 * <li>endDelimiterToken: the token string that delimits the end of text blocks that contain events, this parameter is
35 * optional and defaults to null.
36 * <li>delimiterAtStart: indicates if the first text block should have a delimiter at the start (true), or whether
37 * processing of the first block should begin at the start of the text (false). The parameter is optional and defaults
41 * @author Liam Fallon (liam.fallon@ericsson.com)
43 public abstract class EventProtocolTextTokenDelimitedParameters extends EventProtocolParameters {
44 // The delimiter token for text blocks
45 private @NotNull @NotBlank String startDelimiterToken = null;
46 private String endDelimiterToken = null;
47 private boolean delimiterAtStart = true;
50 * Constructor to create an event protocol parameters instance with the name of a sub class of this class.
52 protected EventProtocolTextTokenDelimitedParameters() {
57 * Gets the start delimiter token that delimits events in the text.
59 * @return the start delimiter token
61 public String getStartDelimiterToken() {
62 return startDelimiterToken;
66 * Sets the start delimiter token that delimits events in the text.
68 * @param startDelimiterToken
69 * delimiterToken the delimiter token
71 public void setStartDelimiterToken(final String startDelimiterToken) {
72 this.startDelimiterToken = startDelimiterToken;
76 * Gets the end delimiter token that delimits events in the text.
78 * @return the end delimiter token
80 public String getEndDelimiterToken() {
81 return endDelimiterToken;
85 * Sets the end delimiter token that delimits events in the text.
87 * @param endDelimiterToken
88 * delimiterToken the delimiter token
90 public void setEndDelimiterToken(final String endDelimiterToken) {
91 this.endDelimiterToken = endDelimiterToken;
95 * Check if there must be a delimiter at the start of the first text block.
97 * @return true if there must be a delimiter at the start of the text block
99 public boolean isDelimiterAtStart() {
100 return delimiterAtStart;
104 * Sets if there has to be a delimiter at the start of the first text block.
106 * @param delimiterAtStart
107 * true if there must be a delimiter at the start of the text block
109 public void setDelimiterAtStart(boolean delimiterAtStart) {
110 this.delimiterAtStart = delimiterAtStart;
114 public String toString() {
115 return "EventProtocolTextTokenDelimitedParameters [startDelimiterToken=" + startDelimiterToken
116 + ", endDelimiterToken=" + endDelimiterToken + ", delimiterAtStart=" + delimiterAtStart + "]";