Class WBEMServiceAdvertisementSLP
- java.lang.Object
-
- org.sblim.cimclient.internal.discovery.slp.WBEMServiceAdvertisementSLP
-
- All Implemented Interfaces:
WBEMServiceAdvertisement
public class WBEMServiceAdvertisementSLP extends java.lang.Object implements WBEMServiceAdvertisement
Class WBEMServiceAdvertisementSLP is the SLP specific implementation if the WBEMServiceAdvertisement interface.- Since:
- 2.0.2
- Invariants:
- iDA != null && iServiceUrl != null && iAttributeMap != null
-
-
Field Summary
-
Fields inherited from interface org.sblim.cimclient.discovery.WBEMServiceAdvertisement
AUTH_MECH_DESC, AUTH_MECH_SUPP, CLASSINFO, COMM_MECHANISM, FUNCTIONAL_PROF_DESC, FUNCTIONAL_PROF_SUPP, INTEROP_NS, MULT_OPERATIONS_SUPP, NAMESPACE, OTHER_COMM_MECHN_DESC, PROTOCOL_VERSION, REG_PROF_SUPP, SERVICE_HI_DESC, SERVICE_HI_NAME, SERVICE_ID, TEMPLATE_DESCRIPTION, TEMPLATE_TYPE, TEMPLATE_URL_SYNTAX, TEMPLATE_VERSION
-
-
Constructor Summary
Constructors Constructor Description WBEMServiceAdvertisementSLP(java.lang.String pDA, ServiceURL pUrl, java.util.List<java.lang.String> pAttributes)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WBEMClientcreateClient(javax.security.auth.Subject pSubject, java.util.Locale[] pLocales)Creates a fully-initialized WBEMClient instance connected to the service that is subject of this advertisement.booleanequals(java.lang.Object pObj)java.lang.StringgetAttribute(java.lang.String pAttributeName)Return the attribute value for a given attribute namejava.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>getAttributes()Return the set of attributes of this advertisementjava.lang.StringgetConcreteServiceType()Returns the concrete service type.java.lang.StringgetDirectory()Gets the URL of the directory from which this advertisement was receivedjava.lang.String[]getInteropNamespaces()Returns the interop namespacesjava.lang.StringgetServiceId()Returns the service idjava.lang.StringgetServiceUrl()Returns the service url, e.g.inthashCode()booleanisExpired()Returns the expiration state of the advertisement.voidsetExpired(boolean pExpired)Sets the expirations state of the advertisement.java.lang.StringtoString()
-
-
-
Constructor Detail
-
WBEMServiceAdvertisementSLP
public WBEMServiceAdvertisementSLP(java.lang.String pDA, ServiceURL pUrl, java.util.List<java.lang.String> pAttributes)Ctor.- Parameters:
pDA- The Directory Agent from which this advertisement was receivedpUrl- The SLP service url returned by Locator.findServices().pAttributes- The attribute list (List<String>) where each entry looks either like thiskey=valueor this(key=value).
-
-
Method Detail
-
getAttribute
public java.lang.String getAttribute(java.lang.String pAttributeName)
Description copied from interface:WBEMServiceAdvertisementReturn the attribute value for a given attribute name- Specified by:
getAttributein interfaceWBEMServiceAdvertisement- Parameters:
pAttributeName- The attribute name- Returns:
- The value
-
getAttributes
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getAttributes()
Description copied from interface:WBEMServiceAdvertisementReturn the set of attributes of this advertisement- Specified by:
getAttributesin interfaceWBEMServiceAdvertisement- Returns:
- A Set<Map.Entry<String, String>> containing the name value pairs of the attributes.
-
getConcreteServiceType
public java.lang.String getConcreteServiceType()
Description copied from interface:WBEMServiceAdvertisementReturns the concrete service type. E.g. for the SLP advertised serviceservice:wbem:httpsthis method would returnhttps.- Specified by:
getConcreteServiceTypein interfaceWBEMServiceAdvertisement- Returns:
- The concrete service type
-
getServiceUrl
public java.lang.String getServiceUrl()
Description copied from interface:WBEMServiceAdvertisementReturns the service url, e.g. http://9.155.62.79:5988- Specified by:
getServiceUrlin interfaceWBEMServiceAdvertisement- Returns:
- The service url
-
createClient
public WBEMClient createClient(javax.security.auth.Subject pSubject, java.util.Locale[] pLocales) throws java.lang.Exception
Description copied from interface:WBEMServiceAdvertisementCreates a fully-initialized WBEMClient instance connected to the service that is subject of this advertisement. On every call to this method a new client will be created. The client is not stored or cached anywhere in this class.- Specified by:
createClientin interfaceWBEMServiceAdvertisement- Parameters:
pSubject- The credential for authenticating with the servicepLocales- An array of locales ordered by preference- Returns:
- The WBEM client
- Throws:
java.lang.Exception
-
getDirectory
public java.lang.String getDirectory()
Description copied from interface:WBEMServiceAdvertisementGets the URL of the directory from which this advertisement was received- Specified by:
getDirectoryin interfaceWBEMServiceAdvertisement- Returns:
- The directory URL
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getInteropNamespaces
public java.lang.String[] getInteropNamespaces()
Description copied from interface:WBEMServiceAdvertisementReturns the interop namespaces- Specified by:
getInteropNamespacesin interfaceWBEMServiceAdvertisement- Returns:
- The interop namespaces
-
getServiceId
public java.lang.String getServiceId()
Description copied from interface:WBEMServiceAdvertisementReturns the service id- Specified by:
getServiceIdin interfaceWBEMServiceAdvertisement- Returns:
- The service id
-
isExpired
public boolean isExpired()
Description copied from interface:WBEMServiceAdvertisementReturns the expiration state of the advertisement.- Specified by:
isExpiredin interfaceWBEMServiceAdvertisement- Returns:
truewhen advertisement is expired.
-
setExpired
public void setExpired(boolean pExpired)
Description copied from interface:WBEMServiceAdvertisementSets the expirations state of the advertisement. Might be used by the application to mark an advertisement as expired, e.g. when it's no longer reported by the corresponding directory. Used for this purpose by AdvertisementCatalog.- Specified by:
setExpiredin interfaceWBEMServiceAdvertisement- Parameters:
pExpired- The new value
-
equals
public boolean equals(java.lang.Object pObj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-