public class SharedDevice extends Object implements Comparable<SharedDevice>
The shared device class is the base class for all shared device implementations.
Modifier and Type | Field and Description |
---|---|
static int |
Admin |
static int |
Hidden |
static int |
ReadOnly |
static int |
Temporary |
Modifier | Constructor and Description |
---|---|
protected |
SharedDevice(String name,
int typ,
DeviceContext ctx)
SharedDevice constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAccessControl(AccessControl acl)
Add an access control to the shared device
|
int |
compareTo(SharedDevice sd)
Compare this shared device to another shared device using the device name
|
DeviceContext |
createContext(String[] args)
Parse and validate the parameters string and create a device context for the
shared device.
|
void |
decrementConnectionCount()
Decrement the connection count for the share
|
boolean |
equals(Object obj)
Compares two objects for equality.
|
AccessControlList |
getAccessControls()
Return the access control list
|
int |
getAttributes()
Return the shared device attribtues.
|
String |
getComment()
Return the shared device comment.
|
ServerConfiguration |
getConfiguration()
Return the associated server configuration
|
DeviceContext |
getContext()
Return the device interface specific context object.
|
int |
getCurrentConnectionCount()
Return the current connection count for the share
|
DeviceInterface |
getInterface()
Return the device interface for this shared device.
|
int |
getMaximumConnectionCount()
Return the maximum connection count for the share
|
String |
getName()
Return the shared device name.
|
int |
getType()
Return the shared device type, as specified by the ShareType class.
|
boolean |
hasAccessControls()
Determine if the shared device has any access controls configured
|
boolean |
hasComment()
Check if the shared device has a comment
|
boolean |
hasConfiguration()
Check if the shared device has an assoicated server configuration
|
int |
hashCode()
Generates a hash code for the receiver.
|
void |
incrementConnectionCount()
Increment the connection count for the share
|
boolean |
isAdmin()
Determine if this is an admin share.
|
boolean |
isHidden()
Determine if this is a hidden share.
|
boolean |
isReadOnly()
Determine if the share is read-only.
|
boolean |
isTemporary()
Determine if the share is a temporary share
|
AccessControl |
removeAccessControl(int idx)
Remove an access control
|
void |
removeAllAccessControls()
Remove all access controls from this shared device
|
void |
setAccessControlList(AccessControlList acls)
Set the access control list using the specified list
|
void |
setAttributes(int attr)
Set the shared device attributes.
|
void |
setComment(String comm)
Set the shared device comment string.
|
void |
setConfiguration(ServerConfiguration config)
Set the associated server configuration
|
protected void |
setContext(DeviceContext ctx)
Set the context that is passed to the device interface.
|
protected void |
setInterface(DeviceInterface iface)
Set the device interface for this shared device.
|
void |
setMaximumConnectionCount(int maxConn)
Set the maximum connection coutn for this shared device
|
protected void |
setName(String name)
Set the shared device name.
|
protected void |
setType(int typ)
Set the shared device type.
|
String |
toString()
Returns a String that represents the value of this object.
|
public static final int Admin
public static final int Hidden
public static final int ReadOnly
public static final int Temporary
protected SharedDevice(String name, int typ, DeviceContext ctx)
name
- Shared device name.typ
- Share device type, as specified by class ShareType.ctx
- Context object that will be passed to the interface.public final int getAttributes()
public final boolean hasAccessControls()
public final AccessControlList getAccessControls()
public final boolean hasComment()
public final String getComment()
public final DeviceContext getContext()
public DeviceInterface getInterface() throws InvalidDeviceInterfaceException
InvalidDeviceInterfaceException
public final String getName()
public int getType()
public final int getCurrentConnectionCount()
public final int getMaximumConnectionCount()
public final boolean hasConfiguration()
public final ServerConfiguration getConfiguration()
public int hashCode()
public final boolean isAdmin()
public final boolean isHidden()
public final boolean isReadOnly()
public final boolean isTemporary()
public final void setComment(String comm)
comm
- java.lang.Stringpublic final void setAttributes(int attr)
attr
- intprotected void setContext(DeviceContext ctx)
ctx
- DeviceContextprotected final void setInterface(DeviceInterface iface)
iface
- DeviceInterfaceprotected final void setName(String name)
name
- java.lang.String Shared device name.protected final void setType(int typ)
typ
- int Shared device type, as specified by class ShareType.public final void setMaximumConnectionCount(int maxConn)
maxConn
- intpublic final void setAccessControlList(AccessControlList acls)
acls
- AccessControlListpublic final void setConfiguration(ServerConfiguration config)
config
- ServerConfigurationpublic final void addAccessControl(AccessControl acl)
acl
- AccessControlpublic final AccessControl removeAccessControl(int idx)
idx
- intpublic final void removeAllAccessControls()
public DeviceContext createContext(String[] args)
args
- String[]public void incrementConnectionCount()
public void decrementConnectionCount()
public int compareTo(SharedDevice sd)
compareTo
in interface Comparable<SharedDevice>
sd
- SharedDevicepublic boolean equals(Object obj)
Copyright © 2005–2017 Alfresco Software. All rights reserved.