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