Coverage Report - org.kuali.rice.ksb.messaging.bam.dao.impl.BAMDAOOjbImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
BAMDAOOjbImpl
0%
0/22
N/A
1
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
 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 org.kuali.rice.ksb.messaging.bam.dao.impl;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import javax.xml.namespace.QName;
 21  
 
 22  
 import org.apache.ojb.broker.query.Criteria;
 23  
 import org.apache.ojb.broker.query.QueryByCriteria;
 24  
 import org.kuali.rice.core.api.reflect.ObjectDefinition;
 25  
 import org.kuali.rice.core.api.reflect.ObjectDefinition;
 26  
 import org.kuali.rice.ksb.messaging.bam.BAMParam;
 27  
 import org.kuali.rice.ksb.messaging.bam.BAMTargetEntry;
 28  
 import org.kuali.rice.ksb.messaging.bam.dao.BAMDAO;
 29  
 import org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport;
 30  
 
 31  
 
 32  0
 public class BAMDAOOjbImpl extends PersistenceBrokerDaoSupport implements BAMDAO {
 33  
 
 34  
         public void clearBAMTables() {
 35  0
                 getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(BAMTargetEntry.class));
 36  0
                 getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(BAMParam.class));
 37  0
         }
 38  
 
 39  
         @SuppressWarnings("unchecked")
 40  
         public List<BAMTargetEntry> getCallsForService(QName serviceName, String methodName) {
 41  0
                 Criteria crit = new Criteria();
 42  0
                 crit.addEqualTo("serviceName", serviceName.toString());
 43  0
                 crit.addEqualTo("methodName", methodName);
 44  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 45  
         }
 46  
 
 47  
         public void save(BAMTargetEntry bamEntry) {
 48  0
                 this.getPersistenceBrokerTemplate().store(bamEntry);
 49  0
         }
 50  
 
 51  
         @SuppressWarnings("unchecked")
 52  
         public List<BAMTargetEntry> getCallsForService(QName serviceName) {
 53  0
                 Criteria crit = new Criteria();
 54  0
                 crit.addEqualTo("serviceName", serviceName.toString());
 55  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 56  
         }
 57  
 
 58  
         @SuppressWarnings("unchecked")
 59  
         public List<BAMTargetEntry> getCallsForRemotedClasses(ObjectDefinition objDef) {
 60  0
                 Criteria crit = new Criteria();
 61  0
                 QName qname = new QName(objDef.getApplicationId(), objDef.getClassName());
 62  0
                 crit.addLike("serviceName", qname.toString() + "%");
 63  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 64  
         }
 65  
 
 66  
         @SuppressWarnings("unchecked")
 67  
         public List<BAMTargetEntry> getCallsForRemotedClasses(ObjectDefinition objDef, String methodName) {
 68  0
                 Criteria crit = new Criteria();
 69  0
                 QName qname = new QName(objDef.getApplicationId(), objDef.getClassName());
 70  0
                 crit.addLike("serviceName", qname.toString() + "%");
 71  0
                 crit.addEqualTo("methodName", methodName);
 72  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 73  
         }
 74  
 }