ERROR : Incompatible Type while writing plugin
arun2arunraj Mar 20, 2013 5:48 AMHi Developers,
I have been trying to solve this error( Incompatible Type ) for a week. But Still no improvement. I hope for you guys it is very easy. Please help me out.
I am trying to discover my child resourceType (Service), from my parent resourceType(Server) which has been discovered by other java classes. My Parent resourceType(Server) is working perfect, meaning It is being discovered by java classes. But I can't create a child resourceType(Service) inside of that parent resourceType(Server). Following is my childDiscoveryComponent Code. In the following code, I am trying to list out the discovered parent resourceTypes. Why Because, For that each parent resourceType(Server), I have to create child resourceType(Service).
Now My Problem is in the code, line no 17. It is putting me Incompatible Type. Please give me idea to identify the parent resourceType in child reourceType or atleast help me to solve this error.
1 package org.rhq.plugins.service; 2 import java.util.HashSet; 3 import java.util.Map; 4 import java.util.Set; 6 import org.rhq.core.domain.configuration.Configuration; 7 import org.rhq.core.domain.resource.ResourceType; 8 import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; 9 import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; 10 import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; 11 import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; 12 public class userDiscoveryComponent implements ResourceDiscoveryComponent<customerComponent> 13 { 14 public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<customerComponent> context) throws InvalidPluginConfigurationException, 15 Exception { 16 Set<DiscoveredResourceDetails> user = new HashSet<DiscoveredResourceDetails>(); 17 Set<ResourceDiscoveryComponent> users = context.getParentResourceComponent(); 18 for(ResourceDiscoveryComponent l : users) 19 { 20 System.out.println(l); 21 } /* The following striked out lines has to be created for all the discovered parent resourceTypes(Server). The following are child resourceType(Service) details. These has to be created for the times of parent resourceTypes(Server). String key = "My Users"; String name = "User"; String description = "It will display Users details of CUSTOMERS"; Configuration configuration = null; ResourceType resourceType = context.getResourceType(); DiscoveredResourceDetails detail = new DiscoveredResourceDetails(resourceType, key, name, null,description,configuration,null); user.add(detail); return user;*/ } }
Thanks for your help in advance.
Regards,
ArunRaj
Message was edited by: Arun Raj