org.labkey.remoteapi.security.WhoAmIResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of labkey-client-api Show documentation
Show all versions of labkey-client-api Show documentation
The client-side library for Java developers is a separate JAR from the LabKey Server code base. It can be used by any Java program, including another Java web application.
package org.labkey.remoteapi.security;
import org.json.simple.JSONObject;
import org.labkey.remoteapi.Command;
import org.labkey.remoteapi.CommandResponse;
public class WhoAmIResponse extends CommandResponse
{
public WhoAmIResponse(String text, int statusCode, String contentType, JSONObject json, WhoAmICommand cmd)
{
super(text, statusCode, contentType, json, cmd);
}
public Number getUserId()
{
return getProperty("id");
}
public String getEmail()
{
return getProperty("email");
}
public String getDisplayName()
{
return getProperty("displayName");
}
public boolean isImpersonated()
{
return (Boolean)getProperty("impersonated");
}
public String getCSRF()
{
return getProperty("CSRF");
}
}