|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Utilities
Nested Class Summary | |
---|---|
static interface |
Utilities.JSONClient
|
static interface |
Utilities.JSONServer
|
Method Summary | |
---|---|
void |
addLocationProvider(LocationProvider provider)
|
void |
addLocationProviderListener(LocationProviderListener listener)
|
void |
addPowerManagementListener(PowerManagementListener listener)
|
void |
addScriptProviderListener(ScriptProvider.ScriptProviderListener provider)
|
java.nio.ByteBuffer |
allocateDirectByteBuffer(int size)
|
PooledByteBuffer |
allocatePooledByteBuffer(byte[] data)
|
PooledByteBuffer |
allocatePooledByteBuffer(int size)
|
PooledByteBuffer |
allocatePooledByteBuffer(java.util.Map data)
|
int |
compareVersions(java.lang.String v1,
java.lang.String v2)
Compares two version strings for order. |
AggregatedDispatcher |
createAggregatedDispatcher(long idle_dispatch_time,
long max_queue_size)
create a dispatcher that will queue runnable items until either the limit is reached or the dispatcher hasn't had an entry added for the defined idle time |
AggregatedList |
createAggregatedList(AggregatedListAcceptor acceptor,
long idle_dispatch_time,
long max_queue_size)
|
DelayedTask |
createDelayedTask(java.lang.Runnable r)
Adds a low priority task that will be scheduled at some point after existing tasks have completed. |
void |
createProcess(java.lang.String command_line)
create a child process and executes the supplied command line. |
void |
createThread(java.lang.String name,
java.lang.Runnable target)
create and run a thread for the target. |
UTTimer |
createTimer(java.lang.String name)
Creates a UTTimer instance. |
UTTimer |
createTimer(java.lang.String name,
boolean lightweight)
Creates a UTTimer instance. |
UTTimer |
createTimer(java.lang.String name,
int priority)
Creates a UTTimer instance. |
ByteArrayWrapper |
createWrapper(byte[] data)
|
void |
deleteResilientBEncodedFile(java.io.File parent_dir,
java.lang.String file_name,
boolean use_backup)
|
void |
freeDirectByteBuffer(java.nio.ByteBuffer buffer)
|
java.lang.String |
getAzureusProgramDir()
|
java.lang.String |
getAzureusUserDir()
|
long |
getCurrentSystemTime()
Get the current system time, like System.currentTimeMillis(), only the time lookup is cached for performance reasons. |
java.util.List<DistributedDatabase> |
getDistributedDatabases(java.lang.String[] networks)
|
java.util.List<DistributedDatabase> |
getDistributedDatabases(java.lang.String[] networks,
java.util.Map<java.lang.String,java.lang.Object> options)
|
FeatureManager |
getFeatureManager()
|
Formatters |
getFormatters()
|
java.io.InputStream |
getImageAsStream(java.lang.String image_name)
|
LocaleUtilities |
getLocaleUtilities()
|
java.util.List<LocationProvider> |
getLocationProviders()
|
Monitor |
getMonitor()
|
java.net.InetAddress |
getPublicAddress()
Returns a public IP address of the machine or null if it can't be determined |
java.net.InetAddress |
getPublicAddress(boolean ipv6)
|
ResourceDownloaderFactory |
getResourceDownloaderFactory()
|
ResourceUploaderFactory |
getResourceUploaderFactory()
|
RSSFeed |
getRSSFeed(java.io.InputStream is)
Deprecated. |
RSSFeed |
getRSSFeed(ResourceDownloader feed_location)
Deprecated. |
RSSFeed |
getRSSFeed(java.net.URL feed_location)
|
RSSFeed |
getRSSFeed(java.net.URL source_url,
java.io.InputStream is)
|
RSSFeed |
getRSSFeed(java.net.URL source_url,
ResourceDownloader feed_location)
|
java.util.List<ScriptProvider> |
getScriptProviders()
|
SearchInitiator |
getSearchInitiator()
|
SESecurityManager |
getSecurityManager()
|
Semaphore |
getSemaphore()
|
SimpleXMLParserDocumentFactory |
getSimpleXMLParserDocumentFactory()
|
SubscriptionManager |
getSubscriptionManager()
|
TagManager |
getTagManager()
|
boolean |
isCVSVersion()
|
boolean |
isFreeBSD()
|
boolean |
isLinux()
|
boolean |
isOSX()
|
boolean |
isSolaris()
|
boolean |
isUnix()
|
boolean |
isWindows()
|
Tag |
lookupTag(java.lang.String name)
|
java.lang.String |
normaliseFileName(java.lang.String f_name)
Converts a file name so that all characters in the file name are compatible with the underlying filesystem. |
java.util.Map |
readResilientBEncodedFile(java.io.File parent_dir,
java.lang.String file_name,
boolean use_backup)
|
void |
registerJSONRPCClient(Utilities.JSONClient client)
|
void |
registerJSONRPCServer(Utilities.JSONServer server)
|
void |
registerScriptProvider(ScriptProvider provider)
|
void |
registerSearchProvider(SearchProvider provider)
|
void |
removeLocationProvider(LocationProvider provider)
|
void |
removeLocationProviderListener(LocationProviderListener listener)
|
void |
removePowerManagementListener(PowerManagementListener listener)
|
void |
removeScriptProviderListener(ScriptProvider.ScriptProviderListener provider)
|
java.lang.String |
reverseDNSLookup(java.net.InetAddress address)
attempts a reverse DNS lookup of an address, null if it fails |
boolean |
supportsPowerStateControl(int state)
|
void |
unregisterJSONRPCClient(Utilities.JSONClient client)
|
void |
unregisterJSONRPCServer(Utilities.JSONServer server)
|
void |
unregisterScriptProvider(ScriptProvider provider)
|
void |
unregisterSearchProvider(SearchProvider provider)
|
void |
writeResilientBEncodedFile(java.io.File parent_dir,
java.lang.String file_name,
java.util.Map data,
boolean use_backup)
|
Method Detail |
---|
java.lang.String getAzureusUserDir()
java.lang.String getAzureusProgramDir()
boolean isCVSVersion()
boolean isWindows()
boolean isLinux()
boolean isSolaris()
boolean isOSX()
boolean isUnix()
boolean isFreeBSD()
java.io.InputStream getImageAsStream(java.lang.String image_name)
Semaphore getSemaphore()
Monitor getMonitor()
java.nio.ByteBuffer allocateDirectByteBuffer(int size)
void freeDirectByteBuffer(java.nio.ByteBuffer buffer)
PooledByteBuffer allocatePooledByteBuffer(int size)
PooledByteBuffer allocatePooledByteBuffer(byte[] data)
PooledByteBuffer allocatePooledByteBuffer(java.util.Map data) throws java.io.IOException
data
- must be b-encodable
java.io.IOException
Formatters getFormatters()
LocaleUtilities getLocaleUtilities()
UTTimer createTimer(java.lang.String name)
UTTimer
instance. It will be configured for non-lightweight
tasks by default.
name
- Name for the UTTimer object.
UTTimer createTimer(java.lang.String name, boolean lightweight)
UTTimer
instance.
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.
UTTimer createTimer(java.lang.String name, int priority)
UTTimer
instance.
name
- Name for the UTTimer object.priority
- The Thread.XXX_PRIORITY value to use.
void createThread(java.lang.String name, java.lang.Runnable target)
name
- target
- void createProcess(java.lang.String command_line) throws PluginException
command_line
-
PluginException
ResourceDownloaderFactory getResourceDownloaderFactory()
ResourceUploaderFactory getResourceUploaderFactory()
SESecurityManager getSecurityManager()
SimpleXMLParserDocumentFactory getSimpleXMLParserDocumentFactory()
RSSFeed getRSSFeed(java.io.InputStream is) throws SimpleXMLParserDocumentException
is
-
SimpleXMLParserDocumentException
RSSFeed getRSSFeed(java.net.URL source_url, java.io.InputStream is) throws SimpleXMLParserDocumentException
SimpleXMLParserDocumentException
RSSFeed getRSSFeed(java.net.URL feed_location) throws ResourceDownloaderException, SimpleXMLParserDocumentException
ResourceDownloaderException
SimpleXMLParserDocumentException
RSSFeed getRSSFeed(ResourceDownloader feed_location) throws ResourceDownloaderException, SimpleXMLParserDocumentException
feed_location
-
ResourceDownloaderException
SimpleXMLParserDocumentException
RSSFeed getRSSFeed(java.net.URL source_url, ResourceDownloader feed_location) throws ResourceDownloaderException, SimpleXMLParserDocumentException
ResourceDownloaderException
SimpleXMLParserDocumentException
java.net.InetAddress getPublicAddress()
java.net.InetAddress getPublicAddress(boolean ipv6)
java.lang.String reverseDNSLookup(java.net.InetAddress address)
address
-
long getCurrentSystemTime()
ByteArrayWrapper createWrapper(byte[] data)
AggregatedDispatcher createAggregatedDispatcher(long idle_dispatch_time, long max_queue_size)
idle_dispatch_time
- millisecondsmax_queue_size
- 0 -> infinite
AggregatedList createAggregatedList(AggregatedListAcceptor acceptor, long idle_dispatch_time, long max_queue_size)
java.util.Map readResilientBEncodedFile(java.io.File parent_dir, java.lang.String file_name, boolean use_backup)
void writeResilientBEncodedFile(java.io.File parent_dir, java.lang.String file_name, java.util.Map data, boolean use_backup)
void deleteResilientBEncodedFile(java.io.File parent_dir, java.lang.String file_name, boolean use_backup)
int compareVersions(java.lang.String v1, java.lang.String v2)
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"); // +
v1
- the first version string to be comparedv2
- the second version string to be compared
java.lang.String normaliseFileName(java.lang.String f_name)
Note - this is only intended for file names, rather than file paths.
f_name
- File name to convert.
DelayedTask createDelayedTask(java.lang.Runnable r)
void registerSearchProvider(SearchProvider provider) throws SearchException
SearchException
void unregisterSearchProvider(SearchProvider provider) throws SearchException
SearchException
SearchInitiator getSearchInitiator() throws SearchException
SearchException
SubscriptionManager getSubscriptionManager() throws SubscriptionException
SubscriptionException
FeatureManager getFeatureManager()
boolean supportsPowerStateControl(int state)
void addPowerManagementListener(PowerManagementListener listener)
void removePowerManagementListener(PowerManagementListener listener)
java.util.List<LocationProvider> getLocationProviders()
void addLocationProvider(LocationProvider provider)
void removeLocationProvider(LocationProvider provider)
void addLocationProviderListener(LocationProviderListener listener)
void removeLocationProviderListener(LocationProviderListener listener)
void registerJSONRPCServer(Utilities.JSONServer server)
void unregisterJSONRPCServer(Utilities.JSONServer server)
void registerJSONRPCClient(Utilities.JSONClient client)
void unregisterJSONRPCClient(Utilities.JSONClient client)
java.util.List<DistributedDatabase> getDistributedDatabases(java.lang.String[] networks)
java.util.List<DistributedDatabase> getDistributedDatabases(java.lang.String[] networks, java.util.Map<java.lang.String,java.lang.Object> options)
java.util.List<ScriptProvider> getScriptProviders()
void registerScriptProvider(ScriptProvider provider)
void unregisterScriptProvider(ScriptProvider provider)
void addScriptProviderListener(ScriptProvider.ScriptProviderListener provider)
void removeScriptProviderListener(ScriptProvider.ScriptProviderListener provider)
TagManager getTagManager()
Tag lookupTag(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |