org.hyperic.sigar.ProcCredName Maven / Gradle / Ivy
/*****************************************************
* WARNING: this file was generated by -e
* on Mon Sep 21 16:05:35 2020.
* Any changes made here will be LOST.
*****************************************************/
package org.hyperic.sigar;
import java.util.HashMap;
import java.util.Map;
/**
* ProcCredName sigar class.
*/
public class ProcCredName implements java.io.Serializable {
private static final long serialVersionUID = 2266L;
public ProcCredName() { }
public native void gather(Sigar sigar, long pid) throws SigarException;
/**
* This method is not intended to be called directly.
* use Sigar.getProcCredName() instead.
* @exception SigarException on failure.
* @see org.hyperic.sigar.Sigar#getProcCredName
*/
static ProcCredName fetch(Sigar sigar, long pid) throws SigarException {
ProcCredName procCredName = new ProcCredName();
procCredName.gather(sigar, pid);
return procCredName;
}
String user = null;
/**
* Get the Process owner user name.
* Supported Platforms: All.
*
* @return Process owner user name
*/
public String getUser() { return user; }
String group = null;
/**
* Get the Process owner group name.
* Supported Platforms: All.
*
* @return Process owner group name
*/
public String getGroup() { return group; }
void copyTo(ProcCredName copy) {
copy.user = this.user;
copy.group = this.group;
}
public Map toMap() {
Map map = new HashMap();
String struser =
String.valueOf(this.user);
if (!"-1".equals(struser))
map.put("User", struser);
String strgroup =
String.valueOf(this.group);
if (!"-1".equals(strgroup))
map.put("Group", strgroup);
return map;
}
public String toString() {
return toMap().toString();
}
}