com.trendmicro.grid.acl.ds
Interface SourceRepository

All Superinterfaces:
Repository

public interface SourceRepository
extends Repository

Defines a repository of sources for content stored inside the GRID.

Version:
1.0
Author:
juergen_kellerer, 2010-05-07

Method Summary
 com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier createIdentifier(URI remoteURI, URI internalURI)
          Creates a plain identifier for the given URL.
 SharedSource createSource(URI remoteURI, URI internalURI, com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation, com.trendmicro.grid.acl.metadata.Metadata metadata)
          Creates the source with the given Metadata and returns the created source.
 com.trendmicro.grid.acl.l0.datatypes.FileIdentiferListPage getReferencedFiles(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier, int pageNumber)
          Returns all files that are referenced by the specified source.
 com.trendmicro.grid.acl.l0.datatypes.NameListPage getReferencedPackages(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier, int pageNumber)
          Returns all package names that are referenced by the specified source.
 com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getReferencingSources(com.trendmicro.grid.acl.l0.datatypes.FileIdentifier file, int pageNumber)
          Returns the source identifiers of all sources that are known for the given file.
 Collection<SharedSourceInformation> getSourceInformationList(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
          Returns the lightweight source-information list for the given source identifiers.
 Collection<SharedSource> getSources(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
          Returns the sources for the given source identifier.
 com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getSourcesOfDomainInRange(String domainName, Date modifiedFromDate, Date modifiedToDate, int pageNumber)
          Returns the source identifiers of all sources that belong to a certain domain and were last modified in a specifeid time range.
 void setInternalURI(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier, URI internalURI)
          Sets the internal URI on a source with a non-null remote URI.
 SharedSource updateSource(com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation, com.trendmicro.grid.acl.metadata.Metadata metadata)
          Updates the remote source with the given Metadata and returns the updated source.
 

Method Detail

createIdentifier

com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier createIdentifier(URI remoteURI,
                                                                       URI internalURI)
Creates a plain identifier for the given URL.

Note: This identifier may be used to query a source but there's no guarantee that the identifier returned by this method refers to an existing source. Therefore it cannot be used with methods that expect an identifier of a previously created source.

Parameters:
remoteURI - The remote URL to create the identifier for.
internalURI - The internal URL to create the identifier for.
Returns:
A identifier for the given URL.

getReferencedFiles

com.trendmicro.grid.acl.l0.datatypes.FileIdentiferListPage getReferencedFiles(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier,
                                                                              int pageNumber)
Returns all files that are referenced by the specified source.

Parameters:
sourceIdentifier - the identifier of the source to query.
pageNumber - The number of the list page to return, starting from 0 for the first chunk.
Returns:
all files that are referenced by the specified source.

getReferencedPackages

com.trendmicro.grid.acl.l0.datatypes.NameListPage getReferencedPackages(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier sourceIdentifier,
                                                                        int pageNumber)
Returns all package names that are referenced by the specified source.

Parameters:
sourceIdentifier - the identifier of the source to query.
pageNumber - The number of the list page to return, starting from 0 for the first chunk.
Returns:
all package names that are referenced by the specified source.

getReferencingSources

com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getReferencingSources(com.trendmicro.grid.acl.l0.datatypes.FileIdentifier file,
                                                                                   int pageNumber)
Returns the source identifiers of all sources that are known for the given file.

Note: Beginning with GACL 1.2, the returned sources are ordered by last modification date in descending order (newest comes first).

Parameters:
file - The file to return the sources for.
pageNumber - The number of the list page to return, starting from 0 for the first chunk.
Returns:
A chunk of sources or 'null' if no chunk exists under the given number.

getSourcesOfDomainInRange

com.trendmicro.grid.acl.l0.datatypes.SourceIdentiferListPage getSourcesOfDomainInRange(String domainName,
                                                                                       Date modifiedFromDate,
                                                                                       Date modifiedToDate,
                                                                                       int pageNumber)
Returns the source identifiers of all sources that belong to a certain domain and were last modified in a specifeid time range.

Parameters:
domainName - The domain to return the sources for.
modifiedFromDate - The inclusive lower bound for the last-modified date value or 'null' if there is no lower bound.
modifiedToDate - The exclusive upper bound for the last-modified date value or 'null' if there is no upper bound.
pageNumber - The number of the list page to return, starting from 0 for the first chunk.
Returns:
A chunk of sources or 'null' if no chunk exists under the given number.

getSourceInformationList

Collection<SharedSourceInformation> getSourceInformationList(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
Returns the lightweight source-information list for the given source identifiers.

Parameters:
identifiers - The identifiers of the sources.
Returns:
The source-information list for the given identifiers or 'null' if a source does not yet exist.

getSources

Collection<SharedSource> getSources(Collection<com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier> identifiers)
Returns the sources for the given source identifier.

Parameters:
identifiers - The identifiers of the sources.
Returns:
The sources for the given identifiers or 'null' if a source does not yet exist.

createSource

SharedSource createSource(URI remoteURI,
                          URI internalURI,
                          com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation,
                          com.trendmicro.grid.acl.metadata.Metadata metadata)
Creates the source with the given Metadata and returns the created source.

Parameters:
remoteURI - The remote URI.
internalURI - The internal URI.
sourceInformation - The source information of the source to create.
metadata - The metadata to store with the source.
Returns:
the created source or 'null' if the source existed already.

updateSource

SharedSource updateSource(com.trendmicro.grid.acl.l0.datatypes.SourceInformation sourceInformation,
                          com.trendmicro.grid.acl.metadata.Metadata metadata)
Updates the remote source with the given Metadata and returns the updated source.

Parameters:
sourceInformation - The source information of the source to update.
metadata - The metadata to store with the source.
Returns:
the updated source or 'null' if the source did not exist.

setInternalURI

void setInternalURI(com.trendmicro.grid.acl.l0.datatypes.SourceIdentifier identifier,
                    URI internalURI)
                    throws IllegalStateException
Sets the internal URI on a source with a non-null remote URI.

Parameters:
identifier - The source to update set the internal URI for.
internalURI - The internal URI to set.
Throws:
IllegalStateException - In case of the source, idenfitied by the id does not define a remote URI.