org.rhq.plugins.apache.util
Class VirtualHostLegacyResourceKeyUtil

java.lang.Object
  extended by org.rhq.plugins.apache.util.VirtualHostLegacyResourceKeyUtil

public class VirtualHostLegacyResourceKeyUtil
extends Object

A helper class to create legacy resource keys for vhosts.

Author:
Lukas Krejci

Constructor Summary
VirtualHostLegacyResourceKeyUtil(ApacheServerComponent serverComponent, ApacheDirectiveTree runtimeConfig)
           
 
Method Summary
 Set<String> getLegacyMainServerResourceKeys()
          This creates a list of possible resource keys for the main server.
 Set<String> getLegacyVirtualHostResourceKeys(VHostSpec vhost)
          Returns a list of possible resource keys that the RHQ 3 code could generate for the specified vhost.
 String getRHQ3NonSNMPLegacyMainServerResourceKey()
          A resource key for the main vhost that would be returned by the RHQ 3 codebase if SNMP wasn't enabled during discovery.
 String getRHQ3NonSNMPLegacyVirtualHostResourceKey(VHostSpec vhost)
          A resource key for given vhost that would be returned by RHQ 3 if SNMP wasn't enabled during discovery.
 String getRHQ3SNMPLikeResourceKey(String nonSnmpResourceKey)
          Returns an "SNMP" resource key that would have been resolved out of the non-snmp resource key by the RHQ 3 code-base.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualHostLegacyResourceKeyUtil

public VirtualHostLegacyResourceKeyUtil(ApacheServerComponent serverComponent,
                                        ApacheDirectiveTree runtimeConfig)
Method Detail

getLegacyMainServerResourceKeys

public Set<String> getLegacyMainServerResourceKeys()
This creates a list of possible resource keys for the main server.

This uses the algoritms used in the RHQ 3 codebase and returns both the resource key that would be generated wihout SNMP support and with it.

The returned set also contains the resource key as it would be found by RHQ 1.x

Returns:
possible resource keys of the main server.

getRHQ3NonSNMPLegacyMainServerResourceKey

public String getRHQ3NonSNMPLegacyMainServerResourceKey()
A resource key for the main vhost that would be returned by the RHQ 3 codebase if SNMP wasn't enabled during discovery.

Note that this can return 2 different values depending on whether the URL property in the parent apache server's plugin configuration is set or not.

Because the resource key is dependent on a value manually entered by the user (albeit autodetected during discovery), no attempt is made to guess what values that property could have had. Only the current value is used.

Returns:

getLegacyVirtualHostResourceKeys

public Set<String> getLegacyVirtualHostResourceKeys(VHostSpec vhost)
Returns a list of possible resource keys that the RHQ 3 code could generate for the specified vhost.

As with getLegacyMainServerResourceKeys() the resulting set will contain all the various resource keys that could have been found by past versions of the plugin.

Parameters:
vhost -
Returns:
the possible vhosts

getRHQ3NonSNMPLegacyVirtualHostResourceKey

public String getRHQ3NonSNMPLegacyVirtualHostResourceKey(VHostSpec vhost)
A resource key for given vhost that would be returned by RHQ 3 if SNMP wasn't enabled during discovery.

Parameters:
vhost -
Returns:

getRHQ3SNMPLikeResourceKey

public String getRHQ3SNMPLikeResourceKey(String nonSnmpResourceKey)
Returns an "SNMP" resource key that would have been resolved out of the non-snmp resource key by the RHQ 3 code-base. Note that the returned key actually isn't what SNMP module would actually return.

Parameters:
nonSnmpResourceKey -
Returns:


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.