public class UserObjectsOwnedList
extends java.lang.Object
The list of authorized objects only includes objects the user is specifically authorized to. The list does not include objects the user is solely authorized to because:
Example code:
AS400 system = new AS400("sysname", "userid", "password"); UserObjectsOwnedList list1 = new UserObjectsOwnedList(system, "USER1", UserObjectsOwnedList.SELECTION_FILE_SYSTEM_LIBRARY, UserObjectsOwnedList.SELECTION_OBJECT_RELATION_OWNED_OR_AUTHORIZED); UserObjectsOwnedListEntry[] entries1 = list1.getObjectList(); System.out.println(list1); for (int i=0; i < entries1.length; ++i) { System.out.println("Entry["+i+"/"+entries1.length+"]= "+entries1[i]); } list1.setSelectionObjectRelation(UserObjectsOwnedList.SELECTION_OBJECT_RELATION_OWNED); entries1 = list1.getObjectList(); System.out.println(list1); for (int i=0; i < entries1.length; ++i) { System.out.println("Entry["+i+"/"+entries1.length+"]= "+entries1[i]); }
User.getObjectsOwned()
Modifier and Type | Field and Description |
---|---|
static int |
SELECTION_FILE_SYSTEM_DIRECTORY
Selection value indicating to select IBM i objects that reside in a directory (non-QSYS) based file system.
|
static int |
SELECTION_FILE_SYSTEM_LIBRARY
Selection value indicating to select IBM i objects that reside in the QSYS library based file system.
|
static int |
SELECTION_OBJECT_RELATION_AUTHORIZED
Selection value indicating to select the list of objects the user is authorized to
|
static int |
SELECTION_OBJECT_RELATION_OWNED
Selection value indicating to select the list of objects the user owns.
|
static int |
SELECTION_OBJECT_RELATION_OWNED_OR_AUTHORIZED
Selection value indicating to select the both list of objects the user is authorized to and the list of objects the user owns.
|
Constructor and Description |
---|
UserObjectsOwnedList(AS400 system,
java.lang.String userName)
Constructs a UserObjectsOwnedList object.
|
UserObjectsOwnedList(AS400 system,
java.lang.String userName,
int selectionFileSystem,
int selectionObjectRelation)
Constructs a UserObjectsOwnedList object.
|
Modifier and Type | Method and Description |
---|---|
UserObjectsOwnedListEntry[] |
getObjectList()
Returns a list of all UserObjectsOwnedListEntry IBM i objects based on the current
selection criteria for the file system and object relation.
|
int |
getSelectionFileSystem()
Returns the current selection criteria for the file system from which to retrieve the list of objects that a user is authorized to or list of objects the user owns.
|
int |
getSelectionObjectRelation()
Returns the returned objects setting indicating that objects to be returned are objects that the user is authorized to, objects owned, or both.
|
AS400 |
getSystem()
Returns the system from which to retrieve the list of objects that a user is authorized to and the list of objects the user owns.
|
java.lang.String |
getUserName()
Returns the user name for which to retrieve the list of objects that a user is authorized to and list of objects the user owns.
|
void |
setSelectionFileSystem(int selectionFileSystem)
Sets the selection criteria for the file system from which to retrieve the list of objects that the user is authorized to or the list of objects the user owns.
|
void |
setSelectionObjectRelation(int selectionObjectRelation)
Sets which objects are to be selected (indicating objects authorized to, objects owned, or both).
|
void |
setSystem(AS400 system)
Sets the system from which to retrieve the list of objects that a user is authorized to and the list of objects the user owns.
|
void |
setUserName(java.lang.String userName)
Sets the user name for which to retrieve the list of objects that the user is authorized to and/or the list of objects the user owns.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
public static final int SELECTION_FILE_SYSTEM_LIBRARY
public static final int SELECTION_FILE_SYSTEM_DIRECTORY
public static final int SELECTION_OBJECT_RELATION_AUTHORIZED
public static final int SELECTION_OBJECT_RELATION_OWNED
public static final int SELECTION_OBJECT_RELATION_OWNED_OR_AUTHORIZED
public UserObjectsOwnedList(AS400 system, java.lang.String userName)
getObjectList()
method to retrieve the object list.
SELECTION_FILE_SYSTEM_LIBRARY
,
the selectionObjectRelation parameter defaults to SELECTION_OBJECT_RELATION_OWNED
.system
- The system upon which the user resides.userName
- The user name which owns the objects to be returned.public UserObjectsOwnedList(AS400 system, java.lang.String userName, int selectionFileSystem, int selectionObjectRelation)
getObjectList()
method to retrieve the object list.system
- The system upon which the user resides.userName
- The user name which owns (or is authorized to) the objects to be returned.selectionFileSystem
- The format name. Possible values are:
SELECTION_FILE_SYSTEM_LIBRARY
- QSYS objects in the QSYS library based file system.
SELECTION_FILE_SYSTEM_DIRECTORY
- IFS objects that reside in a directory.
selectionObjectRelation
- The objects to return. Possible values are:
SELECTION_OBJECT_RELATION_AUTHORIZED
- select the list of objects the user is authorized to
SELECTION_OBJECT_RELATION_OWNED
- select the list of objects the user owns
SELECTION_OBJECT_RELATION_OWNED_OR_AUTHORIZED
- select the list of objects the user is authorized to and the list of objects the user owns
public UserObjectsOwnedListEntry[] getObjectList() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
This method retrieves the list of objects from the system based on the selection critera set via the constructor or modified by any of the set methods.
AS400Exception
- If an error occurs.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist.public void setSystem(AS400 system)
This method changes the value set via the constructor, allowing subsequent calls to
getObjectList()
method to retrieve a different list of objects.
system
- The system upon which the user resides.public AS400 getSystem()
public void setUserName(java.lang.String userName)
This method changes the value set via the constructor, allowing subsequent calls to
getObjectList()
method to retrieve a different list of objects.
userName
- The user name which owns (or is authorized to) the objects to be returned.public java.lang.String getUserName()
public void setSelectionFileSystem(int selectionFileSystem)
This method changes the value set via the constructor, allowing subsequent calls to
getObjectList()
method to retrieve a different list of objects.
selectionFileSystem
- The format name. Valid values:
SELECTION_FILE_SYSTEM_LIBRARY
- objects that reside in an IBM i library
SELECTION_FILE_SYSTEM_DIRECTORY
- objects that reside in an IBM i directory
public int getSelectionFileSystem()
SELECTION_FILE_SYSTEM_LIBRARY
- objects that reside in an IBM i library
SELECTION_FILE_SYSTEM_DIRECTORY
- objects that reside in an IBM i directory
public void setSelectionObjectRelation(int selectionObjectRelation)
This method changes the value set via the constructor, allowing subsequent calls to
getObjectList()
method to retrieve a different list of objects.
selectionObjectRelation
- Which objects are to be selected . Valid values:
SELECTION_OBJECT_RELATION_AUTHORIZED
- select a list of objects the user is authorized to
SELECTION_OBJECT_RELATION_OWNED
- select a list of objects the user owns
SELECTION_OBJECT_RELATION_OWNED_OR_AUTHORIZED
- select a list of objects the user is authorized to and a list of objects the user owns
public int getSelectionObjectRelation()
SELECTION_OBJECT_RELATION_AUTHORIZED
- select a list of objects the user is authorized to
SELECTION_OBJECT_RELATION_OWNED
- select a list of objects the user owns
SELECTION_OBJECT_RELATION_OWNED_OR_AUTHORIZED
- select a list of objects the user is authorized to and a list of objects the user owns
public java.lang.String toString()
toString
in class java.lang.Object