com.android.repository.api
Class SimpleRepositorySource

java.lang.Object
  extended by com.android.repository.api.SimpleRepositorySource
All Implemented Interfaces:
RepositorySource

public class SimpleRepositorySource
extends java.lang.Object
implements RepositorySource

A simple RepositorySource.


Constructor Summary
SimpleRepositorySource(java.lang.String url, java.lang.String displayName, boolean enabled, java.util.Collection<SchemaModule> allowedModules, RepositorySourceProvider provider)
          Constructor
 
Method Summary
 java.lang.String getDisplayName()
           
 java.lang.String getFetchError()
          Gets the error (if any) encountered when fetching content from this source.
 java.util.Collection<SchemaModule> getPermittedModules()
          Gets the SchemaModules that are allowed to be used to parse XML from this source.
 RepositorySourceProvider getProvider()
           
 java.lang.String getUrl()
           
 boolean isEnabled()
           
 void setEnabled(boolean enabled)
           
 void setFetchError(java.lang.String error)
          If an error was encountered loading from this source, it can be set here for display to the user.
 java.lang.String toString()
          Returns a debug string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleRepositorySource

public SimpleRepositorySource(@NonNull
                              java.lang.String url,
                              @Nullable
                              java.lang.String displayName,
                              boolean enabled,
                              @NonNull
                              java.util.Collection<SchemaModule> allowedModules,
                              @NonNull
                              RepositorySourceProvider provider)
Constructor

Parameters:
url - The URL this source will fetch from.
displayName - The user-friendly name for this source
enabled - Whether this source is enabled.
allowedModules - The SchemaModules allowed to be used when parsing the xml downloaded from this source.
provider - The RepositorySourceProvider that created this source.
Method Detail

getPermittedModules

@NonNull
public java.util.Collection<SchemaModule> getPermittedModules()
Description copied from interface: RepositorySource
Gets the SchemaModules that are allowed to be used to parse XML from this source.

Specified by:
getPermittedModules in interface RepositorySource

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface RepositorySource
Returns:
true if this source is enabled.

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface RepositorySource
Parameters:
enabled - Whether this source should be enabled or disabled.

getDisplayName

@Nullable
public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface RepositorySource
Returns:
The user-friendly name for this source.

getUrl

@NonNull
public java.lang.String getUrl()
Specified by:
getUrl in interface RepositorySource
Returns:
The URL from which to download.

toString

@NonNull
public java.lang.String toString()
Returns a debug string representation of this object. Not for user display.

Overrides:
toString in class java.lang.Object

setFetchError

public void setFetchError(@Nullable
                          java.lang.String error)
Description copied from interface: RepositorySource
If an error was encountered loading from this source, it can be set here for display to the user.

Specified by:
setFetchError in interface RepositorySource

getFetchError

@Nullable
public java.lang.String getFetchError()
Description copied from interface: RepositorySource
Gets the error (if any) encountered when fetching content from this source.

Specified by:
getFetchError in interface RepositorySource
Returns:
The error, or null if the load was successful.

getProvider

@NonNull
public RepositorySourceProvider getProvider()
Specified by:
getProvider in interface RepositorySource
Returns:
The provider that created this source.