/************************************************************************** * RemoveC2KObject * * $Workfile$ * $Revision: 1.28 $ * $Date: 2005/11/15 15:56:38 $ * * Copyright (C) 2001 CERN - European Organization for Nuclear Research * All rights reserved. **************************************************************************/ package com.c2kernel.lifecycle.instance.predefined; import java.util.Arrays; import com.c2kernel.common.InvalidDataException; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.ItemPath; import com.c2kernel.process.Gateway; import com.c2kernel.utils.Logger; /************************************************************************** * * @author $Author: abranson $ $Date: 2005/11/15 15:56:38 $ * @version $Revision: 1.28 $ **************************************************************************/ public class RemoveC2KObject extends PredefinedStep { public RemoveC2KObject() { super(); getProperties().put("Agent Role", "Admin"); } //requestdata is xmlstring @Override protected String runActivityLogic(AgentPath agent, ItemPath item, int transitionID, String requestData) throws InvalidDataException { String[] params = getDataList(requestData); if (Logger.doLog(3)) Logger.msg(3, "RemoveC2KObject: called by "+agent+" on "+item+" with parameters "+Arrays.toString(params)); try { String path = params[0]; Gateway.getStorage().remove( item, path, null ); } catch( Exception ex ) { throw unknownException(ex); } return requestData; } }