|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.UserSpace
The UserSpace class represents a user space on the AS/400.
Field Summary | |
static int |
FORCE_ASYNCHRONOUS
Force to Auxiliary Storage option that allow changes to be forced asynchronously. |
static int |
FORCE_NONE
Force to Auxiliary Storage option that does not allow changes to be forced. |
static int |
FORCE_SYNCHRONOUS
Force to Auxiliary Storage option that allow changes to be forced synchronously. |
Constructor Summary | |
UserSpace()
Constructs a UserSpace object. |
|
UserSpace(AS400 system,
java.lang.String path)
Constructs a UserSpace object. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property is changed. |
void |
addUserSpaceListener(UserSpaceListener listener)
Adds a listener to be notified when a UserSpaceEvent is fired. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property is changed. |
void |
close()
Closes the user space and releases any system resources associated with the stream. |
void |
create(int length,
boolean replace,
java.lang.String extendedAttribute,
byte initialValue,
java.lang.String textDescription,
java.lang.String authority)
Creates the user space. |
void |
create(java.lang.String domain,
int length,
boolean replace,
java.lang.String extendedAttribute,
byte initialValue,
java.lang.String textDescription,
java.lang.String authority)
Creates the user space. |
void |
delete()
Deletes the user space. |
boolean |
exists()
Determines if the user space exists. |
byte |
getInitialValue()
Returns the initial value used for filling in the user space during creation and extension. |
int |
getLength()
Returns the size in bytes of the user space. |
java.lang.String |
getName()
Returns the user space name. |
java.lang.String |
getPath()
Returns the integrated file system path name of the object represented by the user space. |
AS400 |
getSystem()
Returns the AS400 system object for the user space. |
boolean |
isAutoExtendible()
Indicates if the user space is auto extendible. |
boolean |
isMustUseProgramCall()
Indicates if Toolbox ProgramCall will be used internally to perform user space read and write requests. |
int |
read(byte[] dataBuffer,
int userSpaceOffset)
Reads up to dataBuffer.length bytes from the user space beginning at userSpaceOffset into dataBuffer. |
int |
read(byte[] dataBuffer,
int userSpaceOffset,
int dataOffset,
int length)
Reads up to length bytes from the user space beginning at userSpaceOffset into dataBuffer beginning at dataOffset. |
java.lang.String |
read(int userSpaceOffset,
int length)
Returns a string from the user space beginning at userSpaceOffset. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes this listener from being notified when a bound property changes. |
void |
removeUserSpaceListener(UserSpaceListener listener)
Removes a listener from the UserSpace listeners list. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes this listener from being notified when a constrained property changes. |
void |
setAutoExtendible(boolean autoExtendibility)
Sets the auto extend attribute if possible. |
void |
setInitialValue(byte initialValue)
Sets the initial value to be used during user space creation or extension. |
void |
setLength(int length)
Sets the size of the user space. |
void |
setMustUseProgramCall(boolean useProgramCall)
Sets the method used to carry out user space read and write operations. |
void |
setPath(java.lang.String path)
Sets the path for the user space. |
void |
setSystem(AS400 system)
Sets the AS400 system for the user space. |
void |
write(byte[] dataBuffer,
int userSpaceOffset)
Writes up to dataBuffer.length bytes from dataBuffer into the user space beginning at userSpaceOffset. |
void |
write(byte[] dataBuffer,
int userSpaceOffset,
int dataOffset,
int length)
Writes up to length bytes from dataBuffer beginning at dataOffset into the user space beginning at userSpaceOffset. |
void |
write(byte[] dataBuffer,
int userSpaceOffset,
int dataOffset,
int length,
int forceAuxiliary)
Writes up to length bytes from dataBuffer beginning at dataOffset into the user space beginning at userSpaceOffset. |
void |
write(java.lang.String data,
int userSpaceOffset)
Writes a string into the user space beginning at userSpaceOffset. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int FORCE_ASYNCHRONOUS
public static final int FORCE_NONE
public static final int FORCE_SYNCHRONOUS
Constructor Detail |
public UserSpace()
public UserSpace(AS400 system, java.lang.String path)
system
- The AS400 that contains the file.path
- The fully qualified integrated file system path name.Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.public void addUserSpaceListener(UserSpaceListener listener)
listener
- The object listener.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.public void close() throws java.io.IOException
public void create(int length, boolean replace, java.lang.String extendedAttribute, byte initialValue, java.lang.String textDescription, java.lang.String authority) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
length
- The initial size in bytes of the user space.
Valid values are 1 through 16,776,704.replace
- The value indicating if an existing user space is to be replaced.extendedAttribute
- The user-defined extended attribute of the user space. This string must be 10 characters or less.initialValue
- The value used in creation and extension.textDescription
- The text describing the user space. This string must be 50 characters or less.authority
- The public authority for the user space. This string must be 10 characters or less.
Valid values are:
public void create(java.lang.String domain, int length, boolean replace, java.lang.String extendedAttribute, byte initialValue, java.lang.String textDescription, java.lang.String authority) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
domain
- The domain into which the user space is created.
Valid value are: *DEFAULT, *USER, or *SYSTEM.
DEFAULT uses the allow user domain system value to determine if *USER or *SYSTEM will be used.length
- The initial size in bytes of the user space.
Valid values are 1 through 16,776,704.replace
- The value indicating if an existing user space is to be replaced.extendedAttribute
- The user-defined extended attribute of the user space. This string must be 10 characters or less.initialValue
- The value used in creation and extension.textDescription
- The text describing the user space. This string must be 50 characters or less.authority
- The authority given to users. This string must be 10 characters or less.
Valid values are:
public void delete() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
public boolean exists() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException
public byte getInitialValue() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
public int getLength() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
public java.lang.String getName()
public java.lang.String getPath()
public AS400 getSystem()
public boolean isAutoExtendible() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
public boolean isMustUseProgramCall()
setMustUseProgramCall(boolean)
public int read(byte[] dataBuffer, int userSpaceOffset) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
dataBuffer
- The buffer to fill with data. Buffer.length()
bytes will be read from the user space.userSpaceOffset
- The offset in the user space from which to start reading.public int read(byte[] dataBuffer, int userSpaceOffset, int dataOffset, int length) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
dataBuffer
- The buffer to fill with data.userSpaceOffset
- The offset in the user space from which to start reading.dataOffset
- The starting offset in the data buffer for the results of the read.length
- The number of bytes to read.public java.lang.String read(int userSpaceOffset, int length) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
userSpaceOffset
- The offset in the user space from which to start reading.length
- The number of bytes to read.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.public void removeUserSpaceListener(UserSpaceListener listener)
listener
- The user space listener.public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.public void setAutoExtendible(boolean autoExtendibility) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
autoExtendibility
- The attribute for user space auto extendibility.public void setInitialValue(byte initialValue) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
initialValue
- The new initial value used during future extensions.
For best performance set byte to hexadecimal zeros.public void setLength(int length) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
length
- The new size of the user space.public void setMustUseProgramCall(boolean useProgramCall)
useProgramCall
- Internally use ProgramCall to carry out
read and write requests.public void setPath(java.lang.String path) throws java.beans.PropertyVetoException
path
- The fully qualified integrated file system path name.public void setSystem(AS400 system) throws java.beans.PropertyVetoException
system
- The AS400 system.public void write(byte[] dataBuffer, int userSpaceOffset) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
dataBuffer
- The data buffer to be written.userSpaceOffset
- The position in the user space to start writing.public void write(byte[] dataBuffer, int userSpaceOffset, int dataOffset, int length) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
dataBuffer
- The data buffer to be written.userSpaceOffset
- The position in the user space to start writing.dataOffset
- The position in the write data buffer from which to start copying.length
- The length of data to be written.public void write(byte[] dataBuffer, int userSpaceOffset, int dataOffset, int length, int forceAuxiliary) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
dataBuffer
- The data buffer to be written to the user space.userSpaceOffset
- The position in the user space to start writing.dataOffset
- The position in the write data buffer from which to start copying.length
- The length of data to be written.forceAuxiliary
- The method of forcing changes made to the user space to
auxiliary storage. Valid values are:
public void write(java.lang.String data, int userSpaceOffset) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
data
- The data buffer to be written to the user space.userSpaceOffset
- The position in the user space to start writing.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |