summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/property/Property.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2013-12-12 14:13:36 +0100
committerAndrew Branson <andrew.branson@cern.ch>2013-12-12 14:13:36 +0100
commit428d828ca640d1348979f9982d1c0bc0a489a3b4 (patch)
treea40b0f8fa46942f5e9d4c805a4df724ee5a5aa6b /src/main/java/com/c2kernel/property/Property.java
parentd5d65f58e69424d898f88e8304a49f147d4036f6 (diff)
Properties preserve and respect the PropertyDescription 'isMutable'
property. This setting prevents the WriteProperty predefined step from changing the property value when isMutable is false. WriteProperty also requires the selected property to already exist - they should be created either during Item instantiation or using AddC2KObject. LDAPPropertyManager prepends the Property name in its entries with ! if they are non mutable. Various places around the kernel that create properties now set the mutable field. Fixes #150
Diffstat (limited to 'src/main/java/com/c2kernel/property/Property.java')
-rw-r--r--src/main/java/com/c2kernel/property/Property.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/com/c2kernel/property/Property.java b/src/main/java/com/c2kernel/property/Property.java
index 3022cc5..6b7c4ee 100644
--- a/src/main/java/com/c2kernel/property/Property.java
+++ b/src/main/java/com/c2kernel/property/Property.java
@@ -17,6 +17,7 @@ public class Property implements C2KLocalObject
{
private String mName;
private String mValue;
+ private boolean mMutable = true;
/**************************************************************************
@@ -24,18 +25,17 @@ public class Property implements C2KLocalObject
**************************************************************************/
public Property()
{
- setName( "" );
- setValue( "" );
}
/**************************************************************************
*
**************************************************************************/
- public Property( String name, String value )
+ public Property( String name, String value, boolean mutable )
{
setName( name );
setValue( value );
+ setMutable( mutable );
}
/**************************************************************************
@@ -48,7 +48,17 @@ public class Property implements C2KLocalObject
}
- /**************************************************************************
+ public boolean isMutable() {
+ return mMutable;
+ }
+
+
+ public void setMutable(boolean mMutable) {
+ this.mMutable = mMutable;
+ }
+
+
+/**************************************************************************
*
**************************************************************************/
@Override