/************************************************************************** * CreateItemFromDescription * * $Workfile$ * $Revision: 1.47 $ * $Date: 2005/10/13 08:13:58 $ * * Copyright (C) 2001 CERN - European Organization for Nuclear Research * All rights reserved. **************************************************************************/ package com.c2kernel.lifecycle.instance.predefined.agent; import com.c2kernel.common.AccessRightsException; import com.c2kernel.common.InvalidDataException; import com.c2kernel.common.ObjectAlreadyExistsException; import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.CorbaServer; import com.c2kernel.entity.agent.ActiveEntity; import com.c2kernel.lifecycle.instance.predefined.item.CreateItemFromDescription; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.ItemPath; import com.c2kernel.lookup.RolePath; import com.c2kernel.process.Gateway; import com.c2kernel.property.PropertyArrayList; import com.c2kernel.utils.Logger; /************************************************************************** * * @author $Author: abranson $ $Date: 2005/10/13 08:13:58 $ * @version $Revision: 1.47 $ **************************************************************************/ public class CreateAgentFromDescription extends CreateItemFromDescription { public CreateAgentFromDescription() { super(); } /** * Params: *
  1. New Agent name
  2. *
  3. Description version to use
  4. *
  5. Comma-delimited Role names to assign to the agent. Must already exist.
  6. *
  7. Initial properties to set in the new Agent
  8. *
* @see com.c2kernel.lifecycle.instance.predefined.item.CreateItemFromDescription#runActivityLogic(com.c2kernel.lookup.AgentPath, int, int, java.lang.String) */ @Override protected String runActivityLogic(AgentPath agent, ItemPath itemPath, int transitionID, String requestData) throws InvalidDataException { String[] input = getDataList(requestData); String newName = input[0]; String descVer = input[1]; String roles = input[2]; PropertyArrayList initProps = input.length > 3 ? getInitProperties(input[3]):new PropertyArrayList(); Logger.msg(1, "CreateAgentFromDescription::request() - Starting."); try { // check if given roles exist String[] roleArr = roles.split(","); for(int i=0; i