diff options
Diffstat (limited to 'plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src')
-rw-r--r-- | plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JmsObjectEventConverter.java (renamed from plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JMSObjectEventConverter.java) | 32 | ||||
-rw-r--r-- | plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JmsTextEventConverter.java (renamed from plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JMSTextEventConverter.java) | 15 | ||||
-rw-r--r-- | plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JmsObjectEventProtocolParameters.java (renamed from plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JMSObjectEventProtocolParameters.java) | 24 | ||||
-rw-r--r-- | plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JmsTextEventProtocolParameters.java (renamed from plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JMSTextEventProtocolParameters.java) | 28 |
4 files changed, 47 insertions, 52 deletions
diff --git a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JMSObjectEventConverter.java b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JmsObjectEventConverter.java index 6c21070c2..ca02709fe 100644 --- a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JMSObjectEventConverter.java +++ b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JmsObjectEventConverter.java @@ -33,24 +33,23 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * The Class Apex2JMSObjectEventConverter converts {@link ApexEvent} instances into string instances of - * object message events for JMS. + * The Class Apex2JMSObjectEventConverter converts {@link ApexEvent} instances into string instances of object message + * events for JMS. * * @author Liam Fallon (liam.fallon@ericsson.com) */ -public final class Apex2JMSObjectEventConverter implements ApexEventProtocolConverter { - private static final XLogger LOGGER = XLoggerFactory.getXLogger(Apex2JMSObjectEventConverter.class); +public final class Apex2JmsObjectEventConverter implements ApexEventProtocolConverter { + private static final XLogger LOGGER = XLoggerFactory.getXLogger(Apex2JmsObjectEventConverter.class); // JMS event protocol parameters on the consumer (JMS->Apex) sides - private JMSObjectEventProtocolParameters eventProtocolParameters = null; + private JmsObjectEventProtocolParameters eventProtocolParameters = null; /** * Constructor to create the Apex to JMS Object converter. * - * @throws ApexEventException - * the apex event exception + * @throws ApexEventException the apex event exception */ - public Apex2JMSObjectEventConverter() throws ApexEventException { + public Apex2JmsObjectEventConverter() throws ApexEventException { // Nothing specific to initiate for this plugin } @@ -59,13 +58,13 @@ public final class Apex2JMSObjectEventConverter implements ApexEventProtocolConv // Check if properties have been set for JMS object event conversion as a consumer. They may not be set because // JMS may not be in use // on both sides of Apex - if (!(parameters instanceof JMSObjectEventProtocolParameters)) { + if (!(parameters instanceof JmsObjectEventProtocolParameters)) { final String errormessage = "specified Event Protocol Parameters properties of type \"" + parameters.getClass().getCanonicalName() + "\" are not applicable to a " - + Apex2JMSObjectEventConverter.class.getName() + " converter"; + + Apex2JmsObjectEventConverter.class.getName() + " converter"; LOGGER.error(errormessage); } else { - this.eventProtocolParameters = (JMSObjectEventProtocolParameters) parameters; + this.eventProtocolParameters = (JmsObjectEventProtocolParameters) parameters; } } @@ -101,7 +100,8 @@ public final class Apex2JMSObjectEventConverter implements ApexEventProtocolConv // Check that the consumer parameters for JMS->Apex messaging have been set if (eventProtocolParameters == null) { - final String errorMessage = "consumer parameters for JMS events consumed by Apex are not set in the Apex configuration for this engine"; + final String errorMessage = "consumer parameters for JMS events consumed by " + + "Apex are not set in the Apex configuration for this engine"; LOGGER.debug(errorMessage); throw new ApexEventRuntimeException(errorMessage); } @@ -114,7 +114,7 @@ public final class Apex2JMSObjectEventConverter implements ApexEventProtocolConv jmsIncomingObject.toString().getClass().getPackage().getName(), eventProtocolParameters.getIncomingEventSource(), eventProtocolParameters.getIncomingEventTarget()); - // @formattter:on + // @formatter:on // Set the data on the apex event as the incoming object apexEvent.put(jmsIncomingObject.getClass().getSimpleName(), jmsIncomingObject); @@ -128,7 +128,8 @@ public final class Apex2JMSObjectEventConverter implements ApexEventProtocolConv /* * (non-Javadoc) * - * @see org.onap.policy.apex.service.engine.event.ApexEventConverter#fromApexEvent(org.onap.policy.apex.service.engine.event.ApexEvent) + * @see org.onap.policy.apex.service.engine.event.ApexEventConverter#fromApexEvent + * (org.onap.policy.apex.service.engine.event.ApexEvent) */ @Override public Object fromApexEvent(final ApexEvent apexEvent) throws ApexEventException { @@ -140,7 +141,8 @@ public final class Apex2JMSObjectEventConverter implements ApexEventProtocolConv // Check that the Apex event has a single parameter if (apexEvent.size() != 1) { - final String errorMessage = "event processing failed, Apex event must have one and only one parameter for JMS Object handling"; + final String errorMessage = "event processing failed, " + + "Apex event must have one and only one parameter for JMS Object handling"; LOGGER.warn(errorMessage); throw new ApexEventException(errorMessage); } diff --git a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JMSTextEventConverter.java b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JmsTextEventConverter.java index e845a4a08..1c44dd111 100644 --- a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JMSTextEventConverter.java +++ b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/Apex2JmsTextEventConverter.java @@ -26,26 +26,19 @@ import java.util.List; import org.onap.policy.apex.service.engine.event.ApexEvent; import org.onap.policy.apex.service.engine.event.ApexEventException; import org.onap.policy.apex.service.engine.event.ApexEventRuntimeException; -import org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.Apex2JSONEventConverter; +import org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.Apex2JsonEventConverter; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** * The Class Apex2JMSTextEventConverter converts {@link ApexEvent} instances into string instances of * text message events for JMS. It is a proxy for the built in - * {@link org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.Apex2JSONEventConverter} plugin. + * {@link org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.Apex2JsonEventConverter} plugin. * * @author Liam Fallon (liam.fallon@ericsson.com) */ -public final class Apex2JMSTextEventConverter extends Apex2JSONEventConverter { - private static final XLogger LOGGER = XLoggerFactory.getXLogger(Apex2JMSTextEventConverter.class); - - /** - * Constructor to create the Apex to JMS Object converter. - * - * @throws ApexEventException the apex event exception - */ - public Apex2JMSTextEventConverter() throws ApexEventException {} +public final class Apex2JmsTextEventConverter extends Apex2JsonEventConverter { + private static final XLogger LOGGER = XLoggerFactory.getXLogger(Apex2JmsTextEventConverter.class); /* * (non-Javadoc) diff --git a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JMSObjectEventProtocolParameters.java b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JmsObjectEventProtocolParameters.java index 83aef4e9d..3c15a7825 100644 --- a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JMSObjectEventProtocolParameters.java +++ b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JmsObjectEventProtocolParameters.java @@ -25,8 +25,7 @@ import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolParame /** * Event protocol parameters for JMS Object messages as an event protocol. * - * <p> - * On reception of an a JMS {@code javax.jms.ObjectMessage}, the JMS Object plugin unmarshals the message as follows: + * <p>On reception of an a JMS {@code javax.jms.ObjectMessage}, the JMS Object plugin unmarshals the message as follows: * <ol> * <li>It extracts the Java object from the {@code javax.jms.ObjectMessage} instance.</li> * <li>It creates an {@link org.onap.policy.apex.service.engine.event.ApexEvent} instance to hold the java object.</li> @@ -40,11 +39,11 @@ import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolParame * <li>It puts a single entry into the Apex event map with the the simple class name of the incoming Java object being * the key of the entry and the actual incoming object as the value of the entry.</li> * </ol> - * <p> - * When sending an object to JMS, the plugin expects to receive an Apex event with a single entry. The plugin marshals - * the value of that entry to an object that can be sent by JMS as a {@code javax.jms.ObjectMessage} instance. - * <p> - * The parameters for this plugin are: + * + * <p>When sending an object to JMS, the plugin expects to receive an Apex event with a single entry. The plugin + * marshals the value of that entry to an object that can be sent by JMS as a {@code javax.jms.ObjectMessage} instance. + * + * <p>The parameters for this plugin are: * <ol> * <li>incomingEventSuffix: The suffix to append to the simple name of incoming Java class instances when they are * encapsulated in Apex events. The parameter defaults to the string value {@code IncomingEvent}.</li> @@ -58,7 +57,7 @@ import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolParame * * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class JMSObjectEventProtocolParameters extends EventProtocolParameters { +public class JmsObjectEventProtocolParameters extends EventProtocolParameters { /** The label of this event protocol. */ public static final String JMS_OBJECT_EVENT_PROTOCOL_LABEL = "JMSOBJECT"; @@ -77,16 +76,17 @@ public class JMSObjectEventProtocolParameters extends EventProtocolParameters { //@formatter:off /** - * Constructor to create a JSON event protocol parameter instance and register the instance with the parameter service. + * Constructor to create a JSON event protocol parameter instance and register the instance with the + * parameter service. */ - public JMSObjectEventProtocolParameters() { - super(JMSObjectEventProtocolParameters.class.getCanonicalName()); + public JmsObjectEventProtocolParameters() { + super(JmsObjectEventProtocolParameters.class.getCanonicalName()); // Set the event protocol properties for the JMS Text event protocol this.setLabel(JMS_OBJECT_EVENT_PROTOCOL_LABEL); // Set the event protocol plugin class - this.setEventProtocolPluginClass(Apex2JMSObjectEventConverter.class.getCanonicalName()); + this.setEventProtocolPluginClass(Apex2JmsObjectEventConverter.class.getCanonicalName()); } /** diff --git a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JMSTextEventProtocolParameters.java b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JmsTextEventProtocolParameters.java index b3a9154ff..67b211a08 100644 --- a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JMSTextEventProtocolParameters.java +++ b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-jms/src/main/java/org/onap/policy/apex/plugins/event/protocol/jms/JmsTextEventProtocolParameters.java @@ -20,23 +20,23 @@ package org.onap.policy.apex.plugins.event.protocol.jms; -import org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.JSONEventProtocolParameters; +import org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.JsonEventProtocolParameters; /** * Event protocol parameters for JMS Text messages as an event protocol. - * <p> - * Text messages received and sent over JMS in ~Text format are assumed to be in a JSON format that Apex can understand. - * Therefore this plugin is a subclass of the built in JSON event protocol plugin. - * <p> - * On reception of a JMS {@code javax.jms.TextMessage} message, the JMS Text plugin unmarshals the message the JMS text - * message and passes it to its JSON superclass unmarshaling for processing. - * <p> - * When sending an Apex event, the plugin uses its underlying JSON superclass to marshal the event to a JSON string and - * passes that string to the JSON carrier plugin for sending. + * + * <p>Text messages received and sent over JMS in ~Text format are assumed to be in a JSON format that Apex can + * understand. Therefore this plugin is a subclass of the built in JSON event protocol plugin. + * + * <p>On reception of a JMS {@code javax.jms.TextMessage} message, the JMS Text plugin unmarshals the message the JMS + * text message and passes it to its JSON superclass unmarshaling for processing. + * + * <p>When sending an Apex event, the plugin uses its underlying JSON superclass to marshal the event to a JSON string + * and passes that string to the JSON carrier plugin for sending. * * @author Liam Fallon (liam.fallon@ericsson.com) */ -public class JMSTextEventProtocolParameters extends JSONEventProtocolParameters { +public class JmsTextEventProtocolParameters extends JsonEventProtocolParameters { /** The label of this event protocol. */ public static final String JMS_TEXT_EVENT_PROTOCOL_LABEL = "JMSTEXT"; @@ -44,13 +44,13 @@ public class JMSTextEventProtocolParameters extends JSONEventProtocolParameters * Constructor to create a JSON event protocol parameter instance and register the instance with the parameter * service. */ - public JMSTextEventProtocolParameters() { - super(JMSTextEventProtocolParameters.class.getCanonicalName(), JMS_TEXT_EVENT_PROTOCOL_LABEL); + public JmsTextEventProtocolParameters() { + super(JmsTextEventProtocolParameters.class.getCanonicalName(), JMS_TEXT_EVENT_PROTOCOL_LABEL); // Set the event protocol properties for the JMS Text event protocol this.setLabel(JMS_TEXT_EVENT_PROTOCOL_LABEL); // Set the event protocol plugin class - this.setEventProtocolPluginClass(Apex2JMSTextEventConverter.class.getCanonicalName()); + this.setEventProtocolPluginClass(Apex2JmsTextEventConverter.class.getCanonicalName()); } } |