CDCredentialExit.java interface


CDCredentialExit.java

/*
 *   Licensed Materials - Property of IBM
 *
 *   "Restricted Materials of IBM"
 *
 *   5724-H72
 * 
 *    Copyright IBM Corp. 2011, 2020. All Rights Reserved.
 * 
 *   disclosure restricted by GSA ADP Schedule Contract with
 *   IBM Corp.
 */
package com.ibm.wmqfte.exitroutine.api;

import java.util.Map;

/**
 * An interface that is implemented by classes that are invoked as part of
 * user exit routine processing.  This interface defines methods that are
 * invoked by a Connect:Direct bridge agent to map the IBM MQ user ID of the transfer to credentials
 * that are used to access the Connect:Direct node.
 * There will be one instance of each implementation class per Connect:Direct bridge agent. The methods
 * can be called from different threads so the methods must be synchronized.
 */
public interface CDCredentialExit {

	/**
	 * Invoked once when a Connect:Direct bridge agent is started. It is intended to initialize
	 * any resources that are required by the exit
	 * 
	 * @param bridgeProperties
	 *            The values of properties defined for the Connect:Direct bridge.
	 *            These values can only be read, they cannot be updated by 
	 *            the implementation. 
	 * 
	 * @return    true if the initialisation is successful and false if unsuccessful
	 *            If false is returned from an exit the Connect:Direct bridge agent does not
	 *            start.  
	 */
	 public boolean initialize(final Map<String, String> bridgeProperties); 	  	  

 	/**
 	 * Invoked once per transfer to map the IBM MQ user ID in the transfer message to the
 	 * credentials to be used to access the Connect:Direct node.
  	 *
  	 * @param mqUserId The IBM MQ user ID from which to map to the credentials to be used
 	 *                 to access the Connect:Direct node
	 * @param snode    The name of the Connect:Direct SNODE specified as the cdNode in the 	 
	 *                 file path. This is used to map the correct user ID and password for the
 	 *                 SNODE.                  
	 * @return         A credential exit result object that contains the result of the map and
 	 *                 the credentials to use to access the Connect:Direct node
 	 */
   
	 public CDCredentialExitResult mapMQUserId(final String mqUserId, final String snode);

  	/**
 	 * Invoked once when a Connect:Direct bridge agent is shutdown. This method releases
 	 * any resources that were allocated by the exit
 	 *
  	 * @param bridgeProperties
 	 *            The values of properties defined for the Connect:Direct bridge.
 	 *            These values can only be read, they cannot be updated by
  	 *            the implementation.
  	 *
  	 * @return
	 */
	 public void shutdown(final Map<String, String> bridgeProperties); 	 }
Parent topic: Java interfaces for MFT user exits