如何使用 Java 从 BMC Remedy 用户获取用户 ID 或 GUID

How to get User ID or GUID from BMC Remedy User using Java

我正在为 Java 使用 Remedy API。 如何使用 java 从 Remedy 用户处获取用户 ID 或用户 GUID?

我使用如下方式进行了简单的登录:

ARServerUser sUser = new ARServerUser("server", "port", "user", "pass", 1);

然而,sUser 对象中没有任何用户 ID 或 GUID? 我查看了 API,但找不到检索它的方法。我也试过查看 UserInfo 对象,但也不包含它?

有什么想法吗? 谢谢

获取用户所有详细信息的示例代码。

ARServerUser arConnection = new ARServerUser("server", "port", "user", "pass", 1);

List<SortInfo> sortList = new ArrayList<SortInfo>();
int firstRetreive = 0;
int maxRetreive = maxNumEntries;//1M
OutputInteger numMatches = new OutputInteger();
ResultEntryList iterator = new ResultEntryList(data);
QualifierInfo qiPlain = new QualifierInfo();

//make field list for results
List<Field> fields = arConnection.getListFieldObjects(formName);
ArrayList<Integer> alFieldIds = new ArrayList<Integer>();
for (int x = 0; x <
   fields.size(); x++) {
   alFieldIds.add(fields.get(x).getFieldID());
}
int[] fieldIds = new int[alFieldIds.size()];
for (int i = 0; i < fieldIds.length; i++) {
  fieldIds[i] = ((Integer) alFieldIds.get(i)).intValue();
}
arConnection.getListEntryObjects("User", qiPlain, firstRetreive, maxRetreive, sortList, fieldIds, false, numMatches, iterator);

如果只需要id,可以跳过所有字段id的检索。不幸的是,我不记得用户名字段的 ID。将 xxx 替换为其 ID)

ARServerUser arConnection = new ARServerUser("server", "port", "user", "pass", 1);

List<SortInfo> sortList = new ArrayList<SortInfo>();
int firstRetreive = 0;
int maxRetreive = maxNumEntries;//1M
OutputInteger numMatches = new OutputInteger();
ResultEntryList iterator = new ResultEntryList(data);
QualifierInfo qiPlain = new QualifierInfo();

//make field list for results
int[] fieldIds = {Constants.AR_CORE_ENTRY_ID, xxx};

arConnection.getListEntryObjects("User", qiPlain, firstRetreive, maxRetreive, sortList, fieldIds, false, numMatches, iterator);