public class Permission
extends java.lang.Object
implements java.io.Serializable
AS400 as400 = new AS400(); Permission permission = new Permission(as400,"/QSYS.LIB/QJAVA.LIB"); permission.addAuthorizedUser("user1"); QSYSPermission userPermission = (QSYSPermission)permission.getUserPermission("user1"); userPermission.setObjectAuthority("*CHANGE"); permission.commit();
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_DLO
Constant indicating the object is a Document Library Objects (DLO)
stored in QDLS.
|
static int |
TYPE_QSYS
Constant indicating the object is contained in the system library
structure and stored in QSYS.LIB.
|
static int |
TYPE_ROOT
Constant indicating that the object is contained in the root directory
structure.
|
Constructor and Description |
---|
Permission(AS400 as400,
java.lang.String fileName)
Constructs a Permission object.
|
Permission(AS400 as400,
java.lang.String fileName,
boolean pathMayStartWithIASP)
Constructs a Permission object.
|
Permission(AS400 as400,
java.lang.String fileName,
boolean pathMayStartWithIASP,
boolean followLinks)
Constructs a Permission object.
|
Permission(IFSFile file)
Constructs a Permission object.
|
Permission(IFSFile file,
boolean pathMayStartWithIASP)
Constructs a Permission object.
|
Permission(IFSFile file,
boolean pathMayStartWithIASP,
boolean followLinks)
Constructs a Permission object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAuthorizedUser(java.lang.String userProfileName)
Adds an authorized user.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener.
|
void |
addUserPermission(UserPermission userPermission)
Adds a user permission.
|
void |
commit()
Commits the permission changes to the system.
|
java.lang.String |
getAuthorizationList()
Returns the authorizations list of the object.
|
java.util.Enumeration |
getAuthorizedUsers()
Returns an enumeration of authorized users.
|
java.lang.String |
getName()
Returns the name of the object whose permission is represented by this object.
|
java.lang.String |
getObjectPath()
Returns the path of the integrated file system object whose permission is represented by this object.
|
java.lang.String |
getOwner()
Returns the object owner.
|
java.lang.String |
getPrimaryGroup()
Returns the primary group of the object.
|
int |
getSensitivityLevel()
Returns the sensitivity level of the object.
|
AS400 |
getSystem()
Returns the system
|
int |
getType()
Returns the object type.
|
UserPermission |
getUserPermission(java.lang.String userProfileName)
Returns a UserPermission object for the specified user.
|
java.util.Enumeration |
getUserPermissions()
Returns an enumeration of UserPermission objects.
|
boolean |
isCommitted()
Returns a flag indicating whether the change has been committed.
|
boolean |
isFollowSymbolicLinks()
Returns whether symbolic links are resolved when changing or retrieving permissions.
|
void |
removeAuthorizedUser(java.lang.String userProfileName)
Removes an authorized user.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener.
|
void |
removeUserPermission(UserPermission permission)
Removes a user permission.
|
void |
setAuthorizationList(java.lang.String autList)
Sets the authorizations list of the object.
|
void |
setOwner(java.lang.String owner,
boolean revokeOldAuthority)
Sets the owner of the object.
|
void |
setPrimaryGroup(java.lang.String primaryGroup,
boolean revokeOldAuthority)
Sets the primary group of the object.
|
void |
setSensitivityLevel(int sensitivityLevel)
Sets the sensitivity level of the object.
|
void |
setSystem(AS400 system)
Deprecated.
This method is of little (or no) known usefulness. If you require this method, please notify the Toolbox support team.
|
public static final int TYPE_DLO
public static final int TYPE_QSYS
public static final int TYPE_ROOT
public Permission(IFSFile file) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
file
- The IFSFile object. For example, The IFSFile object which represents the object "QSYS.LIB/FRED.LIB".AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 system object does not exist.java.io.UnsupportedEncodingException
- If the Character Encoding is not supported.public Permission(IFSFile file, boolean pathMayStartWithIASP) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
Use the independent auxiliary storage pool (IASP) parameter to indicate if the path name can contain an IASP name. If true, the name will be parsed as if the name starts with an IASP name. If false, the name is treated as an ordinary path. For example, suppose the path is "/myIASP/QSYS.LIB/MYLIB.LIB". If the IASP parameter is true the object is treated as library "MYLIB" on IASP "myIASP". If the IASP parameter is false the object is treated as object "MYLIB.LIB" in directory "/myIASP/QSYS.LIB" in the root file system. Note the IASP parameter is used only if the second component of the path is QSYS.LIB. If the second component of the path is not QSYS.LIB, the parameter is ignored.
file
- The IFSFile object. For example, The IFSFile object which represents the object "QSYS.LIB/FRED.LIB".pathMayStartWithIASP
- True if the path may start with an
independent auxiliary storage pool (IASP) name; false otherwise.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 system object does not exist.java.io.UnsupportedEncodingException
- If the Character Encoding is not supported.public Permission(IFSFile file, boolean pathMayStartWithIASP, boolean followLinks) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
Use the independent auxiliary storage pool (IASP) parameter to indicate if the path name can contain an IASP name. If true, the name will be parsed as if the name starts with an IASP name. If false, the name is treated as an ordinary path. For example, suppose the path is "/myIASP/QSYS.LIB/MYLIB.LIB". If the IASP parameter is true the object is treated as library "MYLIB" on IASP "myIASP". If the IASP parameter is false the object is treated as object "MYLIB.LIB" in directory "/myIASP/QSYS.LIB" in the root file system. Note the IASP parameter is used only if the second component of the path is QSYS.LIB. If the second component of the path is not QSYS.LIB, the parameter is ignored.
file
- The IFSFile object. For example, The IFSFile object which represents the object "QSYS.LIB/FRED.LIB".pathMayStartWithIASP
- True if the path may start with an
independent auxiliary storage pool (IASP) name; false otherwise.followLinks
- Whether symbolic links are resolved.
The default value is true; that is, symbolic links are always resolved.
By default, if the IBM i object is a symbolic link, then the requested action
is performed on the object that is ultimately pointed to by the symbolic link,
rather than on the symbolic link itself.
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 system object does not exist.java.io.UnsupportedEncodingException
- If the Character Encoding is not supported.public Permission(AS400 as400, java.lang.String fileName) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
as400
- The system.fileName
- The full path of the object. For example, "/QSYS.LIB/FRED.LIB".AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 system object does not exist.java.io.UnsupportedEncodingException
- If the Character Encoding is not supported.public Permission(AS400 as400, java.lang.String fileName, boolean pathMayStartWithIASP) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
Use the independent auxiliary storage pool (IASP) parameter to indicate if the path name can contain an IASP name. If true, the name will be parsed as if the name starts with an IASP name. If false, the name is treated as an ordinary path. For example, suppose the path is "/myIASP/QSYS.LIB/MYLIB.LIB". If the IASP parameter is true the object is treated as library "MYLIB" on IASP "myIASP". If the IASP parameter is false the object is treated as object "MYLIB.LIB" in directory "/myIASP/QSYS.LIB" in the root file system. Note the IASP parameter is used only if the second component of the path is QSYS.LIB. If the second component of the path is not QSYS.LIB, the parameter is ignored.
as400
- The system.fileName
- The full path of the object. For example, "/QSYS.LIB/FRED.LIB".pathMayStartWithIASP
- True if the path may start with an
independent auxiliary storage pool (IASP) name; false otherwise.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 system object does not exist.java.io.UnsupportedEncodingException
- If the Character Encoding is not supported.public Permission(AS400 as400, java.lang.String fileName, boolean pathMayStartWithIASP, boolean followLinks) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
Use the independent auxiliary storage pool (IASP) parameter to indicate if the path name can contain an IASP name. If true, the name will be parsed as if the name starts with an IASP name. If false, the name is treated as an ordinary path. For example, suppose the path is "/myIASP/QSYS.LIB/MYLIB.LIB". If the IASP parameter is true the object is treated as library "MYLIB" on IASP "myIASP". If the IASP parameter is false the object is treated as object "MYLIB.LIB" in directory "/myIASP/QSYS.LIB" in the root file system. Note the IASP parameter is used only if the second component of the path is QSYS.LIB. If the second component of the path is not QSYS.LIB, the parameter is ignored.
as400
- The system.fileName
- The full path of the object. For example, "/QSYS.LIB/FRED.LIB".pathMayStartWithIASP
- True if the path may start with an
independent auxiliary storage pool (IASP) name; false otherwise.followLinks
- Whether symbolic links are resolved.
The default value is true; that is, symbolic links are always resolved.
By default, if the IBM i object is a symbolic link, then the requested action
is performed on the object that is ultimately pointed to by the symbolic link,
rather than on the symbolic link itself.
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 system object does not exist.java.io.UnsupportedEncodingException
- If the Character Encoding is not supported.public void addAuthorizedUser(java.lang.String userProfileName)
userProfileName
- The authorized user profile name.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The property change listener to add.public void addUserPermission(UserPermission userPermission)
userPermission
- The UserPermission object.public void commit() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 system object does not exist.ServerStartupException
- If the host server cannot be started.public java.lang.String getAuthorizationList()
setAuthorizationList(String)
public java.util.Enumeration getAuthorizedUsers()
public java.lang.String getObjectPath()
public java.lang.String getName()
public java.lang.String getOwner()
public java.lang.String getPrimaryGroup()
public int getSensitivityLevel()
setSensitivityLevel(int)
public AS400 getSystem()
public int getType()
public UserPermission getUserPermission(java.lang.String userProfileName)
userProfileName
- The name of the user profile.public java.util.Enumeration getUserPermissions()
public boolean isCommitted()
public boolean isFollowSymbolicLinks()
public void removeAuthorizedUser(java.lang.String userProfileName)
userProfileName
- The authorized user profile name.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The property change listener to remove.public void removeUserPermission(UserPermission permission)
permission
- The UserPermission object.public void setAuthorizationList(java.lang.String autList)
Permission permisson = new Permisson(new AS400(),"/QSYS.LIB/FRED.LIB"; permission.setAuthorizationList("testautl"); System.out.println("The authorization list of fred.lib is " + permissin.geAuthorizationList(); permission.setAuthorizationList("*NONE"); System.out.println("The authorization list of fred.lib is " + permissin.geAuthorizationList();
autList
- The authorizations list of the object.public void setOwner(java.lang.String owner, boolean revokeOldAuthority)
owner
- The owner of the object.revokeOldAuthority
- Specifies whether the authorities for the current
owner are revoked when ownership is transferred to the new owner.getOwner()
public void setPrimaryGroup(java.lang.String primaryGroup, boolean revokeOldAuthority)
primaryGroup
- The primary group of the object.revokeOldAuthority
- Specifies whether the authorities for the current
primary group are revoked when the primary group is changed to the new value.public void setSensitivityLevel(int sensitivityLevel)
sensitivityLevel
- The sensitivity level of the object. The
possible values :
getSensitivityLevel()
public void setSystem(AS400 system)
system
- The system object.getSystem()