com.ibm.as400.access
Class ValidationListDataToEncrypt

java.lang.Object
  extended bycom.ibm.as400.access.ValidationListTranslatedData
      extended bycom.ibm.as400.access.ValidationListDataToEncrypt

public class ValidationListDataToEncrypt
extends ValidationListTranslatedData

Copyright © 2001, International Business Machines Corporation and others. All Rights Reserved.

The ValidationListDataToEncrypt class is used to specify the data to encrypt when adding or changing a validation list entry.

Author:
Thomas Johnson (tom.johnson@kingland.com), Kingland Systems Corporation

Constructor Summary
ValidationListDataToEncrypt()
          Constructs a ValidationListTranslatedData.
ValidationListDataToEncrypt(byte[] buffer, int offset)
          Constructs a ValidationListTranslatedData from a structure stored as server bytes.
ValidationListDataToEncrypt(int ccsid, byte[] bytes)
          Constructs a ValidationListTranslatedData from the specified server bytes which are encoded in the given ccsid.
ValidationListDataToEncrypt(String s, int ccsid, AS400 as400)
          Constructs a ValidationListTranslatedData from the given string.
 
Method Summary
protected  int getWriteNullDataLength()
          Returns the length to be specified in the written server byte structure if the assigned data is null.
 
Methods inherited from class com.ibm.as400.access.ValidationListTranslatedData
getByteLength, getBytes, getCcsid, getReadOffsetCcsid, getReadOffsetTByteLength, getReadOffsetTBytes, getString, getWriteOffsetCcsid, getWriteOffsetTByteLength, getWriteOffsetTBytes, isValidCcsid, setBytes, setBytes, setCcsid, toBytes, toBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationListDataToEncrypt

public ValidationListDataToEncrypt()
Constructs a ValidationListTranslatedData.


ValidationListDataToEncrypt

public ValidationListDataToEncrypt(byte[] buffer,
                                   int offset)
Constructs a ValidationListTranslatedData from a structure stored as server bytes.

The offset indicates the starting position of the structure in the given buffer.

Parameters:
buffer - byte[]
offset - int

ValidationListDataToEncrypt

public ValidationListDataToEncrypt(int ccsid,
                                   byte[] bytes)
Constructs a ValidationListTranslatedData from the specified server bytes which are encoded in the given ccsid.

Parameters:
ccsid - int
bytes - byte[]

ValidationListDataToEncrypt

public ValidationListDataToEncrypt(String s,
                                   int ccsid,
                                   AS400 as400)
Constructs a ValidationListTranslatedData from the given string.

The translated bytes are derived by converting the string to server bytes using the given ccsid. The as400 is required to perform the conversion from text to bytes. A ccsid of 0 indicates to use the ccsid of the current user.

Parameters:
s - java.lang.String
ccsid - int
as400 - com.ibm.as400.access.AS400
Method Detail

getWriteNullDataLength

protected int getWriteNullDataLength()
Returns the length to be specified in the written server byte structure if the assigned data is null.

Typically this value is 0. However, there are some cases where other values must be returned to maintain proper behavior. For example, when changing an entry a structure must be specified for the data to encrypt, even if the encrypted data should not be changed. However, if the data length in the structure is set to 0 instead of -1, the existing encrypted data is wiped out. This is undesirable since we don't always want the encrypted data changed. We might want to modify the unencrypted data (i.e. user statistics) while leaving the encrypted data (i.e. user password) unchanged.

Overrides:
getWriteNullDataLength in class ValidationListTranslatedData
Returns:
int