/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 com.amazonaws.services.chimesdkmessaging.model; import java.io.Serializable; /** *

* The information about a processor in a channel flow. *

*/ public class Processor implements Serializable { /** *

* The name of the channel flow. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
*/ private String name; /** *

* The information about the type of processor and its identifier. *

*/ private ProcessorConfiguration configuration; /** *

* The sequence in which processors run. If you have multiple processors in * a channel flow, message processing goes through each processor in the * sequence. The value determines the sequence. At this point, we support * only 1 processor within a flow. *

*

* Constraints:
* Range: 1 - 3
*/ private Integer executionOrder; /** *

* Determines whether to continue with message processing or stop it in * cases where communication with a processor fails. If a processor has a * fallback action of ABORT and communication with it fails, * the processor sets the message status to FAILED and does not * send the message to any recipients. Note that if the last processor in * the channel flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message is * considered processed and sent to recipients of the channel. *

*

* Constraints:
* Allowed Values: CONTINUE, ABORT */ private String fallbackAction; /** *

* The name of the channel flow. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
* * @return

* The name of the channel flow. *

*/ public String getName() { return name; } /** *

* The name of the channel flow. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
* * @param name

* The name of the channel flow. *

*/ public void setName(String name) { this.name = name; } /** *

* The name of the channel flow. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
* * @param name

* The name of the channel flow. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Processor withName(String name) { this.name = name; return this; } /** *

* The information about the type of processor and its identifier. *

* * @return

* The information about the type of processor and its identifier. *

*/ public ProcessorConfiguration getConfiguration() { return configuration; } /** *

* The information about the type of processor and its identifier. *

* * @param configuration

* The information about the type of processor and its * identifier. *

*/ public void setConfiguration(ProcessorConfiguration configuration) { this.configuration = configuration; } /** *

* The information about the type of processor and its identifier. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param configuration

* The information about the type of processor and its * identifier. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Processor withConfiguration(ProcessorConfiguration configuration) { this.configuration = configuration; return this; } /** *

* The sequence in which processors run. If you have multiple processors in * a channel flow, message processing goes through each processor in the * sequence. The value determines the sequence. At this point, we support * only 1 processor within a flow. *

*

* Constraints:
* Range: 1 - 3
* * @return

* The sequence in which processors run. If you have multiple * processors in a channel flow, message processing goes through * each processor in the sequence. The value determines the * sequence. At this point, we support only 1 processor within a * flow. *

*/ public Integer getExecutionOrder() { return executionOrder; } /** *

* The sequence in which processors run. If you have multiple processors in * a channel flow, message processing goes through each processor in the * sequence. The value determines the sequence. At this point, we support * only 1 processor within a flow. *

*

* Constraints:
* Range: 1 - 3
* * @param executionOrder

* The sequence in which processors run. If you have multiple * processors in a channel flow, message processing goes through * each processor in the sequence. The value determines the * sequence. At this point, we support only 1 processor within a * flow. *

*/ public void setExecutionOrder(Integer executionOrder) { this.executionOrder = executionOrder; } /** *

* The sequence in which processors run. If you have multiple processors in * a channel flow, message processing goes through each processor in the * sequence. The value determines the sequence. At this point, we support * only 1 processor within a flow. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 1 - 3
* * @param executionOrder

* The sequence in which processors run. If you have multiple * processors in a channel flow, message processing goes through * each processor in the sequence. The value determines the * sequence. At this point, we support only 1 processor within a * flow. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Processor withExecutionOrder(Integer executionOrder) { this.executionOrder = executionOrder; return this; } /** *

* Determines whether to continue with message processing or stop it in * cases where communication with a processor fails. If a processor has a * fallback action of ABORT and communication with it fails, * the processor sets the message status to FAILED and does not * send the message to any recipients. Note that if the last processor in * the channel flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message is * considered processed and sent to recipients of the channel. *

*

* Constraints:
* Allowed Values: CONTINUE, ABORT * * @return

* Determines whether to continue with message processing or stop it * in cases where communication with a processor fails. If a * processor has a fallback action of ABORT and * communication with it fails, the processor sets the message * status to FAILED and does not send the message to * any recipients. Note that if the last processor in the channel * flow sequence has a fallback action of CONTINUE and * communication with the processor fails, then the message is * considered processed and sent to recipients of the channel. *

* @see FallbackAction */ public String getFallbackAction() { return fallbackAction; } /** *

* Determines whether to continue with message processing or stop it in * cases where communication with a processor fails. If a processor has a * fallback action of ABORT and communication with it fails, * the processor sets the message status to FAILED and does not * send the message to any recipients. Note that if the last processor in * the channel flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message is * considered processed and sent to recipients of the channel. *

*

* Constraints:
* Allowed Values: CONTINUE, ABORT * * @param fallbackAction

* Determines whether to continue with message processing or stop * it in cases where communication with a processor fails. If a * processor has a fallback action of ABORT and * communication with it fails, the processor sets the message * status to FAILED and does not send the message to * any recipients. Note that if the last processor in the channel * flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message * is considered processed and sent to recipients of the channel. *

* @see FallbackAction */ public void setFallbackAction(String fallbackAction) { this.fallbackAction = fallbackAction; } /** *

* Determines whether to continue with message processing or stop it in * cases where communication with a processor fails. If a processor has a * fallback action of ABORT and communication with it fails, * the processor sets the message status to FAILED and does not * send the message to any recipients. Note that if the last processor in * the channel flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message is * considered processed and sent to recipients of the channel. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: CONTINUE, ABORT * * @param fallbackAction

* Determines whether to continue with message processing or stop * it in cases where communication with a processor fails. If a * processor has a fallback action of ABORT and * communication with it fails, the processor sets the message * status to FAILED and does not send the message to * any recipients. Note that if the last processor in the channel * flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message * is considered processed and sent to recipients of the channel. *

* @return A reference to this updated object so that method calls can be * chained together. * @see FallbackAction */ public Processor withFallbackAction(String fallbackAction) { this.fallbackAction = fallbackAction; return this; } /** *

* Determines whether to continue with message processing or stop it in * cases where communication with a processor fails. If a processor has a * fallback action of ABORT and communication with it fails, * the processor sets the message status to FAILED and does not * send the message to any recipients. Note that if the last processor in * the channel flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message is * considered processed and sent to recipients of the channel. *

*

* Constraints:
* Allowed Values: CONTINUE, ABORT * * @param fallbackAction

* Determines whether to continue with message processing or stop * it in cases where communication with a processor fails. If a * processor has a fallback action of ABORT and * communication with it fails, the processor sets the message * status to FAILED and does not send the message to * any recipients. Note that if the last processor in the channel * flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message * is considered processed and sent to recipients of the channel. *

* @see FallbackAction */ public void setFallbackAction(FallbackAction fallbackAction) { this.fallbackAction = fallbackAction.toString(); } /** *

* Determines whether to continue with message processing or stop it in * cases where communication with a processor fails. If a processor has a * fallback action of ABORT and communication with it fails, * the processor sets the message status to FAILED and does not * send the message to any recipients. Note that if the last processor in * the channel flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message is * considered processed and sent to recipients of the channel. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: CONTINUE, ABORT * * @param fallbackAction

* Determines whether to continue with message processing or stop * it in cases where communication with a processor fails. If a * processor has a fallback action of ABORT and * communication with it fails, the processor sets the message * status to FAILED and does not send the message to * any recipients. Note that if the last processor in the channel * flow sequence has a fallback action of CONTINUE * and communication with the processor fails, then the message * is considered processed and sent to recipients of the channel. *

* @return A reference to this updated object so that method calls can be * chained together. * @see FallbackAction */ public Processor withFallbackAction(FallbackAction fallbackAction) { this.fallbackAction = fallbackAction.toString(); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: " + getName() + ","); if (getConfiguration() != null) sb.append("Configuration: " + getConfiguration() + ","); if (getExecutionOrder() != null) sb.append("ExecutionOrder: " + getExecutionOrder() + ","); if (getFallbackAction() != null) sb.append("FallbackAction: " + getFallbackAction()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getConfiguration() == null) ? 0 : getConfiguration().hashCode()); hashCode = prime * hashCode + ((getExecutionOrder() == null) ? 0 : getExecutionOrder().hashCode()); hashCode = prime * hashCode + ((getFallbackAction() == null) ? 0 : getFallbackAction().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Processor == false) return false; Processor other = (Processor) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getConfiguration() == null ^ this.getConfiguration() == null) return false; if (other.getConfiguration() != null && other.getConfiguration().equals(this.getConfiguration()) == false) return false; if (other.getExecutionOrder() == null ^ this.getExecutionOrder() == null) return false; if (other.getExecutionOrder() != null && other.getExecutionOrder().equals(this.getExecutionOrder()) == false) return false; if (other.getFallbackAction() == null ^ this.getFallbackAction() == null) return false; if (other.getFallbackAction() != null && other.getFallbackAction().equals(this.getFallbackAction()) == false) return false; return true; } }