com.ibm.as400.access

Class UserObjectsOwnedList

  • java.lang.Object
    • com.ibm.as400.access.UserObjectsOwnedList


  • public class UserObjectsOwnedList
    extends java.lang.Object
    Allows you to retrieve a list of IBM i objects that a user is authorized to and/or list of IBM i objects that the user owns.
    Refer to the QSYLOBJA API for additional information.

    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:

    • The user is part of a group that is authorized
    • The user can access the object using the public authority
    • The object is secured with an authorization list the user is authorized to
    • The user can access the object using adopted authority

    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]);
          }      
    
    See Also:
    User.getObjectsOwned()
    • Constructor Summary

      Constructors 
      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.
    • Method Summary

      Methods 
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • SELECTION_FILE_SYSTEM_LIBRARY

        public static final int SELECTION_FILE_SYSTEM_LIBRARY
        Selection value indicating to select IBM i objects that reside in the QSYS library based file system.
        See Also:
        Constant Field Values
      • SELECTION_FILE_SYSTEM_DIRECTORY

        public static final int SELECTION_FILE_SYSTEM_DIRECTORY
        Selection value indicating to select IBM i objects that reside in a directory (non-QSYS) based file system.
        See Also:
        Constant Field Values
      • SELECTION_OBJECT_RELATION_AUTHORIZED

        public static final int SELECTION_OBJECT_RELATION_AUTHORIZED
        Selection value indicating to select the list of objects the user is authorized to
        See Also:
        Constant Field Values
      • SELECTION_OBJECT_RELATION_OWNED

        public static final int SELECTION_OBJECT_RELATION_OWNED
        Selection value indicating to select the list of objects the user owns.
        See Also:
        Constant Field Values
      • SELECTION_OBJECT_RELATION_OWNED_OR_AUTHORIZED

        public static final 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.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserObjectsOwnedList

        public UserObjectsOwnedList(AS400 system,
                            java.lang.String userName)
        Constructs a UserObjectsOwnedList object.
        You must call getObjectList() method to retrieve the object list.
        Default values are set to select library based objects which the user owns.
        The selectionFileSystem parameter defaults to SELECTION_FILE_SYSTEM_LIBRARY, the selectionObjectRelation parameter defaults to SELECTION_OBJECT_RELATION_OWNED.
        Parameters:
        system - The system upon which the user resides.
        userName - The user name which owns the objects to be returned.
      • UserObjectsOwnedList

        public UserObjectsOwnedList(AS400 system,
                            java.lang.String userName,
                            int selectionFileSystem,
                            int selectionObjectRelation)
        Constructs a UserObjectsOwnedList object.
        You must call getObjectList() method to retrieve the object list.
        Parameters:
        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:
        selectionObjectRelation - The objects to return. Possible values are:
    • Method Detail

      • setSystem

        public 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.

        This method changes the value set via the constructor, allowing subsequent calls to getObjectList() method to retrieve a different list of objects.

        Parameters:
        system - The system upon which the user resides.
      • getSystem

        public 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.
        Returns:
        The system upon which the user resides.
      • setUserName

        public 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.

        This method changes the value set via the constructor, allowing subsequent calls to getObjectList() method to retrieve a different list of objects.

        Parameters:
        userName - The user name which owns (or is authorized to) the objects to be returned.
      • getUserName

        public 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.
        Returns:
        The user name which owns (or is authorized to) the objects to be returned.
      • setSelectionFileSystem

        public 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.

        This method changes the value set via the constructor, allowing subsequent calls to getObjectList() method to retrieve a different list of objects.

        Parameters:
        selectionFileSystem - The format name. Valid values:
      • getSelectionFileSystem

        public 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.
        Returns:
        the selection file system. Possible values:
      • setSelectionObjectRelation

        public void setSelectionObjectRelation(int selectionObjectRelation)
        Sets which objects are to be selected (indicating objects authorized to, objects owned, or both).

        This method changes the value set via the constructor, allowing subsequent calls to getObjectList() method to retrieve a different list of objects.

        Parameters:
        selectionObjectRelation - Which objects are to be selected . Valid values:
      • getSelectionObjectRelation

        public 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.
        Returns:
        the selection object relation. Possible values:
      • toString

        public java.lang.String toString()
        Returns a string representation of this object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string with the system, userName, selectionFileSystem, and selectionObjectRelation