public class AdvertisementCatalog
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
AdvertisementCatalog()
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdvertisements(WBEMServiceAdvertisement[] pAdvertisements)
Adds new advertisements to the catalog.
|
void |
addEventListener(AdvertisementCatalog.EventListener pListener)
Adds a listener for "add" events.
|
WBEMServiceAdvertisement |
getAdvertisement(java.lang.String pId,
WBEMProtocol[] pProtocols)
Returns the advertisement from the catalog corresponding to a given id
and with the protocol preferred most.
|
WBEMServiceAdvertisement[] |
getAdvertisementsByDirectory(java.lang.String pDirectory)
Returns the advertisements from the catalog corresponding to a given
directory
|
WBEMServiceAdvertisement[] |
getAdvertisementsById(java.lang.String pId)
Returns the advertisements from the catalog corresponding to a given id
|
java.lang.String[] |
getKnownIds()
Returns an array of service ids known by this catalog
|
void |
refreshAdvertisements(java.lang.String[] pDirectory,
WBEMServiceAdvertisement[] pAdvertisements)
Refreshes the advertisements from a given directory.
|
void |
removeEventListener(AdvertisementCatalog.EventListener pListener)
Removes a listener
|
void |
removeExpired(java.lang.String pDirectory)
Removes the expired advertisements from the catalog.
|
java.lang.String |
toString() |
public static int EVENT_ADD
public static int EVENT_REMOVE
public static int EVENT_EXPIRE
public static int EVENT_RENEW
public void addEventListener(AdvertisementCatalog.EventListener pListener)
pListener
- The listenerpublic void addAdvertisements(WBEMServiceAdvertisement[] pAdvertisements)
pAdvertisements
- The new advertisementspublic WBEMServiceAdvertisement getAdvertisement(java.lang.String pId, WBEMProtocol[] pProtocols)
pId
- The service idpProtocols
- 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.public WBEMServiceAdvertisement[] getAdvertisementsByDirectory(java.lang.String pDirectory)
pDirectory
- The directory servicepublic WBEMServiceAdvertisement[] getAdvertisementsById(java.lang.String pId)
pId
- The service idpublic java.lang.String[] getKnownIds()
public void refreshAdvertisements(java.lang.String[] pDirectory, WBEMServiceAdvertisement[] pAdvertisements)
pDirectory
- The directory services we got the advertisements frompAdvertisements
- The advertisementspublic void removeEventListener(AdvertisementCatalog.EventListener pListener)
pListener
- The listener to removepublic void removeExpired(java.lang.String pDirectory)
pDirectory
- When not null
only the expired advertisements of
the given directory are removed. Otherwise all expired
advertisements are removed.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005, 2012 IBM Corporation. All Rights Reserved.