/**********************************************************************/
/*                                                                    */
/* Copyright (c) 2003 by Sun Microsystems, Inc.                       */
/* All rights reserved.                                               */
/*                                                                    */
/**********************************************************************/

package scouser;

import com.ibm.cics.server.CommAreaHolder;

public class GetAliasDPL
{
	static scouser.GetAlias store = new scouser.GetAliasInMemoryStore();
	
	public static void main(CommAreaHolder ca)
		throws java.rmi.RemoteException
	{
		String	name = null;
		String	alias = null;
		
		if (ca.value == null) return;
		
		GetAliasCommAreaRecord cal = new GetAliasCommAreaRecord();
		cal.setBytes(ca.value);				// build structured COMMAREA 
				
		name = cal.CA.getValue("name");		// get the name to lookup

		alias = store.LookupAlias(name.trim());
		
		cal.CA.setValue("alias", alias);	// prime the alias
		ca.value = cal.getBytes();			// repopulate the callers COMMAREA
	}
}
