5.1 The AccountRef Type

This section contains the following topics:

5.1.1 About the AccountRef Type

The AccountRef type contains all the information needed to identify a user or group. Typically this type contains a GUID value, but also allows the user or group name to be used. The following code snippets show how to create an AccountRef using a GUID or a user name or a group name.

5.1.2 Creating an AccountRef Using a GUID

AccountRef accountReference = new AccountReference();
accountReference.setUuid("c9d55dc2-92f6-405d-aa52-ff12ab2792ef");

The GUID format may differ depending on the identity store used.

5.1.3 Creating an AccountRef Using a User Name

The user name must be URL encoded. For example, 'John Smith' could be encoded as 'John+Smith'.

AccountRef accountReference = new AccountReference();
accountReference.setUuid("urn:user:john.smith");

5.1.4 Creating an AccountRef Using a Group Name

The group name must be URL encoded.

AccountRef accountReference = new AccountReference();
accountReference.setUuid("urn:group:everyone");