public class ValidationList
extends java.lang.Object
Note: The ability to find and modify the list is dependent on the access rights of the signed-on user profile to the validation list.
Constructor and Description |
---|
ValidationList()
Constructs a validation list.
|
ValidationList(AS400 as400)
Constructs a validation list for the given system.
|
ValidationList(AS400 as400,
QSYSObjectPathName path)
Constructs a validation list for the given system and path.
|
ValidationList(AS400 as400,
java.lang.String obj,
java.lang.String lib)
Constructs a validation list for the given system
and object/library names.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(ValidationListEntry entry)
Adds the entry to the validation list.
|
void |
changeEntry(ValidationListEntry entry)
Alters the entry in the validation list.
|
void |
create()
Creates the validation list on the IBM i system.
|
void |
delete()
Deletes the validation list from the IBM i system.
|
ValidationListEntry |
findEntry(java.lang.String identifier,
int ccsid)
Returns an entry from the validation list with the given identifier.
|
ValidationListEntry |
findEntry(java.lang.String identifier,
int ccsid,
ValidationListAttribute[] attributes)
Returns an entry from the validation list with the given identifier and attributes.
|
AS400 |
getAS400()
Returns the IBM i system containing the validation list.
|
java.lang.String |
getDescription()
Returns the text description for the validation list object.
|
ValidationListEntry[] |
getEntries()
Returns all entries from the validation list.
|
int |
getNumberOfEntries()
Returns the number of entries in the validation list.
|
QSYSObjectPathName |
getPath()
Returns the location (library context) of the validation list.
|
protected ProgramParameter |
getQualifiedNameParm()
Returns a program parameter to be used for IBM i Toolbox program calls that
require the qualifed name of the validation list.
|
void |
removeEntry(ValidationListEntry entry)
Deletes the entry from the validation list.
|
void |
setAS400(AS400 as400)
Sets the IBM i system containing the validation list.
|
void |
setDescription(java.lang.String s)
Sets the text description for the validation list object.
|
void |
setPath(QSYSObjectPathName path)
Sets the location (library context) of the validation list.
|
boolean |
verifyEntry(ValidationListEntry entry)
Verify that the encrypted information specified for the given entry is correct.
|
public ValidationList()
Note: The AS400 and Path properties must be set prior to taking action against the object.
public ValidationList(AS400 as400)
Note: The Path property must be set prior to taking action against the object.
as400
- the systempublic ValidationList(AS400 as400, QSYSObjectPathName path)
as400
- com.ibm.as400.access.AS400path
- com.ibm.as400.access.QSYSObjectPathNamepublic ValidationList(AS400 as400, java.lang.String obj, java.lang.String lib)
as400
- com.ibm.as400.access.AS400obj
- java.lang.Stringlib
- java.lang.Stringpublic void addEntry(ValidationListEntry entry) throws PersistenceException
entry
- ValidationListEntryPersistenceException
- If an error occurs while calling the IBM i APIs.public void changeEntry(ValidationListEntry entry) throws PersistenceException
entry
- ValidationListEntryPersistenceException
- If an error occurs while calling the IBM i APIs.public void create() throws PersistenceException
PersistenceException
- If an error occurs while calling the IBM i command.public void delete() throws PersistenceException
PersistenceException
- If an error occurs while calling the IBM i command.public ValidationListEntry findEntry(java.lang.String identifier, int ccsid) throws PersistenceException
The ccsid parameter indicates the ccsid used to store the identifier in the entry on the IBM i system. This apparently needs to be an exact match in order to find the entry as it was originally inserted.
No attribute values are retrieved for the entry.
identifier
- java.lang.Stringccsid
- intPersistenceException
- If an error occurs while calling the IBM i APIs.public ValidationListEntry findEntry(java.lang.String identifier, int ccsid, ValidationListAttribute[] attributes) throws PersistenceException
The ccsid parameter indicates the ccsid used to store the identifier in the entry on the IBM i system. This apparently needs to be an exact match in order to find the entry as it was originally inserted.
The attributes parameter indicates the list of attributes to retrieve for the entry. Each attribute specified must contain a valid identifier.
identifier
- java.lang.Stringccsid
- intattributes
- ValidationListAttribute[]PersistenceException
- If an error occurs while calling the IBM i APIs.public AS400 getAS400()
public java.lang.String getDescription()
Note: Only returned if set by the setDescription()
method.
public ValidationListEntry[] getEntries() throws PersistenceException
Note: The list is opened by the initial call to the list API. In doing so, the entire contents of the list is retrieved as a snapshot and stored in a buffer on the IBM i system. The list contents can then be retrieved from the pre-filled buffer, in whole or in part, at the convenience of the application by using a system-provided handle. The handle is used to close the list when the application has completed processing of all entries.
Currently the entire list is built and retrieved synchronously by this method. This could potentially be changed to allow for additional processing options, such as asynchronous building of the list, retrieving only a subset of entries, etc. For now we just keep it simple.
PersistenceException
- If an error occurs while calling the IBM i APIs.public int getNumberOfEntries() throws PersistenceException
PersistenceException
- If an error occurs while calling the IBM i APIs.public QSYSObjectPathName getPath()
protected ProgramParameter getQualifiedNameParm()
The object name is set into the first 10 bytes of the parameter value. The library name is set into the next 10 bytes of the parameter value.
public void removeEntry(ValidationListEntry entry) throws PersistenceException
Note: The AS400 and Path properties must be set prior to calling this method.
entry
- ValidationListEntryPersistenceException
- If an error occurs while calling the IBM i validation list APIs.public void setAS400(AS400 as400)
as400
- com.ibm.as400.access.AS400public void setDescription(java.lang.String s)
Note: Only recognized if set prior to invoking the create()
method.
s
- java.lang.Stringpublic void setPath(QSYSObjectPathName path)
path
- com.ibm.as400.access.QSYSObjectPathNamepublic boolean verifyEntry(ValidationListEntry entry) throws PersistenceException
The EntryID and DataToEncrypt must be specified for the entry prior to verification. Returns true if the data to encrypt matches the data already encrypted for the entry at that ID on the IBM i; otherwise returns false.
entry
- ValidationListEntryPersistenceException
- If an error occurs while calling the IBM i APIs.