net.krecan.m2_proxy.store
Class ValidatingStoreWrapper

java.lang.Object
  extended by net.krecan.m2_proxy.store.ValidatingStoreWrapper
All Implemented Interfaces:
Repository, Store

public class ValidatingStoreWrapper
extends Object
implements Store

Store wrapper for validating resources. Wraps store and before calling any method on it, validates resources.

Author:
Lukas Krecam

Field Summary
 
Fields inherited from interface net.krecan.m2_proxy.Store
NULL_STORE
 
Constructor Summary
ValidatingStoreWrapper()
           
ValidatingStoreWrapper(Store wrappedStore)
           
ValidatingStoreWrapper(Store wrappedStore, StoreValidator storeValidator)
           
 
Method Summary
 StoreValidator getStoreValidator()
           
 Store getWrappedStore()
           
 Resource loadResource(String resourcePath)
          Loads resource from the store, tests if the resource is valid an than returns it
 void setStoreValidator(StoreValidator storeValidator)
           
 void setWrappedStore(Store wrappedStore)
           
 Resource storeResource(Resource resource)
          Stores resource to the store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingStoreWrapper

public ValidatingStoreWrapper(Store wrappedStore,
                              StoreValidator storeValidator)

ValidatingStoreWrapper

public ValidatingStoreWrapper(Store wrappedStore)

ValidatingStoreWrapper

public ValidatingStoreWrapper()
Method Detail

getStoreValidator

public StoreValidator getStoreValidator()

setStoreValidator

public void setStoreValidator(StoreValidator storeValidator)

getWrappedStore

public Store getWrappedStore()

setWrappedStore

public void setWrappedStore(Store wrappedStore)

loadResource

public Resource loadResource(String resourcePath)
                      throws IOException
Loads resource from the store, tests if the resource is valid an than returns it

Specified by:
loadResource in interface Repository
Returns:
returns resource
Throws:
IOException

storeResource

public Resource storeResource(Resource resource)
                       throws IOException
Description copied from interface: Store
Stores resource to the store.

Specified by:
storeResource in interface Store
Returns:
resource that can be read
Throws:
IOException


Copyright © 2006 null. All Rights Reserved.