View Javadoc

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  package com.fatwire.gst.foundation.facade.assetapi.listener;
17  
18  import COM.FutureTense.Interfaces.ICS;
19  
20  import com.fatwire.assetapi.data.AssetId;
21  import com.fatwire.gst.foundation.facade.install.AssetListenerInstall;
22  import com.openmarket.basic.event.AbstractAssetEventListener;
23  
24  import org.apache.commons.logging.Log;
25  import org.apache.commons.logging.LogFactory;
26  
27  public class EventPrintAssetListener extends AbstractAssetEventListener {
28      private static final Log LOG = LogFactory.getLog(EventPrintAssetListener.class.getPackage().getName());
29  
30      @Override
31      public void assetAdded(final AssetId id) {
32          LOG.info("Asset added " + id + " (" + Thread.currentThread().getName() + ")");
33      }
34  
35      @Override
36      public void assetDeleted(final AssetId id) {
37          LOG.info("Asset deleted " + id + " (" + Thread.currentThread().getName() + ")");
38      }
39  
40      @Override
41      public void assetUpdated(final AssetId id) {
42          LOG.info("Asset updated " + id + " (" + Thread.currentThread().getName() + ")");
43      }
44  
45      public void install(final ICS ics) {
46          AssetListenerInstall.register(ics, EventPrintAssetListener.class.getName(), true);
47      }
48  
49      @Override
50      public void init(ICS arg0) {
51          // TODO Auto-generated method stub
52          
53      }
54  
55  }