use of org.apache.axis2.transport.testkit.message.RESTMessage.Parameter in project wso2-axis2-transports by wso2.
the class RabbitMQConnectionFactoryManager method loadConnectionFactoryDefinitions.
/**
* Create ConnectionFactory instances for the definitions in the transport configuration,
* and add these into our collection of connectionFactories map keyed by name.
*
* @param trpDesc the transport description for RabbitMQ AMQP
*/
@Deprecated
private void loadConnectionFactoryDefinitions(ParameterInclude trpDesc) {
for (Parameter parameter : trpDesc.getParameters()) {
RabbitMQConnectionFactory amqpConFactory = new RabbitMQConnectionFactory(parameter);
connectionFactories.put(amqpConFactory.getName(), amqpConFactory);
}
}
use of org.apache.axis2.transport.testkit.message.RESTMessage.Parameter in project wso2-axis2-transports by wso2.
the class SMSManager method basicInit.
private void basicInit(ParameterInclude transportDescription, ConfigurationContext configurationContext) throws AxisFault {
this.configurationContext = configurationContext;
Parameter p = transportDescription.getParameter(SMSTransportConstents.IMPLIMENTAION_CLASS);
if (p == null) {
currentImplimentation = new SMPPImplManager();
} else {
String implClass = (String) p.getValue();
try {
currentImplimentation = (SMSImplManager) Class.forName(implClass).newInstance();
} catch (Exception e) {
throw new AxisFault("Error while instentiating class " + implClass, e);
}
}
currentImplimentation.setSMSInManager(this);
}
use of org.apache.axis2.transport.testkit.message.RESTMessage.Parameter in project wso2-axis2-transports by wso2.
the class SMSManager method init.
/**
* initialize the SMS manager with TransportinDiscription
* if Manager is already inited it will only set the TransportInDiscription
* in the current Implimentation manager
* @param transportInDescription
* @param configurationContext
* @throws AxisFault
*/
public void init(TransportInDescription transportInDescription, ConfigurationContext configurationContext) throws AxisFault {
if (!inited) {
basicInit(transportInDescription, configurationContext);
}
Parameter builderClass = transportInDescription.getParameter(SMSTransportConstents.BUILDER_CLASS);
if (builderClass == null) {
messageBuilder = new DefaultSMSMessageBuilderImpl();
} else {
try {
messageBuilder = (SMSMessageBuilder) Class.forName((String) builderClass.getValue()).newInstance();
} catch (Exception e) {
throw new AxisFault("Error while instentiating class " + builderClass.getValue(), e);
}
}
currentImplimentation.setTransportInDetails(transportInDescription);
// get the Axis phone number form the configuration file
Parameter phoneNum = transportInDescription.getParameter(SMSTransportConstents.PHONE_NUMBER);
if (phoneNum != null) {
this.phoneNumber = (String) phoneNum.getValue();
}
inited = true;
}
use of org.apache.axis2.transport.testkit.message.RESTMessage.Parameter in project wso2-axis2-transports by wso2.
the class MqttEndpoint method loadConfiguration.
@Override
public boolean loadConfiguration(ParameterInclude parameterInclude) throws AxisFault {
if (!(parameterInclude instanceof AxisService)) {
return false;
}
AxisService service = (AxisService) parameterInclude;
mqttConnectionFactory = mqttListener.getConnectionFactory(service);
if (mqttConnectionFactory == null) {
return false;
}
Parameter topicName = service.getParameter(MqttConstants.MQTT_TOPIC_NAME);
Parameter qosLevel = service.getParameter(MqttConstants.MQTT_QOS);
Parameter contentTypeValue = service.getParameter(MqttConstants.CONTENT_TYPE);
Parameter cleanSession = service.getParameter(MqttConstants.MQTT_SESSION_CLEAN);
Parameter clientId = service.getParameter(MqttConstants.MQTT_CLIENT_ID);
Parameter hostName = service.getParameter(MqttConstants.MQTT_SERVER_HOST_NAME);
Parameter port = service.getParameter(MqttConstants.MQTT_SERVER_PORT);
Parameter sslEnable = service.getParameter(MqttConstants.MQTT_SSL_ENABLE);
Parameter tempStore = service.getParameter(MqttConstants.MQTT_TEMP_STORE);
if (topicName != null) {
setTopic(((String) topicName.getValue()));
} else {
setTopic(mqttConnectionFactory.getTopic());
}
if (qosLevel != null) {
setQOS(Integer.parseInt((String) qosLevel.getValue()));
} else {
setQOS(mqttConnectionFactory.getQOS());
}
if (contentTypeValue != null) {
setContentType(((String) contentTypeValue.getValue()));
} else {
setContentType(mqttConnectionFactory.getContentType());
}
if (cleanSession != null) {
setCleanSession(Boolean.parseBoolean((String) cleanSession.getValue()));
} else {
setCleanSession(mqttConnectionFactory.getCleanSession());
}
if (clientId != null) {
setClientId((String) clientId.getValue());
} else {
setClientId(mqttConnectionFactory.getClientId());
}
if (hostName != null) {
setHostName((String) hostName.getValue());
} else {
setHostName(mqttConnectionFactory.getHostName());
}
if (port != null) {
setPort((String) port.getValue());
} else {
setPort(mqttConnectionFactory.getPort());
}
if (sslEnable != null) {
setSSLEnabled((String) sslEnable.getValue());
} else {
setSSLEnabled(mqttConnectionFactory.getSSLEnable());
}
if (tempStore != null) {
setTempStore((String) tempStore.getValue());
} else {
setTempStore(mqttConnectionFactory.getTempStore());
}
return true;
}
use of org.apache.axis2.transport.testkit.message.RESTMessage.Parameter in project wso2-axis2-transports by wso2.
the class MSMQEndpoint method loadConfiguration.
@Override
public boolean loadConfiguration(ParameterInclude params) {
// only support endpoints configured at service level
if (!(params instanceof AxisService)) {
return false;
}
AxisService service = (AxisService) params;
// we just assume that the service name==queue name
Parameter destParam = service.getParameter(MSMQConstants.PARAM_DESTINATION);
if (destParam != null) {
msmqDestinationQueueName = (String) destParam.getValue();
} else {
msmqDestinationQueueName = service.getName();
}
endpointReferences.add(new EndpointReference(MSMQConnectionManager.getReceiverQueueFullName(getServiceName())));
// TODO: improve MSMQ transport for two way messaging..
Parameter contentTypeParam = service.getParameter(MSMQConstants.PARAM_CONTENT_TYPE);
serviceTaskManager = ServiceTaskManagerFactory.createTaskManagerForService(service, workerPool);
serviceTaskManager.setMsmqMessageReceiver(new MSMQMessageReceiver(listener, msmqDestinationQueueName, this));
// Deal with content type
if (contentTypeParam.getValue() != null && !"".equals(String.valueOf(contentTypeParam.getValue()).trim())) {
serviceTaskManager.setContentType(String.valueOf(contentTypeParam.getValue()));
}
return true;
}
Aggregations