|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sblim.cimclient.discovery.AdvertisementCatalog
public class AdvertisementCatalog
Class AdvertisementCatalog implements a catalog for WBEM service advertisements. In practice we usually have multiple advertisements for a single service, because the DMTF mandates an advertisement per remote service access point (e.g. http, https, rmi). This class tries to ease the management of this by indexing services by the unique service id and therefore surfacing which advertisements belong to the same service. The application might then choose it's preferred communication mechanism.
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(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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int EVENT_ADD
public static int EVENT_REMOVE
public static int EVENT_EXPIRE
public static int EVENT_RENEW
Constructor Detail |
---|
public AdvertisementCatalog()
Method Detail |
---|
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 service
public WBEMServiceAdvertisement[] getAdvertisementsById(java.lang.String pId)
pId
- The service id
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |