|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.resource.Resource
com.ibm.as400.resource.ChangeableResource
com.ibm.as400.access.NetServerShare
com.ibm.as400.access.NetServerFileShare
ISeriesNetServerFileShare
class and may be removed in a future release.
The NetServerFileShare class represents a NetServer file server share.
NetServerFileShare objects are created and returned by NetServer.listFileShares()
.
Note: This class uses some API fields that are not available prior to OS/400 V5R1.
Note: The methods that add or change NetServer File Shares are not supported prior to OS/400 V5R1.
The following attribute IDs are supported:
Use any of the above attribute IDs with
Note: Typically, methods which add, change, or remove a NetServerFileShare require that the server user profile has *IOSYSCFG special authority, or that the user own the integrated file system directory.
getAttributeValue
and
setAttributeValue
to access the attribute values for a NetServerFileShare.
Note: For the above attributes, getAttributeValue() should never return null.
For String-valued attributes, if the current actual value of the corresponding property on the server is blank, getAttributeValue() will return "" (an empty String).
import com.ibm.as400.access.*;
import com.ibm.as400.resource.*;
// Create a NetServer object for a specific server system.
AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD");
NetServer ns = new NetServer(system);
try
{
// List all current file shares.
System.out.println("File shares:");
ResourceList shareList = ns.listFileShares();
shareList.waitForComplete();
for (int i=0; i<shareList.getListLength(); i++)
{
NetServerFileShare share = (NetServerFileShare)shareList.resourceAt(i);
System.out.println(share.getName() + ": " +
(String)share.getAttributeValue(NetServerFileShare.PATH) + ": " +
(String)share.getAttributeValue(NetServerFileShare.DESCRIPTION) + "; " +
((Integer)share.getAttributeValue(NetServerFileShare.USER_COUNT))
.intValue() );
}
}
catch (ResourceException e) {
e.printStackTrace();
}
finally {
if (system != null) system.disconnectAllServices();
}
Field Summary | |
---|---|
static String |
MAXIMUM_USERS
Deprecated. Attribute ID for "maximum users". |
static String |
PATH
Deprecated. Attribute ID for "path". |
static String |
PERMISSION
Deprecated. Attribute ID for "permission". |
static Integer |
PERMISSION_READ_ONLY
Deprecated. PERMISSION attribute value indicating "read only" permission to a share. |
static Integer |
PERMISSION_READ_WRITE
Deprecated. PERMISSION attribute value indicating "read/write" permission to a share. |
Fields inherited from class com.ibm.as400.access.NetServerShare |
---|
DESCRIPTION, USER_COUNT |
Constructor Summary | |
---|---|
NetServerFileShare()
Deprecated. Constructs a NetServerFileShare object. |
|
NetServerFileShare(AS400 system,
String name)
Deprecated. Constructs a NetServerFileShare object. |
Method Summary | |
---|---|
void |
add()
Deprecated. Adds the file server share to the NetServer. |
protected void |
commitAttributeChanges(Object[] attributeIDs,
Object[] values)
Deprecated. Commits the specified attribute changes. |
protected void |
establishConnection()
Deprecated. Establishes the connection to the server. |
Methods inherited from class com.ibm.as400.access.NetServerShare |
---|
freezeProperties, getAttributeUnchangedValue, getName, listConnections, refreshAttributeValues, remove, setName |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String MAXIMUM_USERS
public static final String PATH
public static final String PERMISSION
PERMISSION_READ_ONLY
- Read-only permission.
PERMISSION_READ_WRITE
- Read/write permission.
public static final Integer PERMISSION_READ_ONLY
PERMISSION
attribute value indicating "read only" permission to a share.
public static final Integer PERMISSION_READ_WRITE
PERMISSION
attribute value indicating "read/write" permission to a share.
Constructor Detail |
public NetServerFileShare()
public NetServerFileShare(AS400 system, String name)
name
- The name of the share.Method Detail |
public void add() throws ResourceException
PATH
attribute must be set before this method is called.
commitAttributeChanges
must not be called prior to this method.
add
in class NetServerShare
ResourceException
- If an error occurs.protected void commitAttributeChanges(Object[] attributeIDs, Object[] values) throws ResourceException
commitAttributeChanges
in class NetServerShare
ResourceException
- If an error occurs.protected void establishConnection() throws ResourceException
The method is called by the resource framework automatically when the connection needs to be established.
establishConnection
in class NetServerShare
ResourceException
- If an error occurs.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |