All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.moskito.webui.shared.api.MBeanWrapperAO Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package net.anotheria.moskito.webui.shared.api;

import net.anotheria.util.BasicComparable;
import net.anotheria.util.sorter.IComparable;

import javax.management.MBeanOperationInfo;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * Wrapper for mbean that contains multiple information pieces relevant for mbean view.
 *
 * @author lrosenberg
 * @since 11.03.13 12:31
 */
public class MBeanWrapperAO implements IComparable, Serializable{
	/**
	 * SerialVersionUID.
	 */
	private static final long serialVersionUID = 6915817394173866826L;

	/**
	 * Name of the implementing class.
	 */
	private String className;
	/**
	 * Description of the mbean.
	 */
	private String description;
	/**
	 * Attributes of the mbean.
	 */
	private List attributes = Collections.emptyList();
	/**
	 * Operations of the mbean.
	 */
	private List operations = Collections.emptyList();
	/**
	 * Domain of the mbean.
	 */
	private String domain;

	/**
	 * Name.
	 */
	private String canonicalName;





	/**
	 * Mbean type property which actually corresponds with a human-understandable name.
	 */
	private String type = "";

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List getAttributes() {
		return attributes;
	}

	public void setAttributes(List attributes) {
		this.attributes = attributes;
	}

	public List getOperations() {
		return operations;
	}

	public void setOperations(List operations) {
		this.operations = operations;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public String getDomain() {
		return domain;
	}

	public void setCanonicalName(String canonicalName) {
		this.canonicalName = canonicalName;
	}

	public String getCanonicalName() {
		return canonicalName;
	}

	public int getAttributesCount(){
		return attributes.size();
	}

	public int getOperationsCount(){
		return operations.size();
	}

	public String getAttributesInfo(){
		return attributes.toString();
	}

	public String getOperationsInfo(){
		return operations.toString();
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Override
	public int compareTo(IComparable iComparable, int i) {
		int domainCompare = BasicComparable.compareString(getDomain(), ((MBeanWrapperAO)iComparable).getDomain());
		return domainCompare == 0 ?
				BasicComparable.compareString(getType(), ((MBeanWrapperAO)iComparable).getType()) :
				domainCompare;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy