com.trendmicro.grid.acl.ds.jpa
Class JpaSourceRepository

java.lang.Object
  extended by com.trendmicro.grid.acl.ds.jpa.JpaSourceRepository
All Implemented Interfaces:
com.trendmicro.grid.acl.ds.Repository, com.trendmicro.grid.acl.ds.SourceRepository

@Repository
@Transactional(readOnly=true)
public class JpaSourceRepository
extends Object
implements com.trendmicro.grid.acl.ds.SourceRepository

Implements SourceRepository using JPA.

Version:
1.0
Author:
juergen_kellerer, 2010-06-01

Constructor Summary
JpaSourceRepository()
           
 
Method Summary
 com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier createIdentifier(URI remoteURI, URI internalURI)
           
 com.trendmicro.grid.acl.ds.datatypes.SharedSource createSource(URI remoteURI, URI internalURI, com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation, com.trendmicro.grid.acl.metadata.Metadata metadata)
           
static int getPageSize()
           
 com.trendmicro.grid.acl.l0.datatypes.FileIdentiferListPage getReferencedFiles(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier, int pageNumber)
           
 com.trendmicro.grid.acl.l0.datatypes.NameListPage getReferencedPackages(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier, int pageNumber)
           
 com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getReferencingSources(com.trendmicro.grid.acl.l0.datatypes.FileIdentifier file, int pageNumber)
           
 JpaSource getSource(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier)
          Returns a modifyable source instance or 'null' if no source existis under the id.
 Collection<com.trendmicro.grid.acl.ds.datatypes.SharedSourceInformation> getSourceInformationList(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
           
 JpaSource getSourceReference(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier)
          Returns a lightweight reference to the source of 'null' if the source doesn't exist.
 Collection<com.trendmicro.grid.acl.ds.datatypes.SharedSource> getSources(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
           
 com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getSourcesOfDomainInRange(String domainName, Date modifiedFromDate, Date modifiedToDate, int pageNumber)
           
protected  void referenceFilesFromSources(Collection<JpaFileDetails> fileReferences, Collection<JpaSource> sourceReferences)
          Links (references) the given files with all given sources.
 void setInternalURI(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier, URI internalURI)
           
static void setPageSize(int pageSize)
           
 com.trendmicro.grid.acl.ds.datatypes.SharedSource updateSource(com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation, com.trendmicro.grid.acl.metadata.Metadata metadata)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaSourceRepository

public JpaSourceRepository()
Method Detail

getPageSize

public static int getPageSize()

setPageSize

public static void setPageSize(int pageSize)

createIdentifier

public com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier createIdentifier(URI remoteURI,
                                                                              URI internalURI)
Specified by:
createIdentifier in interface com.trendmicro.grid.acl.ds.SourceRepository

referenceFilesFromSources

@Transactional(readOnly=false)
protected void referenceFilesFromSources(Collection<JpaFileDetails> fileReferences,
                                                       Collection<JpaSource> sourceReferences)
Links (references) the given files with all given sources.

Parameters:
fileReferences - the file references that should get references from the given sources.
sourceReferences - the source references to link all files with.

getReferencedFiles

public com.trendmicro.grid.acl.l0.datatypes.FileIdentiferListPage getReferencedFiles(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier,
                                                                                     int pageNumber)
Specified by:
getReferencedFiles in interface com.trendmicro.grid.acl.ds.SourceRepository

getReferencedPackages

public com.trendmicro.grid.acl.l0.datatypes.NameListPage getReferencedPackages(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier,
                                                                               int pageNumber)
Specified by:
getReferencedPackages in interface com.trendmicro.grid.acl.ds.SourceRepository

getReferencingSources

public com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getReferencingSources(com.trendmicro.grid.acl.l0.datatypes.FileIdentifier file,
                                                                                          int pageNumber)
Specified by:
getReferencingSources in interface com.trendmicro.grid.acl.ds.SourceRepository

getSourcesOfDomainInRange

public com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getSourcesOfDomainInRange(String domainName,
                                                                                              Date modifiedFromDate,
                                                                                              Date modifiedToDate,
                                                                                              int pageNumber)
Specified by:
getSourcesOfDomainInRange in interface com.trendmicro.grid.acl.ds.SourceRepository

getSourceInformationList

public Collection<com.trendmicro.grid.acl.ds.datatypes.SharedSourceInformation> getSourceInformationList(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
Specified by:
getSourceInformationList in interface com.trendmicro.grid.acl.ds.SourceRepository

getSources

public Collection<com.trendmicro.grid.acl.ds.datatypes.SharedSource> getSources(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
Specified by:
getSources in interface com.trendmicro.grid.acl.ds.SourceRepository

getSource

public JpaSource getSource(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier)
Returns a modifyable source instance or 'null' if no source existis under the id.

Parameters:
identifier - the identifier of the source.
Returns:
a modifyable source instance or 'null' if no source existis under the id.

getSourceReference

public JpaSource getSourceReference(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier)
Returns a lightweight reference to the source of 'null' if the source doesn't exist.

Parameters:
identifier - the identifier of the source.
Returns:
a lightweight reference to the source of 'null' if the source doesn't exist.

createSource

@Transactional(readOnly=false)
public com.trendmicro.grid.acl.ds.datatypes.SharedSource createSource(URI remoteURI,
                                                                                    URI internalURI,
                                                                                    com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation,
                                                                                    com.trendmicro.grid.acl.metadata.Metadata metadata)
Specified by:
createSource in interface com.trendmicro.grid.acl.ds.SourceRepository

updateSource

@Transactional(readOnly=false)
public com.trendmicro.grid.acl.ds.datatypes.SharedSource updateSource(com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation,
                                                                                    com.trendmicro.grid.acl.metadata.Metadata metadata)
Specified by:
updateSource in interface com.trendmicro.grid.acl.ds.SourceRepository

setInternalURI

@Transactional(readOnly=false)
public void setInternalURI(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier,
                                         URI internalURI)
                    throws IllegalStateException
Specified by:
setInternalURI in interface com.trendmicro.grid.acl.ds.SourceRepository
Throws:
IllegalStateException