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 com.fatwire.gst.foundation.facade.assetapi.asset;
18
19 import COM.FutureTense.Interfaces.ICS;
20
21 import com.fatwire.assetapi.data.AssetData;
22 import com.fatwire.gst.foundation.facade.assetapi.AssetMapper;
23
24 /**
25 * This class provides simple access to AssetData. It is intended to be a
26 * one-stop-shop for all read operations on assets.
27 * <p/>
28 * In many cases it returns a {@link ScatteredAsset} for easy access to
29 * AssetData.
30 * <p/>
31 * The object has the same lifecycle as the ICS object, one per request.
32 *
33 * @author Dolf Dijkstra
34 *
35 */
36 public class ScatteredAssetAccessTemplate extends MappedAssetAccessTemplate<ScatteredAsset> {
37 /**
38 * The asset mapper that returned a ScatteredAsset.
39 */
40 private static final AssetMapper<ScatteredAsset> mapper_ = new AssetMapper<ScatteredAsset>() {
41
42 public ScatteredAsset map(final AssetData assetData) {
43 return new ScatteredAsset(assetData);
44 }
45 };
46
47 /**
48 * @param ics
49 */
50 public ScatteredAssetAccessTemplate(final ICS ics) {
51 super(ics, mapper_);
52
53 }
54
55 }