org.alfresco.repo.domain.mimetype
Class AbstractMimetypeDAOImpl

java.lang.Object
  extended by org.alfresco.repo.domain.mimetype.AbstractMimetypeDAOImpl
All Implemented Interfaces:
MimetypeDAO
Direct Known Subclasses:
MimetypeDAOImpl

public abstract class AbstractMimetypeDAOImpl
extends java.lang.Object
implements MimetypeDAO

Abstract implementation for Mimetype DAO.

This provides basic services such as caching, but defers to the underlying implementation for CRUD operations.

Since:
3.2

Constructor Summary
AbstractMimetypeDAOImpl()
           
 
Method Summary
protected abstract  MimetypeEntity createMimetypeEntity(java.lang.String mimetype)
           
 org.alfresco.util.Pair getMimetype(java.lang.Long id)
           
 org.alfresco.util.Pair getMimetype(java.lang.String mimetype)
           
protected abstract  MimetypeEntity getMimetypeEntity(java.lang.Long id)
           
protected abstract  MimetypeEntity getMimetypeEntity(java.lang.String mimetype)
           
 org.alfresco.util.Pair getOrCreateMimetype(java.lang.String mimetype)
          Retrieve an existing mimetype or create a new one if it doesn't exist.
 void setMimetypeEntityCache(SimpleCache mimetypeEntityCache)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMimetypeDAOImpl

public AbstractMimetypeDAOImpl()
Method Detail

setMimetypeEntityCache

public void setMimetypeEntityCache(SimpleCache mimetypeEntityCache)
Parameters:
mimetypeEntityCache - the cache of IDs to mimetypes

getMimetype

public org.alfresco.util.Pair getMimetype(java.lang.Long id)
Specified by:
getMimetype in interface MimetypeDAO
Parameters:
id - the unique ID of the entity
Returns:
the Mimetype pair (id, mimetype) (never null)

getMimetype

public org.alfresco.util.Pair getMimetype(java.lang.String mimetype)
Specified by:
getMimetype in interface MimetypeDAO
Parameters:
mimetype - the Mimetype to query for
Returns:
the Mimetype pair (id, mimetype) or null if it doesn't exist

getOrCreateMimetype

public org.alfresco.util.Pair getOrCreateMimetype(java.lang.String mimetype)
Description copied from interface: MimetypeDAO
Retrieve an existing mimetype or create a new one if it doesn't exist.

Specified by:
getOrCreateMimetype in interface MimetypeDAO
Parameters:
mimetype - the Mimetype
Returns:
the Mimetype pair (id, mimetype) (never null)

getMimetypeEntity

protected abstract MimetypeEntity getMimetypeEntity(java.lang.Long id)
Parameters:
id - the ID of the mimetype entity
Returns:
Return the entity or null if it doesn't exist

getMimetypeEntity

protected abstract MimetypeEntity getMimetypeEntity(java.lang.String mimetype)

createMimetypeEntity

protected abstract MimetypeEntity createMimetypeEntity(java.lang.String mimetype)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.