diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-05-30 08:37:45 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-05-30 08:37:45 +0200 |
| commit | b086f57f56bf0eb9dab9cf321a0f69aaaae84347 (patch) | |
| tree | 8e6e26e8b7eed6abad7a17b093bdbb55c5e6b1ba /source/com/c2kernel/property | |
| parent | 22088ae8d2d5ff390518dbe1c4372325ffb3a647 (diff) | |
Initial Maven Conversion
Diffstat (limited to 'source/com/c2kernel/property')
| -rw-r--r-- | source/com/c2kernel/property/Property.java | 85 | ||||
| -rw-r--r-- | source/com/c2kernel/property/PropertyArrayList.java | 29 | ||||
| -rw-r--r-- | source/com/c2kernel/property/PropertyDescription.java | 77 | ||||
| -rw-r--r-- | source/com/c2kernel/property/PropertyDescriptionList.java | 63 | ||||
| -rw-r--r-- | source/com/c2kernel/property/PropertyUtility.java | 83 |
5 files changed, 0 insertions, 337 deletions
diff --git a/source/com/c2kernel/property/Property.java b/source/com/c2kernel/property/Property.java deleted file mode 100644 index 3022cc5..0000000 --- a/source/com/c2kernel/property/Property.java +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************
- *
- * $Revision: 1.3 $
- * $Date: 2003/10/03 12:31:28 $
- *
- * Copyright (C) 2001 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-package com.c2kernel.property;
-
-import com.c2kernel.entity.C2KLocalObject;
-import com.c2kernel.persistency.ClusterStorage;
-
-
-public class Property implements C2KLocalObject
-{
- private String mName;
- private String mValue;
-
-
- /**************************************************************************
- *
- **************************************************************************/
- public Property()
- {
- setName( "" );
- setValue( "" );
- }
-
-
- /**************************************************************************
- *
- **************************************************************************/
- public Property( String name, String value )
- {
- setName( name );
- setValue( value );
- }
-
- /**************************************************************************
- *
- **************************************************************************/
- @Override
- public void setName(String name)
- {
- mName = name;
- }
-
-
- /**************************************************************************
- *
- **************************************************************************/
- @Override
- public String getName()
- {
- return mName;
- }
-
-
- /**************************************************************************
- *
- **************************************************************************/
- public void setValue( String value )
- {
- mValue = value;
- }
-
-
- /**************************************************************************
- *
- **************************************************************************/
- public String getValue()
- {
- return mValue;
- }
- /**
- * @see com.c2kernel.entity.C2KLocalObject#getClusterType()
- */
- @Override
- public String getClusterType() {
- return ClusterStorage.PROPERTY;
- }
-
-}
diff --git a/source/com/c2kernel/property/PropertyArrayList.java b/source/com/c2kernel/property/PropertyArrayList.java deleted file mode 100644 index f59b2d5..0000000 --- a/source/com/c2kernel/property/PropertyArrayList.java +++ /dev/null @@ -1,29 +0,0 @@ -/**************************************************************************
- *
- * $Revision: 1.2 $
- * $Date: 2003/06/20 11:44:30 $
- *
- * Copyright (C) 2001 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-package com.c2kernel.property;
-
-import java.util.ArrayList;
-
-import com.c2kernel.utils.CastorArrayList;
-
-public class PropertyArrayList extends CastorArrayList<Property>
-{
- public PropertyArrayList()
- {
- super();
- }
-
- public PropertyArrayList(ArrayList<Property> aList)
- {
- super(aList);
- }
-
-
-}
diff --git a/source/com/c2kernel/property/PropertyDescription.java b/source/com/c2kernel/property/PropertyDescription.java deleted file mode 100644 index cd3b93c..0000000 --- a/source/com/c2kernel/property/PropertyDescription.java +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************
- *
- * $Revision: 1.5 $
- * $Date: 2003/05/16 11:36:47 $
- *
- * Copyright (C) 2001 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-package com.c2kernel.property;
-
-public class PropertyDescription
-{
- private String mName=null;
- private String mDefaultValue=null;
- private boolean mIsClassIdentifier=false;
- private boolean mIsMutable=false;
-
-
- public PropertyDescription()
- {
- }
-
- public PropertyDescription(String name, String defaultValue, boolean isClassIdentifier, boolean isMutable )
- {
- setName(name);
- setDefaultValue(defaultValue);
- setIsClassIdentifier(isClassIdentifier);
- setIsMutable(isMutable);
- }
-
- public void setName(String name)
- {
- mName = name;
- }
-
- public void setIsClassIdentifier(boolean classId)
- {
- mIsClassIdentifier = classId;
- }
-
- public void setDefaultValue(String defaultValue)
- {
- mDefaultValue = defaultValue;
- }
-
- public void setIsMutable(boolean mutable)
- {
- mIsMutable = mutable;
- }
-
- public String getName()
- {
- return mName;
- }
-
- public boolean getIsClassIdentifier()
- {
- return mIsClassIdentifier;
- }
-
- public String getDefaultValue()
- {
- return mDefaultValue;
- }
-
- public boolean getIsMutable()
- {
- return mIsMutable;
- }
-
- public Property getProperty()
- {
- return new Property(mName,mDefaultValue);
- }
-
-}
diff --git a/source/com/c2kernel/property/PropertyDescriptionList.java b/source/com/c2kernel/property/PropertyDescriptionList.java deleted file mode 100644 index a6c68e2..0000000 --- a/source/com/c2kernel/property/PropertyDescriptionList.java +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************
- *
- * $Revision: 1.3 $
- * $Date: 2003/07/18 12:43:53 $
- *
- * Copyright (C) 2001 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-package com.c2kernel.property;
-
-import java.util.ArrayList;
-
-import com.c2kernel.utils.CastorArrayList;
-
-public class PropertyDescriptionList extends CastorArrayList<PropertyDescription>
-{
- public PropertyDescriptionList()
- {
- super();
- }
-
- public PropertyDescriptionList(ArrayList<PropertyDescription> aList)
- {
- super(aList);
- }
-
- public String getClassProps() {
- StringBuffer props = new StringBuffer();
- for (Object name : list) {
- PropertyDescription element = (PropertyDescription)name;
- if (element.getIsClassIdentifier()) {
- if (props.length()>0)
- props.append(",");
- props.append(element.getName());
- }
- }
- return props.toString();
- }
-
- public boolean setDefaultValue(String name, String value) {
- for (Object name2 : list) {
- PropertyDescription element = (PropertyDescription)name2;
- if (element.getName().equals(name)) {
- element.setDefaultValue(value);
- return true;
- }
- }
- return false;
- }
-
- public PropertyArrayList instanciate() {
- PropertyArrayList props = new PropertyArrayList();
- for (int i = 0; i < list.size(); i++) {
- PropertyDescription pd = list.get(i);
- String propName = pd.getName();
- String propVal = pd.getDefaultValue();
- props.list.add( new Property(propName, propVal));
- }
- return props;
- }
-
-}
diff --git a/source/com/c2kernel/property/PropertyUtility.java b/source/com/c2kernel/property/PropertyUtility.java deleted file mode 100644 index f8e714c..0000000 --- a/source/com/c2kernel/property/PropertyUtility.java +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************
- *
- * $Revision: 1.4 $
- * $Date: 2004/10/21 08:02:26 $
- *
- * Copyright (C) 2001 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-package com.c2kernel.property;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import com.c2kernel.persistency.ClusterStorage;
-import com.c2kernel.persistency.outcome.Outcome;
-import com.c2kernel.process.Gateway;
-import com.c2kernel.utils.CastorHashMap;
-import com.c2kernel.utils.CastorXMLUtility;
-import com.c2kernel.utils.Logger;
-
-
-public class PropertyUtility
-{
- static public String getValue(ArrayList<PropertyDescription> pdlist, String name)
- {
- for (PropertyDescription pd : pdlist) {
- if ( name.equalsIgnoreCase(pd.getName()) )
- return pd.getDefaultValue();
- }
- return null;
- }
-
- static public String getNames(ArrayList<PropertyDescription> pdlist)
- {
- StringBuffer names = new StringBuffer();
- for (PropertyDescription value : pdlist)
- names.append( value.getDefaultValue()).append(" ");
- return names.toString();
- }
-
- static public String getClassIdNames(ArrayList<PropertyDescription> pdlist)
- {
- StringBuffer names = new StringBuffer();
-
- for (Iterator<PropertyDescription> iter = pdlist.iterator(); iter.hasNext();) {
- PropertyDescription pd = iter.next();
- if (pd.getIsClassIdentifier())
- names.append(pd.getName());
- if (iter.hasNext())
- names.append(",");
- }
- return names.toString();
- }
-
-
- static public PropertyDescriptionList getPropertyDescriptionOutcome(int entityKey)
- {
- try
- {
- Outcome outc = (Outcome) Gateway.getStorage().get(entityKey, ClusterStorage.VIEWPOINT+"/PropertyDescription/last/data", null);
- return (PropertyDescriptionList)CastorXMLUtility.unmarshall(outc.getData());
- }
- catch (Exception ex)
- {
- Logger.error(ex);
- return null;
- }
- }
-
- static public CastorHashMap createProperty(PropertyDescriptionList pdList)
- {
- CastorHashMap props = new CastorHashMap();
- for (int i=0; i< pdList.list.size();i++)
- {
- PropertyDescription pd = pdList.list.get(i);
- if (pd.getIsClassIdentifier())
- props.put(pd.getName(),pd.getDefaultValue());
- }
- return props;
- }
-
-}
|
