diff options
| author | Selvam <selvam@gluster.com> | 2011-04-15 19:20:47 +0530 |
|---|---|---|
| committer | Selvam <selvam@gluster.com> | 2011-04-15 19:20:47 +0530 |
| commit | bfbbdb3b5b01d6369cc4df1bea861cb105b4c2bc (patch) | |
| tree | b07f28f9798af85987170031aeca65381f883c04 /src/com.gluster.storage.management.client | |
| parent | 70efe296ed8565a76dc0c9ff2982e9d8f88efc67 (diff) | |
| parent | c2201ef6fbbb50c3d2d362f5b4a0d3986571e5aa (diff) | |
Merge branch 'volume-property'
Conflicts:
src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java
Diffstat (limited to 'src/com.gluster.storage.management.client')
| -rw-r--r-- | src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/GlusterDataModelManager.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/GlusterDataModelManager.java b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/GlusterDataModelManager.java index 17afeb0c..018ab75f 100644 --- a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/GlusterDataModelManager.java +++ b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/GlusterDataModelManager.java @@ -397,4 +397,28 @@ public class GlusterDataModelManager { public List<VolumeOptionInfo> getVolumeOptionsDefaults() { return volumeOptionsDefaults; } + + public String getVolumeOptionDefaultValue(String optionKey) { + for(VolumeOptionInfo info : volumeOptionsDefaults) { + if(info.getName().equals(optionKey)) { + return info.getDefaultValue(); + } + } + throw new GlusterRuntimeException("Invalid option key [" + optionKey + + "] passed to GlusterDataModelManager#getVolumeOptionDefaultValue"); + } + + public void setAccessControlList(Volume volume, String accessControlList) { + volume.setAccessControlList(accessControlList); + setVolumeOption(volume, getOptionEntry(volume, Volume.OPTION_AUTH_ALLOW)); + } + + private Entry<String, String> getOptionEntry(Volume volume, String optionKey) { + for(Entry entry : volume.getOptions().entrySet()) { + if(entry.getKey().equals(optionKey)) { + return entry; + } + } + throw new GlusterRuntimeException("Couldn't find entry for option [" + optionKey + "] on volume [" + volume.getName()); + } } |
