|
Carrot2 Framework
API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.input.googleapi.GoogleKeysPool
public class GoogleKeysPool
A pool for Google API keys.
| Nested Class Summary | |
|---|---|
(package private) static class |
GoogleKeysPool.WaitingKey
|
| Field Summary | |
|---|---|
static String |
POOL_SYSPROPERTY
|
| Constructor Summary | |
|---|---|
GoogleKeysPool()
|
|
| Method Summary | |
|---|---|
void |
addKey(String key)
Adds a single key to the pool. |
void |
addKey(String key,
String name)
Adds a single named key to the pool. |
void |
addKeys(File dir,
String extension)
Adds all keys from files in the given folder. |
GoogleApiKey |
borrowKey()
|
static GoogleKeysPool |
getDefault()
Returns the default instance of a google keys pool, instantiated from a location given in the system property googleapi.keypool. |
int |
getKeysTotal()
|
boolean |
hasActiveKeys()
|
void |
returnKey(GoogleApiKey key)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String POOL_SYSPROPERTY
| Constructor Detail |
|---|
public GoogleKeysPool()
| Method Detail |
|---|
public GoogleApiKey borrowKey()
throws Exception
Exceptionpublic void returnKey(GoogleApiKey key)
public boolean hasActiveKeys()
public void addKey(String key)
key - The key.
public void addKey(String key,
String name)
key - The key.
public void addKeys(File dir,
String extension)
throws IOException
dir - The directory to scan.extension - File extension. Only files ending with this
extension will be considered keys.
IOExceptionpublic int getKeysTotal()
public static GoogleKeysPool getDefault()
googleapi.keypool.
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||