org.sblim.cimclient.discovery
public class AdvertisementCatalog extends Object
Since: 2.0.2
UNKNOWN: No thread synchronization provided, this is the responsibility of the caller.
Nested Class Summary | |
---|---|
static interface | AdvertisementCatalog.EventListener
Interface EventListener specifies listener that are called when an
advertisement is added to or removed from the catalog, expires or is
renewed.
|
Field Summary | |
---|---|
static int | EVENT_ADD
Event code when advertisement is added |
static int | EVENT_EXPIRE
Event code when advertisement expires |
static int | EVENT_REMOVE
Event code when advertisement is removed |
static int | EVENT_RENEW
Event code when advertisement is renewed |
Constructor Summary | |
---|---|
AdvertisementCatalog()
Ctor. |
Method Summary | |
---|---|
void | addAdvertisements(WBEMServiceAdvertisement[] pAdvertisements)
Adds new advertisements to the catalog. |
void | addEventListener(AdvertisementCatalog.EventListener pListener)
Adds a listener for "add" events. |
WBEMServiceAdvertisement | getAdvertisement(String pId, WBEMProtocol[] pProtocols)
Returns the advertisement from the catalog corresponding to a given id
and with the protocol preferred most.
|
WBEMServiceAdvertisement[] | getAdvertisementsByDirectory(String pDirectory)
Returns the advertisements from the catalog corresponding to a given
directory
|
WBEMServiceAdvertisement[] | getAdvertisementsById(String pId)
Returns the advertisements from the catalog corresponding to a given id
|
String[] | getKnownIds()
Returns an array of service ids known by this catalog
|
void | refreshAdvertisements(String[] pDirectory, WBEMServiceAdvertisement[] pAdvertisements)
Refreshes the advertisements from a given directory. |
void | removeEventListener(AdvertisementCatalog.EventListener pListener)
Removes a listener
|
void | removeExpired(String pDirectory)
Removes the expired advertisements from the catalog.
|
String | toString() |
Parameters: pAdvertisements The new advertisements
Parameters: pListener The listener
Parameters: pId The service id pProtocols An array containing the desired protocols in order of preference. If a service doesn't advertise any of the given protocols this service returns null.
Returns: The corresponding advertisement
Parameters: pDirectory The directory service
Returns: The corresponding advertisements
Parameters: pId The service id
Returns: The corresponding advertisements
Returns: The service ids
Parameters: pDirectory The directory services we got the advertisements from pAdvertisements The advertisments
Parameters: pListener The listener to remove
Parameters: pDirectory
When not null
only the expired advertisements
of the given directory are removed. Otherwise all expired
advertisements are removed.