com.android.repository.api
Class RemoteSource

java.lang.Object
  extended by com.android.repository.api.RemoteSource
All Implemented Interfaces:
RepositorySource
Direct Known Subclasses:
SiteType

public abstract class RemoteSource
extends java.lang.Object
implements RepositorySource

A RepositorySource that was created by a RemoteListSourceProvider and superclass for xjc-generated classes used to parse the sites list xml. Generated classes provide the url and UI name; the permitted extensions must be set by the provider. If you implement a new site type, it should extend siteType in repo-sites-common-N.xsd, and thus transitively extend this class.


Constructor Summary
RemoteSource()
           
 
Method Summary
 java.lang.String getDisplayName()
           
 java.lang.String getFetchError()
          Gets the error (if any) encountered when fetching content from this source.
 java.lang.String getName()
           
 java.util.Collection<SchemaModule> getPermittedModules()
          Gets the SchemaModules that are allowed to be used to parse XML from this source.
 RepositorySourceProvider getProvider()
           
abstract  java.lang.String getUrl()
           
 boolean isEnabled()
           Currently not implemented.
 void setEnabled(boolean enabled)
           Currently not implemented.
 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.
 void setPermittedSchemaModules(java.util.Collection<SchemaModule> modules)
          Sets the list of modules allowed to be used when parsing XML fetched from this source.
 void setProvider(RepositorySourceProvider provider)
           
 void setUrl(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteSource

public RemoteSource()
Method Detail

setPermittedSchemaModules

public void setPermittedSchemaModules(@NonNull
                                      java.util.Collection<SchemaModule> modules)
Sets the list of modules allowed to be used when parsing XML fetched from this source.


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
Returns:
The list of schema modules allowed to be used when parsing XML fetched from this source.

isEnabled

public boolean isEnabled()
Currently not implemented.

Specified by:
isEnabled in interface RepositorySource
Returns:
true if this source is enabled.

setEnabled

public void setEnabled(boolean enabled)
Currently not implemented.

Specified by:
setEnabled in interface RepositorySource
Parameters:
enabled - Whether this source should be enabled or disabled.

getUrl

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

setUrl

public void setUrl(@NonNull
                   java.lang.String url)

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.

setProvider

public void setProvider(@NonNull
                        RepositorySourceProvider provider)

getDisplayName

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

getName

@Nullable
public java.lang.String getName()