|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gudy.azureus2.pluginsimpl.local.utils.UtilitiesImpl
public class UtilitiesImpl
| Nested Class Summary | |
|---|---|
static class |
UtilitiesImpl.PluginLimitedRateGroup
|
static interface |
UtilitiesImpl.PluginLimitedRateGroupListener
|
static interface |
UtilitiesImpl.PluginSubscription
|
static interface |
UtilitiesImpl.PluginSubscriptionManager
|
static interface |
UtilitiesImpl.PluginSubscriptionResult
|
static interface |
UtilitiesImpl.runnableWithException<T extends Exception>
|
static interface |
UtilitiesImpl.runnableWithReturn<T>
|
static interface |
UtilitiesImpl.runnableWithReturnAndException<T,S extends Exception>
|
static interface |
UtilitiesImpl.searchManager
|
| Nested classes/interfaces inherited from interface org.gudy.azureus2.plugins.utils.Utilities |
|---|
Utilities.JSONClient, Utilities.JSONServer |
| Nested classes/interfaces inherited from interface org.gudy.azureus2.plugins.utils.FeatureManager |
|---|
FeatureManager.FeatureDetails, FeatureManager.FeatureEnabler, FeatureManager.FeatureManagerListener, FeatureManager.Licence |
| Constructor Summary | |
|---|---|
UtilitiesImpl(AzureusCore _core,
PluginInterface _pi)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UtilitiesImpl(AzureusCore _core,
PluginInterface _pi)
| Method Detail |
|---|
public static UtilitiesImpl.PluginLimitedRateGroup wrapLimiter(RateLimiter limiter,
boolean disable_disable)
public static RateLimiter unwrapLmiter(UtilitiesImpl.PluginLimitedRateGroup l)
public static Set<String> getFeaturesInstalled()
public String getAzureusUserDir()
getAzureusUserDir in interface Utilitiespublic String getAzureusProgramDir()
getAzureusProgramDir in interface Utilitiespublic boolean isWindows()
isWindows in interface Utilitiespublic boolean isLinux()
isLinux in interface Utilitiespublic boolean isUnix()
isUnix in interface Utilitiespublic boolean isFreeBSD()
isFreeBSD in interface Utilitiespublic boolean isSolaris()
isSolaris in interface Utilitiespublic boolean isOSX()
isOSX in interface Utilitiespublic boolean isCVSVersion()
isCVSVersion in interface Utilitiespublic InputStream getImageAsStream(String image_name)
getImageAsStream in interface Utilitiespublic Semaphore getSemaphore()
getSemaphore in interface Utilitiespublic Monitor getMonitor()
getMonitor in interface Utilitiespublic ByteBuffer allocateDirectByteBuffer(int size)
allocateDirectByteBuffer in interface Utilitiespublic void freeDirectByteBuffer(ByteBuffer buffer)
freeDirectByteBuffer in interface Utilitiespublic PooledByteBuffer allocatePooledByteBuffer(int length)
allocatePooledByteBuffer in interface Utilitiespublic PooledByteBuffer allocatePooledByteBuffer(byte[] data)
allocatePooledByteBuffer in interface Utilities
public PooledByteBuffer allocatePooledByteBuffer(Map map)
throws IOException
allocatePooledByteBuffer in interface Utilitiesmap - must be b-encodable
IOExceptionpublic Formatters getFormatters()
getFormatters in interface Utilitiespublic LocaleUtilities getLocaleUtilities()
getLocaleUtilities in interface Utilitiespublic UTTimer createTimer(String name)
UtilitiesUTTimer instance. It will be configured for non-lightweight
tasks by default.
createTimer in interface Utilitiesname - Name for the UTTimer object.
public UTTimer createTimer(String name,
boolean lightweight)
UtilitiesUTTimer instance.
createTimer in interface Utilitiesname - Name for the UTTimer object.lightweight - If true, it indicates that this timer will be used to
perform small lightweight tasks. If false, it indicates that
this timer will be used to perform expensive tasks. This allows Azureus to create
the appropriate amount of resources to manage this timer.
public UTTimer createTimer(String name,
int priority)
UtilitiesUTTimer instance.
createTimer in interface Utilitiesname - Name for the UTTimer object.priority - The Thread.XXX_PRIORITY value to use.
public void createThread(String name,
Runnable target)
Utilities
createThread in interface Utilities
public void createProcess(String command_line)
throws PluginException
Utilities
createProcess in interface UtilitiesPluginExceptionpublic ResourceDownloaderFactory getResourceDownloaderFactory()
getResourceDownloaderFactory in interface Utilitiespublic ResourceUploaderFactory getResourceUploaderFactory()
getResourceUploaderFactory in interface Utilitiespublic SESecurityManager getSecurityManager()
getSecurityManager in interface Utilitiespublic SimpleXMLParserDocumentFactory getSimpleXMLParserDocumentFactory()
getSimpleXMLParserDocumentFactory in interface Utilities
public RSSFeed getRSSFeed(InputStream is)
throws SimpleXMLParserDocumentException
getRSSFeed in interface UtilitiesSimpleXMLParserDocumentException
public RSSFeed getRSSFeed(URL source_url,
InputStream is)
throws SimpleXMLParserDocumentException
getRSSFeed in interface UtilitiesSimpleXMLParserDocumentException
public RSSFeed getRSSFeed(URL feed_location)
throws ResourceDownloaderException,
SimpleXMLParserDocumentException
getRSSFeed in interface UtilitiesResourceDownloaderException
SimpleXMLParserDocumentException
public RSSFeed getRSSFeed(ResourceDownloader feed_location)
throws ResourceDownloaderException,
SimpleXMLParserDocumentException
getRSSFeed in interface UtilitiesResourceDownloaderException
SimpleXMLParserDocumentException
public RSSFeed getRSSFeed(URL source_url,
ResourceDownloader feed_location)
throws ResourceDownloaderException,
SimpleXMLParserDocumentException
getRSSFeed in interface UtilitiesResourceDownloaderException
SimpleXMLParserDocumentExceptionpublic InetAddress getPublicAddress(boolean v6)
getPublicAddress in interface Utilitiespublic InetAddress getPublicAddress()
Utilities
getPublicAddress in interface Utilitiespublic String reverseDNSLookup(InetAddress address)
Utilities
reverseDNSLookup in interface Utilitiespublic long getCurrentSystemTime()
Utilities
getCurrentSystemTime in interface Utilitiespublic ByteArrayWrapper createWrapper(byte[] data)
createWrapper in interface Utilities
public AggregatedDispatcher createAggregatedDispatcher(long idle_dispatch_time,
long max_queue_size)
Utilities
createAggregatedDispatcher in interface Utilitiesidle_dispatch_time - millisecondsmax_queue_size - 0 -> infinite
public AggregatedList createAggregatedList(AggregatedListAcceptor acceptor,
long idle_dispatch_time,
long max_queue_size)
createAggregatedList in interface Utilities
public static final void callWithPluginThreadContext(PluginInterface pi,
Runnable target)
public static final <T extends Exception> void callWithPluginThreadContext(PluginInterface pi,
UtilitiesImpl.runnableWithException<T> target)
throws T extends Exception
T extends Exception
public static final <T> T callWithPluginThreadContext(PluginInterface pi,
UtilitiesImpl.runnableWithReturn<T> target)
public static final <T,S extends Exception> T callWithPluginThreadContext(PluginInterface pi,
UtilitiesImpl.runnableWithReturnAndException<T,S> target)
throws S extends Exception
S extends Exceptionpublic static PluginInterface getPluginThreadContext()
public Map readResilientBEncodedFile(File parent_dir,
String file_name,
boolean use_backup)
readResilientBEncodedFile in interface Utilities
public void writeResilientBEncodedFile(File parent_dir,
String file_name,
Map data,
boolean use_backup)
writeResilientBEncodedFile in interface Utilities
public void deleteResilientBEncodedFile(File parent_dir,
String file_name,
boolean use_backup)
deleteResilientBEncodedFile in interface Utilities
public int compareVersions(String v1,
String v2)
UtilitiesExample:
compareVersions("1.1.0.0", "1.1.2.0"); // -
compareVersions("1.1.0.0", "1.1.0"); // 0
compareVersions("1.1.1.1", "1.1.1"); // +
compareVersions in interface Utilitiesv1 - the first version string to be comparedv2 - the second version string to be compared
public String normaliseFileName(String f_name)
UtilitiesNote - this is only intended for file names, rather than file paths.
normaliseFileName in interface Utilitiesf_name - File name to convert.
public DelayedTask createDelayedTask(Runnable target)
Utilities
createDelayedTask in interface Utilities
public static DelayedTask addDelayedTask(String name,
Runnable r)
public void registerSearchProvider(SearchProvider provider)
throws SearchException
registerSearchProvider in interface UtilitiesSearchException
public void unregisterSearchProvider(SearchProvider provider)
throws SearchException
unregisterSearchProvider in interface UtilitiesSearchException
public SearchInitiator getSearchInitiator()
throws SearchException
getSearchInitiator in interface UtilitiesSearchExceptionpublic static void addSearchManager(UtilitiesImpl.searchManager manager)
public FeatureManager getFeatureManager()
getFeatureManager in interface Utilities
public FeatureManager.Licence[] createLicences(String[] feature_ids)
throws PluginException
createLicences in interface FeatureManagerPluginException
public FeatureManager.Licence addLicence(String licence_key)
throws PluginException
addLicence in interface FeatureManagerPluginExceptionpublic FeatureManager.Licence[] getLicences()
getLicences in interface FeatureManagerpublic void refreshLicences()
refreshLicences in interface FeatureManagerpublic FeatureManager.FeatureDetails[] getFeatureDetails(String feature_id)
getFeatureDetails in interface FeatureManagerpublic boolean isFeatureInstalled(String feature_id)
isFeatureInstalled in interface FeatureManagerpublic void addListener(FeatureManager.FeatureManagerListener listener)
addListener in interface FeatureManagerpublic void removeListener(FeatureManager.FeatureManagerListener listener)
removeListener in interface FeatureManagerpublic void registerFeatureEnabler(FeatureManager.FeatureEnabler enabler)
registerFeatureEnabler in interface FeatureManagerpublic void unregisterFeatureEnabler(FeatureManager.FeatureEnabler enabler)
unregisterFeatureEnabler in interface FeatureManager
public SubscriptionManager getSubscriptionManager()
throws SubscriptionException
getSubscriptionManager in interface UtilitiesSubscriptionExceptionpublic boolean supportsPowerStateControl(int state)
supportsPowerStateControl in interface Utilitiespublic void addPowerManagementListener(PowerManagementListener listener)
addPowerManagementListener in interface Utilitiespublic void removePowerManagementListener(PowerManagementListener listener)
removePowerManagementListener in interface Utilitiespublic List<LocationProvider> getLocationProviders()
getLocationProviders in interface Utilitiespublic void addLocationProvider(LocationProvider provider)
addLocationProvider in interface Utilitiespublic void removeLocationProvider(LocationProvider provider)
removeLocationProvider in interface Utilitiespublic void addLocationProviderListener(LocationProviderListener listener)
addLocationProviderListener in interface Utilitiespublic void removeLocationProviderListener(LocationProviderListener listener)
removeLocationProviderListener in interface Utilitiespublic List<ScriptProvider> getScriptProviders()
getScriptProviders in interface Utilitiespublic void registerScriptProvider(ScriptProvider provider)
registerScriptProvider in interface Utilitiespublic void unregisterScriptProvider(ScriptProvider provider)
unregisterScriptProvider in interface Utilitiespublic void addScriptProviderListener(ScriptProvider.ScriptProviderListener listener)
addScriptProviderListener in interface Utilitiespublic void removeScriptProviderListener(ScriptProvider.ScriptProviderListener listener)
removeScriptProviderListener in interface Utilitiespublic Tag lookupTag(String name)
lookupTag in interface Utilitiespublic List<DistributedDatabase> getDistributedDatabases(String[] networks)
getDistributedDatabases in interface Utilities
public List<DistributedDatabase> getDistributedDatabases(String[] networks,
Map<String,Object> options)
getDistributedDatabases in interface Utilitiespublic void registerJSONRPCServer(Utilities.JSONServer server)
registerJSONRPCServer in interface Utilitiespublic void unregisterJSONRPCServer(Utilities.JSONServer server)
unregisterJSONRPCServer in interface Utilitiespublic void registerJSONRPCClient(Utilities.JSONClient client)
registerJSONRPCClient in interface Utilitiespublic void unregisterJSONRPCClient(Utilities.JSONClient client)
unregisterJSONRPCClient in interface Utilitiespublic TagManager getTagManager()
getTagManager in interface Utilities
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||