From b086f57f56bf0eb9dab9cf321a0f69aaaae84347 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 30 May 2012 08:37:45 +0200 Subject: Initial Maven Conversion --- .../predefined/entitycreation/Aggregation.java | 25 ---- .../entitycreation/AggregationMember.java | 21 --- .../predefined/entitycreation/CreateNewAgent.java | 49 ------- .../predefined/entitycreation/CreateNewItem.java | 46 ------- .../predefined/entitycreation/Dependency.java | 44 ------- .../entitycreation/DependencyMember.java | 18 --- .../predefined/entitycreation/Geometry.java | 29 ----- .../predefined/entitycreation/NewAgent.java | 63 --------- .../predefined/entitycreation/NewItem.java | 141 --------------------- .../predefined/entitycreation/Property.java | 26 ---- 10 files changed, 462 deletions(-) delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java delete mode 100644 source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java (limited to 'source/com/c2kernel/lifecycle/instance/predefined/entitycreation') diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java deleted file mode 100644 index 2de12e0..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - -import java.util.ArrayList; - -public class Aggregation implements java.io.Serializable { - - public boolean isDescription; - public ArrayList aggregationMemberList; - public String name; - - public Aggregation() { - super(); - aggregationMemberList = new ArrayList(); - } - - public Aggregation(String name, boolean isDescription) { - this(); - this.name = name; - this.isDescription = isDescription; - } - - public com.c2kernel.collection.Aggregation create() { - return new com.c2kernel.collection.AggregationInstance(); - } -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java deleted file mode 100644 index 29d3cf9..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - -public class AggregationMember implements java.io.Serializable { - - public int slotNo; - public String itemDescriptionPath; - public String itemPath; - public Geometry geometry; - - - public AggregationMember() { - super(); - } - - public AggregationMember(int slotNo, String itemDescPath, String itemPath, Geometry geometry) { - this.slotNo = slotNo; - this.itemDescriptionPath = itemDescPath; - this.itemPath = itemPath; - this.geometry = geometry; - } -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java deleted file mode 100644 index aa30677..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************** - * AddDomainPath - * - * Copyright (C) 2001 CERN - European Organization for Nuclear Research - * All rights reserved. - **************************************************************************/ - -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - - - - -import com.c2kernel.common.AccessRightsException; -import com.c2kernel.common.InvalidDataException; -import com.c2kernel.common.InvalidTransitionException; -import com.c2kernel.lifecycle.instance.predefined.PredefinedStep; -import com.c2kernel.lookup.AgentPath; -import com.c2kernel.utils.CastorXMLUtility; -import com.c2kernel.utils.Logger; - -public class CreateNewAgent extends PredefinedStep -{ - public CreateNewAgent() - { - super(); - } - - //requestdata is xmlstring - @Override - public void request( AgentPath agent, int transitionID, String requestData) - throws AccessRightsException, - InvalidTransitionException, - InvalidDataException - { - checkAccessRights(agent); - String redactedRequestData; - try { - NewAgent newAgent = (NewAgent)CastorXMLUtility.unmarshall(requestData); - newAgent.create(agent.getSysKey()); - newAgent.password = "REDACTED"; - redactedRequestData = CastorXMLUtility.marshall(newAgent); - } catch (Exception ex) { - Logger.error(ex); - throw new InvalidDataException("Error creating agent", ""); - } - - sendEventStoreOutcome(transitionID, redactedRequestData, agent); - } -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java deleted file mode 100644 index a66b062..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************** - * CreateNewItem - * - * Copyright (C) 2005 CERN - European Organization for Nuclear Research - * All rights reserved. - **************************************************************************/ - -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - - - - -import com.c2kernel.common.AccessRightsException; -import com.c2kernel.common.InvalidDataException; -import com.c2kernel.common.InvalidTransitionException; -import com.c2kernel.lifecycle.instance.predefined.PredefinedStep; -import com.c2kernel.lookup.AgentPath; -import com.c2kernel.utils.CastorXMLUtility; -import com.c2kernel.utils.Logger; - -public class CreateNewItem extends PredefinedStep -{ - public CreateNewItem() - { - super(); - } - - //requestdata is xmlstring - @Override - public void request( AgentPath agent, int transitionID, String requestData) - throws AccessRightsException, - InvalidTransitionException, - InvalidDataException - { - checkAccessRights(agent); - - try { - NewItem item = (NewItem)CastorXMLUtility.unmarshall(requestData); - item.create(agent.getSysKey()); - } catch (Exception ex) { - Logger.error(ex); - throw new InvalidDataException("Error creating item", ""); - } - sendEventStoreOutcome(transitionID, requestData, agent); - } -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java deleted file mode 100644 index 1124ede..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - -import java.util.ArrayList; - -import com.c2kernel.collection.MembershipException; -import com.c2kernel.lookup.DomainPath; -import com.c2kernel.property.PropertyUtility; - -public class Dependency implements java.io.Serializable { - - public String name; - public boolean isDescription; - public String itemDescriptionPath; - public ArrayList dependencyMemberList; - - public Dependency() { - super(); - dependencyMemberList = new ArrayList(); - } - - public Dependency(String itemDesc) { - this(); - this.itemDescriptionPath = itemDesc; - } - - /** - * @return - */ - public com.c2kernel.collection.Dependency create() throws MembershipException{ - com.c2kernel.collection.Dependency newDep = isDescription?new com.c2kernel.collection.DependencyDescription(name):new com.c2kernel.collection.Dependency(name); - if (itemDescriptionPath != null && itemDescriptionPath.length()>0) { - PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(itemDescriptionPath).getSysKey()); - //TODO: set props and class identifiers - } - for (DependencyMember thisMem : dependencyMemberList) { - int syskey = new DomainPath(thisMem.itemPath).getSysKey(); - if (syskey == -1) - throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection."); - newDep.addMember(syskey); - } - return newDep; - } - -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java deleted file mode 100644 index b70619f..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java +++ /dev/null @@ -1,18 +0,0 @@ - -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - -public class DependencyMember implements java.io.Serializable { - - - public String itemPath; - - public DependencyMember() { - super(); - } - - public DependencyMember(String itemPath) { - this.itemPath = itemPath; - - } - -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java deleted file mode 100644 index f18b6d4..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java +++ /dev/null @@ -1,29 +0,0 @@ - - -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - - - -public class Geometry implements java.io.Serializable { - - - public int x; - - public int y; - - public int width; - - public int height; - - public Geometry() { - super(); - } - - public Geometry(int x, int y, int width, int height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java deleted file mode 100644 index 540a6fc..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; - -import com.c2kernel.common.CannotManageException; -import com.c2kernel.common.ObjectAlreadyExistsException; -import com.c2kernel.common.ObjectCannotBeUpdated; -import com.c2kernel.common.ObjectNotFoundException; -import com.c2kernel.entity.agent.ActiveEntity; -import com.c2kernel.lookup.AgentPath; -import com.c2kernel.lookup.RolePath; -import com.c2kernel.process.Gateway; -import com.c2kernel.property.PropertyArrayList; -import com.c2kernel.utils.CastorXMLUtility; -import com.c2kernel.utils.Logger; - -public class NewAgent implements java.io.Serializable { - - public String name; - - public String password; - - public ArrayList roles; - - public NewAgent() { - super(); - roles = new ArrayList(); - } - - public NewAgent(String name, String password) { - this.name = name; - this.password = password; - } - - protected void create(int agentId) throws ObjectNotFoundException, ObjectCannotBeUpdated, NoSuchAlgorithmException, CannotManageException, ObjectAlreadyExistsException { - AgentPath newAgent = Gateway.getLDAPLookup().getNextKeyManager().generateNextAgentKey(); - newAgent.setAgentName(name); - newAgent.setPassword(password); - ActiveEntity newAgentEnt = (ActiveEntity)Gateway.getCorbaServer().createEntity(newAgent); - Gateway.getLDAPLookup().add(newAgent); - // assemble properties - PropertyArrayList propList = new PropertyArrayList(); - propList.list.add(new com.c2kernel.property.Property("Name", name)); - propList.list.add(new com.c2kernel.property.Property("Type", "Agent")); - try { - newAgentEnt.initialise(CastorXMLUtility.marshall(propList)); - } catch (Exception ex) { - Logger.error(ex); - throw new CannotManageException("Error initialising new agent"); - } - for (String role : roles) { - RolePath thisRole; - try { - thisRole = Gateway.getLDAPLookup().getRoleManager().getRolePath(role); - } catch (ObjectNotFoundException ex) { - thisRole = Gateway.getLDAPLookup().getRoleManager().createRole(role, false); - } - thisRole.addAgent(newAgent); - } - - } -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java deleted file mode 100644 index f155ced..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.c2kernel.lifecycle.instance.predefined.entitycreation; - - -import java.util.ArrayList; - -import com.c2kernel.collection.MembershipException; -import com.c2kernel.common.CannotManageException; -import com.c2kernel.common.ObjectAlreadyExistsException; -import com.c2kernel.common.ObjectCannotBeUpdated; -import com.c2kernel.common.ObjectNotFoundException; -import com.c2kernel.entity.TraceableEntity; -import com.c2kernel.lifecycle.CompositeActivityDef; -import com.c2kernel.lookup.DomainPath; -import com.c2kernel.lookup.EntityPath; -import com.c2kernel.persistency.ClusterStorageException; -import com.c2kernel.process.Gateway; -import com.c2kernel.property.PropertyArrayList; -import com.c2kernel.utils.CastorXMLUtility; -import com.c2kernel.utils.LocalObjectLoader; -import com.c2kernel.utils.Logger; - -/** - * Complete Structure for new item - * - * @version $Revision: 1.8 $ $Date: 2006/03/03 13:52:21 $ - */ - -public class NewItem { - - public String name; - - /** - * The initial Domain Path to be created for this Item. - */ - public String initialPath; - - /** - * The name of the Composite Activity Definition to be - * instantiated for the workflow of this Item - */ - public String workflow; - - /** - * New Properties for the item - */ - public ArrayList propertyList; - - /** - * Field _aggregationList - */ - public ArrayList aggregationList; - - /** - * Field _dependencyList - */ - public ArrayList dependencyList; - - - public NewItem() { - super(); - propertyList = new ArrayList(); - aggregationList = new ArrayList(); - dependencyList = new ArrayList(); - } - - public NewItem(String name, String initialPath, String wf) { - this(); - this.name = name; - this.initialPath = initialPath; - this.workflow = wf; - } - - public void setProperty(String name, String value) { - for (Property prop : propertyList) { - if (prop.name.equals(name)) { - prop.value = value; - return; - } - } - propertyList.add(new Property(name, value)); - } - - protected void create(int agentId) throws ObjectCannotBeUpdated, ObjectNotFoundException, CannotManageException, ObjectAlreadyExistsException { - DomainPath domPath = new DomainPath(new DomainPath(initialPath), name); - if (domPath.exists()) - throw new ObjectAlreadyExistsException(domPath+" already exists!", ""); - - // create item - EntityPath entPath = Gateway.getLDAPLookup().getNextKeyManager().generateNextEntityKey(); - TraceableEntity newItem = (TraceableEntity)Gateway.getCorbaServer().createEntity(entPath); - Gateway.getLDAPLookup().add(entPath); - - // assemble properties - PropertyArrayList propList = new PropertyArrayList(); - propList.list.add(new com.c2kernel.property.Property("Name", name)); - for (Property element : propertyList) { - propList.list.add(new com.c2kernel.property.Property(element.name, element.value)); - } - // init the new item - try { - - // find workflow def - CompositeActivityDef compact = (CompositeActivityDef)LocalObjectLoader.getActDef(workflow, "last"); - - newItem.initialise( - agentId, - CastorXMLUtility.marshall(propList), - CastorXMLUtility.marshall(compact.instantiate())); - } catch (Exception ex) { - Logger.error("Error initialising new item"); - Logger.error(ex); - throw new CannotManageException("Problem initialising new item. See server log.", ""); - } - - // create collections - - for (Dependency element: dependencyList) { - try { - Gateway.getStorage().put(entPath.getSysKey(), element.create(), null); - } catch (ClusterStorageException ex) { - Logger.error(ex); - throw new CannotManageException("Could not create Dependency "+element.name, ""); - } catch (MembershipException ex) { - Logger.error(ex); - throw new CannotManageException("A specified member is not of the correct type in "+element.name, ""); - } - } - - for (Aggregation element : aggregationList) { - try { - Gateway.getStorage().put(entPath.getSysKey(), element.create(), null); - } catch (ClusterStorageException ex) { - Logger.error(ex); - throw new CannotManageException("Could not create Aggregation "+element.name, ""); - } - } - // register domain path - domPath.setEntity(entPath); - Gateway.getLDAPLookup().add(domPath); - } -} diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java deleted file mode 100644 index e2d214c..0000000 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.c2kernel.lifecycle.instance.predefined.entitycreation; -/** - * New Properties for the item - * - * @version $Revision: 1.1 $ $Date: 2005/04/28 13:48:26 $ - */ -public class Property implements java.io.Serializable { - - public String name; - public String value; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Property() { - super(); - } - - public Property(String name, String value) { - super(); - this.name = name; - this.value = value; - } -} -- cgit v1.2.3