Dynamic Configuration JMS DCJMSCorrelationID

Per i flussi verso JMS Web Logic occorre definire nella dynamic configuration l’attributo DCJMSCorreleationID.
Dal momento che questo attributo non è esposto dalla ASMA occorre valorizzarlo da mapping con la seguente UDF.

public String setCorrelationID(String corID, Container container) throws StreamTransformationException{

	container.getTransformationParameters().put(StreamTransformationConstants.CONVERSATION_ID, corID);
	DynamicConfiguration conf = (DynamicConfiguration)                                container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
	
	DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS", "DCJMSCorreleationID");
	conf.put(key, corID);
	
	return "";

}
Dynamic Configuration JMS DCJMSCorreleationID

Dynamic Configuration set FileName

public String setDynConfFilename(String filename, String dummy, Container container) throws StreamTransformationException{
	/**
	 * Imposta il filename nel dynamic configuration parameter FileName della chiave http://sap.com/xi/XI/System/File.
	*/
	
	if ( filename.trim().length() == 0) return "";
	
	DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters()
						.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
	DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File","FileName");
	
	conf1.put(key1,filename);
	
	return filename;
}
Dynamic Configuration set FileName

Dynamic Configuration get FileName

UDF per ottenere il nome del file del communication channel file tramite la ASMA, Adapter-Specific Message Attribute, “http://sap.com/xi/XI/System/File” “FileName” delle Dynamic Configuration.

public String getDynConfFilename(Container container) throws StreamTransformationException{
	/*
	Ritorna la chiave "http://sap.com/xi/XI/System/File" "Directory" delle Dynamic Configuration.
	*/
	
	DynamicConfiguration dc = (DynamicConfiguration) container
					.getTransformationParameters().get(
							StreamTransformationConstants.DYNAMIC_CONFIGURATION);
	
	DynamicConfigurationKey k1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", 
												"Directory");
	
	return dc.get(k1);

}

Select che ritorna unico record

public Reference getReference(String idRole,String idUser){

String sql="SELECT * FROM refers WHERE id_role=? AND id_user=?";
Reference ref=(Reference)jdbcTemplate.queryForObject(sql, new Object[]{idRole,idUser},new BeanPropertyRowMapper(Reference.class){
public Reference extractData(ResultSet rs) throws SQLException,DataAccessException{
Reference ref=new Reference();

ref.setId(rs.getInt("id"));
ref.setIdRole(rs.getString("id_role"));
ref.setIdUser(rs.getString("id_user"));
ref.setDescription(rs.getString("description"));

return ref;
}
});