|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Utilities
public String getAzureusProgramDir()
getAzureusProgramDir
in interface Utilities
public boolean isWindows()
isWindows
in interface Utilities
public boolean isLinux()
isLinux
in interface Utilities
public boolean isUnix()
isUnix
in interface Utilities
public boolean isFreeBSD()
isFreeBSD
in interface Utilities
public boolean isSolaris()
isSolaris
in interface Utilities
public boolean isOSX()
isOSX
in interface Utilities
public boolean isCVSVersion()
isCVSVersion
in interface Utilities
public InputStream getImageAsStream(String image_name)
getImageAsStream
in interface Utilities
public Semaphore getSemaphore()
getSemaphore
in interface Utilities
public Monitor getMonitor()
getMonitor
in interface Utilities
public ByteBuffer allocateDirectByteBuffer(int size)
allocateDirectByteBuffer
in interface Utilities
public void freeDirectByteBuffer(ByteBuffer buffer)
freeDirectByteBuffer
in interface Utilities
public PooledByteBuffer allocatePooledByteBuffer(int length)
allocatePooledByteBuffer
in interface Utilities
public PooledByteBuffer allocatePooledByteBuffer(byte[] data)
allocatePooledByteBuffer
in interface Utilities
public PooledByteBuffer allocatePooledByteBuffer(Map map) throws IOException
allocatePooledByteBuffer
in interface Utilities
map
- must be b-encodable
IOException
public Formatters getFormatters()
getFormatters
in interface Utilities
public LocaleUtilities getLocaleUtilities()
getLocaleUtilities
in interface Utilities
public UTTimer createTimer(String name)
Utilities
UTTimer
instance. It will be configured for non-lightweight
tasks by default.
createTimer
in interface Utilities
name
- Name for the UTTimer object.
public UTTimer createTimer(String name, boolean lightweight)
Utilities
UTTimer
instance.
createTimer
in interface Utilities
name
- 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)
Utilities
UTTimer
instance.
createTimer
in interface Utilities
name
- 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 Utilities
PluginException
public ResourceDownloaderFactory getResourceDownloaderFactory()
getResourceDownloaderFactory
in interface Utilities
public ResourceUploaderFactory getResourceUploaderFactory()
getResourceUploaderFactory
in interface Utilities
public SESecurityManager getSecurityManager()
getSecurityManager
in interface Utilities
public SimpleXMLParserDocumentFactory getSimpleXMLParserDocumentFactory()
getSimpleXMLParserDocumentFactory
in interface Utilities
public RSSFeed getRSSFeed(InputStream is) throws SimpleXMLParserDocumentException
getRSSFeed
in interface Utilities
SimpleXMLParserDocumentException
public RSSFeed getRSSFeed(URL source_url, InputStream is) throws SimpleXMLParserDocumentException
getRSSFeed
in interface Utilities
SimpleXMLParserDocumentException
public RSSFeed getRSSFeed(URL feed_location) throws ResourceDownloaderException, SimpleXMLParserDocumentException
getRSSFeed
in interface Utilities
ResourceDownloaderException
SimpleXMLParserDocumentException
public RSSFeed getRSSFeed(ResourceDownloader feed_location) throws ResourceDownloaderException, SimpleXMLParserDocumentException
getRSSFeed
in interface Utilities
ResourceDownloaderException
SimpleXMLParserDocumentException
public RSSFeed getRSSFeed(URL source_url, ResourceDownloader feed_location) throws ResourceDownloaderException, SimpleXMLParserDocumentException
getRSSFeed
in interface Utilities
ResourceDownloaderException
SimpleXMLParserDocumentException
public InetAddress getPublicAddress(boolean v6)
getPublicAddress
in interface Utilities
public InetAddress getPublicAddress()
Utilities
getPublicAddress
in interface Utilities
public String reverseDNSLookup(InetAddress address)
Utilities
reverseDNSLookup
in interface Utilities
public long getCurrentSystemTime()
Utilities
getCurrentSystemTime
in interface Utilities
public ByteArrayWrapper createWrapper(byte[] data)
createWrapper
in interface Utilities
public AggregatedDispatcher createAggregatedDispatcher(long idle_dispatch_time, long max_queue_size)
Utilities
createAggregatedDispatcher
in interface Utilities
idle_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 Exception
public 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)
Utilities
Example:
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 Utilities
v1
- the first version string to be comparedv2
- the second version string to be compared
public String normaliseFileName(String f_name)
Utilities
Note - this is only intended for file names, rather than file paths.
normaliseFileName
in interface Utilities
f_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 Utilities
SearchException
public void unregisterSearchProvider(SearchProvider provider) throws SearchException
unregisterSearchProvider
in interface Utilities
SearchException
public SearchInitiator getSearchInitiator() throws SearchException
getSearchInitiator
in interface Utilities
SearchException
public 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 FeatureManager
PluginException
public FeatureManager.Licence addLicence(String licence_key) throws PluginException
addLicence
in interface FeatureManager
PluginException
public FeatureManager.Licence[] getLicences()
getLicences
in interface FeatureManager
public void refreshLicences()
refreshLicences
in interface FeatureManager
public FeatureManager.FeatureDetails[] getFeatureDetails(String feature_id)
getFeatureDetails
in interface FeatureManager
public boolean isFeatureInstalled(String feature_id)
isFeatureInstalled
in interface FeatureManager
public void addListener(FeatureManager.FeatureManagerListener listener)
addListener
in interface FeatureManager
public void removeListener(FeatureManager.FeatureManagerListener listener)
removeListener
in interface FeatureManager
public void registerFeatureEnabler(FeatureManager.FeatureEnabler enabler)
registerFeatureEnabler
in interface FeatureManager
public void unregisterFeatureEnabler(FeatureManager.FeatureEnabler enabler)
unregisterFeatureEnabler
in interface FeatureManager
public SubscriptionManager getSubscriptionManager() throws SubscriptionException
getSubscriptionManager
in interface Utilities
SubscriptionException
public boolean supportsPowerStateControl(int state)
supportsPowerStateControl
in interface Utilities
public void addPowerManagementListener(PowerManagementListener listener)
addPowerManagementListener
in interface Utilities
public void removePowerManagementListener(PowerManagementListener listener)
removePowerManagementListener
in interface Utilities
public List<LocationProvider> getLocationProviders()
getLocationProviders
in interface Utilities
public void addLocationProvider(LocationProvider provider)
addLocationProvider
in interface Utilities
public void removeLocationProvider(LocationProvider provider)
removeLocationProvider
in interface Utilities
public void addLocationProviderListener(LocationProviderListener listener)
addLocationProviderListener
in interface Utilities
public void removeLocationProviderListener(LocationProviderListener listener)
removeLocationProviderListener
in interface Utilities
public List<ScriptProvider> getScriptProviders()
getScriptProviders
in interface Utilities
public void registerScriptProvider(ScriptProvider provider)
registerScriptProvider
in interface Utilities
public void unregisterScriptProvider(ScriptProvider provider)
unregisterScriptProvider
in interface Utilities
public void addScriptProviderListener(ScriptProvider.ScriptProviderListener listener)
addScriptProviderListener
in interface Utilities
public void removeScriptProviderListener(ScriptProvider.ScriptProviderListener listener)
removeScriptProviderListener
in interface Utilities
public Tag lookupTag(String name)
lookupTag
in interface Utilities
public List<DistributedDatabase> getDistributedDatabases(String[] networks)
getDistributedDatabases
in interface Utilities
public List<DistributedDatabase> getDistributedDatabases(String[] networks, Map<String,Object> options)
getDistributedDatabases
in interface Utilities
public void registerJSONRPCServer(Utilities.JSONServer server)
registerJSONRPCServer
in interface Utilities
public void unregisterJSONRPCServer(Utilities.JSONServer server)
unregisterJSONRPCServer
in interface Utilities
public void registerJSONRPCClient(Utilities.JSONClient client)
registerJSONRPCClient
in interface Utilities
public void unregisterJSONRPCClient(Utilities.JSONClient client)
unregisterJSONRPCClient
in interface Utilities
public TagManager getTagManager()
getTagManager
in interface Utilities
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |