org.sonatype.aether.impl
Class UpdateCheck<T,E extends RepositoryException>

java.lang.Object
  extended by org.sonatype.aether.impl.UpdateCheck<T,E>

public class UpdateCheck<T,E extends RepositoryException>
extends java.lang.Object

A request to check if an update from a remote repository is needed.

Author:
Benjamin Bentmann
See Also:
UpdateCheckManager

Constructor Summary
UpdateCheck()
           
 
Method Summary
 RemoteRepository getAuthoritativeRepository()
          Gets the repository which ultimately hosts the metadata to update.
 E getException()
          Gets the exception if an exception occured during the check, null otherwise.
 java.io.File getFile()
          Returns the local file of the item.
 T getItem()
          Gets the item of the check.
 long getLocalLastUpdated()
          Gets the last-modified timestamp of the corresponding item produced by a local build.
 java.lang.String getPolicy()
          Gets the policy to use for the check.
 RemoteRepository getRepository()
          Gets the repository from which a potential update/download will performed.
 boolean isRequired()
          Gets the result of a check, denoting whether the remote repository should be checked for updates.
 UpdateCheck<T,E> setAuthoritativeRepository(RemoteRepository authoritativeRepository)
          Sets the repository which ultimately hosts the metadata to update.
 UpdateCheck<T,E> setException(E exception)
          Sets the exception for this update check.
 UpdateCheck<T,E> setFile(java.io.File file)
          Sets the local file of the item.
 UpdateCheck<T,E> setItem(T item)
          Sets the item of the check.
 UpdateCheck<T,E> setLocalLastUpdated(long localLastUpdated)
          Sets the last-modified timestamp of the corresponding item produced by a local build.
 UpdateCheck<T,E> setPolicy(java.lang.String policy)
          Sets the policy to use for the check.
 UpdateCheck<T,E> setRepository(RemoteRepository repository)
          Sets the repository from which a potential update/download will performed.
 UpdateCheck<T,E> setRequired(boolean required)
          Sets the result of an update check.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateCheck

public UpdateCheck()
Method Detail

getLocalLastUpdated

public long getLocalLastUpdated()
Gets the last-modified timestamp of the corresponding item produced by a local build. If non-zero, a remote update will be surpressed if the local item is up-to-date, even if the remote item has not been cached locally.

Returns:
The last-modified timestamp of the corresponding item produced by a local build or 0 to ignore any local item.

setLocalLastUpdated

public UpdateCheck<T,E> setLocalLastUpdated(long localLastUpdated)
Sets the last-modified timestamp of the corresponding item produced by a local build. If non-zero, a remote update will be surpressed if the local item is up-to-date, even if the remote item has not been cached locally.

Parameters:
localLastUpdated - The last-modified timestamp of the corresponding item produced by a local build or 0 to ignore any local item.
Returns:
This object for chaining.

getItem

public T getItem()
Gets the item of the check.

Returns:
The item of the check, never null.

setItem

public UpdateCheck<T,E> setItem(T item)
Sets the item of the check.

Parameters:
item - The item of the check, must not be null.
Returns:
This object for chaining.

getFile

public java.io.File getFile()
Returns the local file of the item.

Returns:
The local file of the item.

setFile

public UpdateCheck<T,E> setFile(java.io.File file)
Sets the local file of the item.

Parameters:
file - The file of the item, never null .
Returns:
This object for chaining.

getPolicy

public java.lang.String getPolicy()
Gets the policy to use for the check.

Returns:
The policy to use for the check.
See Also:
RepositoryPolicy

setPolicy

public UpdateCheck<T,E> setPolicy(java.lang.String policy)
Sets the policy to use for the check.

Parameters:
policy - The policy to use for the check, may be null.
Returns:
This object for chaining.
See Also:
RepositoryPolicy

getRepository

public RemoteRepository getRepository()
Gets the repository from which a potential update/download will performed.

Returns:
The repository to use for the check.

setRepository

public UpdateCheck<T,E> setRepository(RemoteRepository repository)
Sets the repository from which a potential update/download will performed.

Parameters:
repository - The repository to use for the check, must not be null.
Returns:
This object for chaining.

getAuthoritativeRepository

public RemoteRepository getAuthoritativeRepository()
Gets the repository which ultimately hosts the metadata to update. This will be different from the repository given by getRepository() in case the latter denotes a repository manager.

Returns:
The actual repository hosting the authoritative copy of the metadata to update, never null for a metadata update check.

setAuthoritativeRepository

public UpdateCheck<T,E> setAuthoritativeRepository(RemoteRepository authoritativeRepository)
Sets the repository which ultimately hosts the metadata to update. This will be different from the repository given by getRepository() in case the latter denotes a repository manager.

Parameters:
authoritativeRepository - The actual repository hosting the authoritative copy of the metadata to update, must not be null for a metadata update check.
Returns:
This object for chaining.

isRequired

public boolean isRequired()
Gets the result of a check, denoting whether the remote repository should be checked for updates.

Returns:
The result of a check.

setRequired

public UpdateCheck<T,E> setRequired(boolean required)
Sets the result of an update check.

Parameters:
required - the result of an update check.
Returns:
This object for chaining.

getException

public E getException()
Gets the exception if an exception occured during the check, null otherwise.

Returns:
The occured exception, may be null.

setException

public UpdateCheck<T,E> setException(E exception)
Sets the exception for this update check.

Parameters:
exception - The exception for this update check, may be null.
Returns:
This object for chaining.


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.