@Override public String toString() { return "org.rhq.core.domain.alert.AlertDefinition" + "[ " + "id=" + id + ", " + "name=" + name + ", " + "conditionExpression=" + conditionExpression + ", " + "priority=" + priority + ", " + ((resource != null) ? ("resourceId=" + resource.getId()) : "") + ((resourceType != null) ? ("resourceTypeId=" + resourceType.getId()) : "") + " ]"; } }
public int compare(Resource o1, Resource o2) { int result = o1.getResourceType().compareTo(o2.getResourceType()); if (result == 0) { // The types are the same - let the Resource.compareTo() break the tie. result = o1.compareTo(o2); } return result; } }); // wrap in new TreeSet to avoid CCMEs and to sort by type
public static boolean isService(Resource resource) { return resource.getResourceType().getCategory() == ResourceCategory.SERVICE; } }
public String toString() { return "[" + resourceId + "] " + resource.getName() + " (" + resource.getResourceType().getName() + "::" + resource.getResourceType().getPlugin() + ")"; }
public AutoGroupComposite(Double availability, Resource parentResource, ResourceType resourceType, long memberCount, boolean isDuplicateResourceTypeName) { this.availability = availability; this.parentResource = parentResource; this.resourceType = resourceType; this.memberCount = memberCount; if (isDuplicateResourceTypeName) { this.name = this.resourceType.getName() + "(" + this.resourceType.getPlugin() + " plugin)"; } else { this.name = this.resourceType.getName(); } }
public static String displayName(ResourceType resourceType) { if (resourceType == null) return null; return resourceType.getDisplayName() == null ? resourceType.getName() : resourceType.getDisplayName(); }
@Override public String toString() { return "PackageType[id=" + id + ",name=" + name + ",resourceType=" + ((resourceType != null) ? resourceType.getName() : "?") + "]"; }
@Override public void resourceActivated(Resource resource) { // Schedule content discovery if resource is synchronized and COMMITED if (resource.getId() != 0 && resource.getInventoryStatus() == COMMITTED) { ContentManager.this.scheduleDiscoveries(resource); } }
public class DiscussionDirector { public void discuss() { Agent a = new Agent();//Here you create a new agent on the HEAP a.generateAgent();//And here you call into the Agent class to do the same thing //note that generateAgent returns an Object that you're 'forgetting' about. return; } }
@Override public int getResourceId() { if (resource == null) { return 0; } return resource.getId(); }
/** * The {@link Resource#getResourceType() resource type} of the resource this context is associated with. * * @return type of the associated resource */ public ResourceType getResourceType() { return this.resource.getResourceType(); }
@Override public String toString() { return "ResourceMembershipComposite[" + resource.toString() + ", " + "explicit" + explicit + ", " + "implicit" + implicit + "]"; } }
public void run() { ... // Agent agent = new Agent(); agent = new Agent(); // works fine: you are initiliazing the class member ... parameter = getParameter(); }
private void updateInventoryStatus(Resource resource, InventoryStatus newStatus, long now) { resource.setInventoryStatus(newStatus); resource.setItime(now); resource.setAgentSynchronizationNeeded(); }
/** * Constructor that allows the caller to choose what Set implementation is used for the <code>childResources</code> field. * * @param childResources the Set that will be used to hold this Resource's child Resources */ public Resource(Set<Resource> childResources) { setChildResources(childResources); customChildResourcesCollection = true; }
/** * A Java bean style getter to allow us to access the enum name from JSP or Facelets pages (e.g. * ${Resource.resourceType.category.name}). * * @return the enum name */ public String getName() { return name(); }
@Override public Resource manuallyAddResource(Subject subject, int resourceTypeId, int parentResourceId, Configuration pluginConfiguration) throws Exception { return manuallyAddResource(subject, new ImportResourceRequest(resourceTypeId, parentResourceId, pluginConfiguration)).getResource(); }
@Override public String toString() { return "ResourceUpgradeRequest [resourceId=" + resourceId + ", upgradeErrorMessage=" + upgradeErrorMessage + ", upgradeErrorStackTrace=" + upgradeErrorStackTrace + ", timestamp=" + timestamp + ", toString()=" + super.toString() + "]"; } }
public static boolean isServer(Resource resource) { return resource.getResourceType().getCategory() == ResourceCategory.SERVER; }
/** * Returns the {@link String} representation of the underlying resource. * @return a {@link String} representation of the underlying resource */ public String getResourceDetails() { return resource.toString(); } }