1 /* 2 * Copyright 2008 FatWire Corporation. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package tools.gsf.facade.assetapi.asset; 18 19 import COM.FutureTense.Interfaces.ICS; 20 import com.fatwire.assetapi.data.AssetData; 21 import tools.gsf.facade.assetapi.AssetMapper; 22 23 /** 24 * This class provides simple access to AssetData. It is intended to be a 25 * one-stop-shop for all read operations on assets. 26 * <p> 27 * In many cases it returns a {@link ScatteredAsset} for easy access to 28 * AssetData. 29 * <p> 30 * The object has the same lifecycle as the ICS object, one per request. 31 * 32 * @author Dolf Dijkstra 33 */ 34 public class ScatteredAssetAccessTemplate extends MappedAssetAccessTemplate<ScatteredAsset> { 35 /** 36 * The asset mapper that returned a ScatteredAsset. 37 */ 38 private static final AssetMapper<ScatteredAsset> mapper_ = new AssetMapper<ScatteredAsset>() { 39 40 public ScatteredAsset map(final AssetData assetData) { 41 return new ScatteredAsset(assetData); 42 } 43 }; 44 45 /** 46 * @param ics Content Server context object 47 */ 48 public ScatteredAssetAccessTemplate(final ICS ics) { 49 super(ics, mapper_); 50 51 } 52 53 }