lumis.portal.file
Class FileDaoJdbc

Package class diagram package FileDaoJdbc
java.lang.Object
  extended by lumis.portal.file.FileDaoJdbc
All Implemented Interfaces:
IFileDao

public class FileDaoJdbc
extends Object
implements IFileDao

File storing object

Since:
4.0.0

Constructor Summary
FileDaoJdbc()
           
 
Method Summary
 void add(FileConfig fileConfig, ITransaction transaction)
          Add the file.
 void delete(String fileId, ITransaction transaction)
          Delete the file.
 FileConfig findByFullPath(String fullPathCriteria, ITransaction transaction)
          Find the file by the full path.
 FileConfig get(String fileId, ITransaction transaction)
          Get the file.
 Collection<String> getFileIds(ITransaction transaction)
          Return all fileIds from lum_file table.
 String getIdByItemInfo(String itemId, String serviceInstanceId, String sourceId, String fieldId, ITransaction transaction)
          Get the fileId refered by a content with the given ids.
 Collection<String> getIdsByFilesId(String filesId, ITransaction transaction)
          Return the file ids that belongs to the files with the given id.
 Collection<String> getIdsByFilesIdAndType(String filesId, int type, ITransaction transaction)
          Return the file ids that belongs to the files with the given id and with the given type.
 Collection<String> getIdsByServiceInstanceId(String serviceInstanceId, ITransaction transaction)
          Return the file ids that belongs to the specified service instance.
 int getNumberOfServiceInstanceFiles(String serviceInstanceId, ITransaction transaction)
          Returns the number of files for a service instance.
 void update(FileConfig fileConfig, ITransaction transaction)
          Updates the file's information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDaoJdbc

public FileDaoJdbc()
Method Detail

get

public FileConfig get(String fileId,
                      ITransaction transaction)
               throws PortalException
Description copied from interface: IFileDao
Get the file.

Specified by:
get in interface IFileDao
Returns:
Throws:
DaoException
PortalException

findByFullPath

public FileConfig findByFullPath(String fullPathCriteria,
                                 ITransaction transaction)
                          throws PortalException
Description copied from interface: IFileDao
Find the file by the full path.

Specified by:
findByFullPath in interface IFileDao
Parameters:
fullPathCriteria - the full path.
transaction - the transaction to be used.
Returns:
an instance of FileConfig.
Throws:
PortalException - if a database error occur.

add

public void add(FileConfig fileConfig,
                ITransaction transaction)
         throws PortalException
Description copied from interface: IFileDao
Add the file.

Specified by:
add in interface IFileDao
Throws:
PortalException

delete

public void delete(String fileId,
                   ITransaction transaction)
            throws PortalException
Description copied from interface: IFileDao
Delete the file.

Specified by:
delete in interface IFileDao
Throws:
DaoException
PortalException

update

public void update(FileConfig fileConfig,
                   ITransaction transaction)
            throws DaoException,
                   PortalException
Description copied from interface: IFileDao
Updates the file's information.

Specified by:
update in interface IFileDao
Throws:
PortalException
DaoException

getIdsByFilesIdAndType

public Collection<String> getIdsByFilesIdAndType(String filesId,
                                                 int type,
                                                 ITransaction transaction)
                                          throws PortalException
Description copied from interface: IFileDao
Return the file ids that belongs to the files with the given id and with the given type.

Specified by:
getIdsByFilesIdAndType in interface IFileDao
Parameters:
filesId - the id of the files.
type - the type the returned files must have. The type value must be one of the TYPE constants available in FileConfig.
transaction - the transaction for persistence access.
Returns:
the file ids.
Throws:
PortalException

getIdsByFilesId

public Collection<String> getIdsByFilesId(String filesId,
                                          ITransaction transaction)
                                   throws PortalException
Description copied from interface: IFileDao
Return the file ids that belongs to the files with the given id.

Specified by:
getIdsByFilesId in interface IFileDao
Parameters:
filesId - the id of the files.
transaction - the transaction for persistence access.
Returns:
the file ids.
Throws:
PortalException

getFileIds

public Collection<String> getFileIds(ITransaction transaction)
                              throws PortalException
Return all fileIds from lum_file table.

Parameters:
transaction - the transaction for select query access
Returns:
List of fileIds
Throws:
PortalException - any error occurs
Since:
6.0.0

getIdsByServiceInstanceId

public Collection<String> getIdsByServiceInstanceId(String serviceInstanceId,
                                                    ITransaction transaction)
                                             throws PortalException
Description copied from interface: IFileDao
Return the file ids that belongs to the specified service instance.

Specified by:
getIdsByServiceInstanceId in interface IFileDao
Parameters:
serviceInstanceId - the service instance's id.
transaction - the transaction for persistence access.
Returns:
the file ids.
Throws:
PortalException

getIdByItemInfo

public String getIdByItemInfo(String itemId,
                              String serviceInstanceId,
                              String sourceId,
                              String fieldId,
                              ITransaction transaction)
                       throws PortalException
Description copied from interface: IFileDao
Get the fileId refered by a content with the given ids.

Specified by:
getIdByItemInfo in interface IFileDao
Throws:
PortalException

getNumberOfServiceInstanceFiles

public int getNumberOfServiceInstanceFiles(String serviceInstanceId,
                                           ITransaction transaction)
                                    throws PortalException
Description copied from interface: IFileDao
Returns the number of files for a service instance.

Specified by:
getNumberOfServiceInstanceFiles in interface IFileDao
Parameters:
serviceInstanceId - the service instance identifier.
transaction - the transaction for persistence access.
Returns:
the number of files for the specified service instance.
Throws:
PortalException


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.