View Javadoc

1   /*
2    * Copyright 2000-2005 The Apache Software Foundation.
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 org.apache.portals.graffito.jcr.persistence.objectconverter.impl;
17  
18  import javax.jcr.Node;
19  import javax.jcr.Session;
20  
21  import org.apache.commons.logging.Log;
22  import org.apache.commons.logging.LogFactory;
23  import org.apache.portals.graffito.jcr.exception.JcrMappingException;
24  import org.apache.portals.graffito.jcr.exception.PersistenceException;
25  import org.apache.portals.graffito.jcr.exception.RepositoryException;
26  import org.apache.portals.graffito.jcr.mapper.model.BeanDescriptor;
27  import org.apache.portals.graffito.jcr.persistence.objectconverter.BeanConverter;
28  import org.apache.portals.graffito.jcr.persistence.objectconverter.ObjectConverter;
29  
30  public abstract class AbstractBeanConverterImpl implements BeanConverter {
31  
32  	protected  ObjectConverter objectConverter;
33  	
34  	public AbstractBeanConverterImpl(ObjectConverter objectConverter)
35  	{
36  		this.objectConverter = objectConverter;
37  	}
38  	private final static Log log = LogFactory.getLog(AbstractBeanConverterImpl.class);
39  	
40      public abstract void insert(Session session, Node parentNode, BeanDescriptor descriptor, Object object)
41  			throws PersistenceException, RepositoryException, 	JcrMappingException;
42  
43  	public abstract  void update(Session session, Node parentNode, 	BeanDescriptor descriptor, Object object)
44  			throws PersistenceException, RepositoryException,	JcrMappingException;
45  	
46  	public abstract Object getObject(Session session, Node parentNode,BeanDescriptor descriptor, Class beanClass)
47  			throws PersistenceException, RepositoryException,JcrMappingException ;
48  
49  	public abstract void remove(Session session, Node parentNode,	BeanDescriptor descriptor)
50  	          throws PersistenceException,	RepositoryException, JcrMappingException ;
51  }