1 23 package org.apache.slide.store.mem; 24 25 import org.apache.slide.common.ServiceAccessException; 26 import org.apache.slide.common.Uri; 27 import org.apache.slide.content.NodeRevisionDescriptors; 28 import org.apache.slide.content.RevisionDescriptorNotFoundException; 29 import org.apache.slide.store.RevisionDescriptorsStore; 30 31 32 34 public class TransientDescriptorsStore extends AbstractTransientStore implements 35 RevisionDescriptorsStore 36 { 37 39 public NodeRevisionDescriptors retrieveRevisionDescriptors(Uri uri) 40 throws ServiceAccessException, RevisionDescriptorNotFoundException 41 { 42 NodeRevisionDescriptors descriptors = 43 (NodeRevisionDescriptors)get(uri.toString()); 44 if (descriptors != null) { 45 return descriptors; 46 } else { 47 throw new RevisionDescriptorNotFoundException(uri.toString()); 48 } 49 } 50 51 public void createRevisionDescriptors(Uri uri, 52 NodeRevisionDescriptors revisionDescriptors) 53 throws ServiceAccessException 54 { 55 put(uri.toString(), revisionDescriptors); 56 } 57 58 public void storeRevisionDescriptors(Uri uri, 59 NodeRevisionDescriptors revisionDescriptors) 60 throws ServiceAccessException, RevisionDescriptorNotFoundException 61 { 62 NodeRevisionDescriptors descriptors = 63 (NodeRevisionDescriptors)get(uri.toString()); 64 if (descriptors != null) { 65 put(uri.toString(), revisionDescriptors); 66 } else { 67 throw new RevisionDescriptorNotFoundException(uri.toString()); 68 } 69 } 70 71 public void removeRevisionDescriptors(Uri uri) throws ServiceAccessException 72 { 73 remove(uri.toString()); 74 } 75 } 76 | Popular Tags |