Skip to content

Instantly share code, notes, and snippets.

View Downloadmodules
# Provide the name of your resource group
$ResourceGroupName="**********"
# Provide the name of your Storage account.
$StorageAccountName="**************"
# Provide the Storage account key
$StorageAccountKey = '**********'
# Provide the name for your Azure Files share.
$ShareName = "modulecode3" //File share name in the storage account
# Provide the name for your Directory.
$DirectoryName = "RunbookOne" //Filename for download
@viksingh
viksingh / KeyExtractor.java
Created Jul 1, 2018 — forked from andrewkroh/KeyExtractor.java
Java Keystore Private Key Extractor
View KeyExtractor.java
/*
* Copyright 2011 Andrew Kroh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@viksingh
viksingh / JM_SampleJavaMapping_PI.java
Created Feb 22, 2018 — forked from SriniBlog/JM_SampleJavaMapping_PI.java
This is a Sample Java Mapping Program for SAP PI Tool. Tested and Works Fine!
View JM_SampleJavaMapping_PI.java
/***** Standard Java Libraries ********/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
@viksingh
viksingh / ReadDynamicConfiguration.java
Created Feb 9, 2018 — forked from SriniBlog/ReadDynamicConfiguration.java
Learn to Read Dynamic Configuration in SAP PI Java Mapping
View ReadDynamicConfiguration.java
/*
* Author: Vanamala Srinivas
* Website: www.sriniblog.com
* Note: This is just a snippet and use it as a reference.
* Complete Blog: http://sriniblog.com/read-write-dynamic-configuration-in-sap-pi-using-java-mapping/
*/
public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException
{
trace = (AbstractTrace) getTrace(); //Capture trace object and write trace for debugging purpose.
@viksingh
viksingh / JM_ReadWritePayload_PI.java
Created Feb 9, 2018 — forked from SriniBlog/JM_ReadWritePayload_PI.java
Read and Write the Payload using SAP PI Java Mapping
View JM_ReadWritePayload_PI.java
public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException {
try {
InputStream in = arg0.getInputPayload().getInputStream();
OutputStream out = arg1.getOutputPayload().getOutputStream();
int buffer;
//Read and Write back the file
while ((buffer = in.read()) != -1)
{
out.write(buffer);
@viksingh
viksingh / SavePayload_Module_PI.java
Created Feb 9, 2018 — forked from SriniBlog/SavePayload_Module_PI.java
This is a Adapter Module Utility to save payload from any channel. Very helpful to see what message is passed from channel.
View SavePayload_Module_PI.java
/**
*
*/
package com.sap.adaptermodule;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Date;
@viksingh
viksingh / WriteDynamicConfiguration_AdapterModule.java
Created Feb 9, 2018 — forked from SriniBlog/WriteDynamicConfiguration_AdapterModule.java
This is the adapter module Utility to write the dynamic configuration from the channel module.
View WriteDynamicConfiguration_AdapterModule.java
/**
*
*/
package com.sap.adaptermodule;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
@viksingh
viksingh / setDynamicConfiguration.java
Created Feb 9, 2018 — forked from SriniBlog/setDynamicConfiguration.java
This method is used in SAP PI Mapping UDF to write the Dynamic Configuration
View setDynamicConfiguration.java
public boolean setDynamicConfiguration(String Namespace, String FieldName, String FieldValue, Container container) throws StreamTransformationException{
boolean success = false;
try{
//Get the DynamicConfiguration instance
DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//Define key to write in the Dynamic Configuration
DynamicConfigurationKey key1 = DynamicConfigurationKey.create(Namespace, FieldName);
//Write the parameter from the Dynamic Configuration based on the key
@viksingh
viksingh / getDynamicFileName.java
Created Feb 9, 2018 — forked from SriniBlog/getDynamicFileName.java
This method is used in SAP PI Mapping UDF to read the FileName from the Dynamic Configuration
View getDynamicFileName.java
public String getDynamicFileName(Container container) throws StreamTransformationException{
String FileValue = "";
try{
//Get the DynamicConfiguration instance
DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//Define key to read from the Dynamic Configuration
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
//Read the FileName parameter from the Dynamic Configuration based on the key
@viksingh
viksingh / setDynamicFileName.java
Created Feb 9, 2018 — forked from SriniBlog/setDynamicFileName.java
This method is used in SAP PI Mapping UDF to write the FileName Dynamic Configuration
View setDynamicFileName.java
public boolean setDynamicFileName(String FieldValue, Container container) throws StreamTransformationException{
boolean success = false;
try{
//Get the DynamicConfiguration instance
DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//Define key to write in the Dynamic Configuration
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
//Write the FileName parameter from the Dynamic Configuration based on the key