public final class AdminSession
extends java.lang.Object
The AdminSession class implements the Remote Administration Protocol (RAP) as defined in the draft protocol specification.
The class can return the list of nodes on the network, get remote user information, get the list of shares on the remote server, list of printer queues on the remote server, and can manipulate individual print jobs.
An AdminSession is created, as with all SMB sessions, via the SessionFactory static class. The SessionFactory.OpenAdminSession() method requires a PCShare object that provides the remote server node name, the share name will be ignored as an admin session is always made to the IPC$ named pipe. User name and/or a password may be required depending upon the requests being made, and whether the 'GUEST' account is available on the remote server.
SessionFactory
Constructor and Description |
---|
AdminSession(IPCSession sess)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
closePipes()
Close the cached pipe files
|
void |
CloseSession()
Close the session to the remote server
|
void |
ContinuePrintJob(PrintJob job)
Continue, unpause, the specified print job
|
void |
ContinuePrintQueue(java.lang.String qname)
Start, unpause, the specified remote printer queue.
|
void |
DeletePrintJob(PrintJob job)
Delete the specified print job
|
int |
getAccountType(java.lang.String userName)
Return the account type for the specified user name
|
int |
getBufferSize()
Return the transaction buffer size.
|
StringList |
getDiskList()
Return a list of the disk devices available on the remote server.
|
StringList |
getGroupList()
Return a list of the groups on the remote server.
|
StringList |
getGroupUsers(java.lang.String grpName)
Get a list of users that are in the specified group.
|
PrintQueueInfo |
getPrinterInfo(java.lang.String printerName)
Return printer queue information for the specified printer queue.
|
PrinterList |
getPrinterList()
Return the list of printer queues available on this server.
|
PrintJob |
getPrintJobInfo(int id)
Return information for the specified print job.
|
PrintJobList |
getPrintJobs(java.lang.String qnam)
Return the list of print jobs in the specified printer queue.
|
StringList |
getRAPUserGroups(java.lang.String userName)
Get a list of groups for the specified user, using the RAP call.
|
ServerInfo |
getServerInfo()
Return the server information for the server we are connected to
|
ServerInfo |
getServerInfo(java.lang.String node)
Return the server information for the specified server.
|
ServerList |
getServerList(int flags)
Return the list of available servers on the network
|
StringList |
getServerNames(int flags)
Return the list of available servers on the network
|
StringList |
getServiceList()
Return a list of services installed on the remote node.
|
Session |
getSession()
Return the associated session.
|
SessionInfoList |
getSessionList()
Return a list of open sessions on the remote server.
|
ShareInfo |
getShareInfo(java.lang.String shr)
Return the full share information for the specified share
|
ShareInfoList |
getShareList()
Return the list of available shares on the remote server
|
StringList |
getUserGroups(java.lang.String userName)
Get a list of groups for the specified user.
|
UserInfo |
getUserInfo(java.lang.String usr)
Return the user information for the specified user
|
StringList |
getUserList()
Return the list of users on the remote server.
|
WorkstationInfo |
getWorkstationInfo()
Return the server type/information for the server we are connected to
|
EventlogPipeFile |
openEventLogPipe()
Open the event log DCE/RPC pipe
|
InitShutPipeFile |
openInitShutdownPipe()
Open the shutdown service DCE/RPC pipe
|
IPCPipeFile |
openPipe(int pipeId)
Open the specifed named pipe file and setup the pipe.
|
SamrPipeFile |
openSecurityAccountsManagerPipe()
Open the security accounts manager DCE/RPC pipe (SAMR)
|
SrvsvcPipeFile |
openServerPipe()
Open the server DCE/RPC pipe
|
SvcctlPipeFile |
openServiceManagerPipe()
Open the service manager DCE/RPC pipe
|
WinregPipeFile |
openWindowsRegistryPipe()
Open the Windows registry DCE/RPC pipe
|
WkssvcPipeFile |
openWorkstationPipe()
Open the workstation DCE/RPC pipe
|
void |
PausePrintJob(PrintJob job)
Pause the specified print job
|
void |
PausePrintQueue(java.lang.String qname)
Pause the specified print queue.
|
void |
setBufferSize(int siz)
Set the buffer size to use for transactions.
|
void |
setUseDceRpc(boolean ena)
Set the use DCE/RPC flag to enable/disable the use of the newer DCE/RPC calls if the server
supports them
|
boolean |
useDceRpc()
Return the use DCE/RPC flag
|
public AdminSession(IPCSession sess)
sess
- IPCSessionpublic final boolean useDceRpc()
public final void setUseDceRpc(boolean ena)
ena
- booleanpublic void CloseSession() throws java.io.IOException, SMBException
java.io.IOException
- If an I/O error occursSMBException
- If an SMB level error occurspublic final void ContinuePrintJob(PrintJob job) throws java.io.IOException, SMBException
job
- PrintJob containing the details of the print job to continuejava.io.IOException
- If an I/O error occursSMBException
- If an SMB exception occurspublic final void ContinuePrintQueue(java.lang.String qname) throws java.io.IOException, SMBException
qname
- Remote print queue to continuejava.io.IOException
- If an I/O error occurs.SMBException
- If an SMB error occurspublic final void DeletePrintJob(PrintJob job) throws java.io.IOException, SMBException
job
- PrintJob containing the details of the print job to pausejava.io.IOException
- If an I/O error occursSMBException
- If an SMB exception occurspublic int getBufferSize()
public final StringList getDiskList() throws SMBException, java.io.IOException
SMBException
- If an SMB error occurs.java.io.IOException
- If an I/O error occurs.public final StringList getGroupList() throws SMBException, java.io.IOException, DCEException
SMBException
- If an SMB error occurs.java.io.IOException
- If an I/O error occurs.DCEException
- If a DCE/RPC exception occurspublic final StringList getGroupUsers(java.lang.String grpName) throws SMBException, java.io.IOException
grpName
- java.lang.String Group name to return user list for.SMBException
- If an SMB error occurs.java.io.IOException
- If an I/O error occurs.public final StringList getUserGroups(java.lang.String userName) throws SMBException, java.io.IOException
userName
- java.lang.String USer name to return group list for.SMBException
- If an SMB error occurs.java.io.IOException
- If an I/O error occurs.public final PrintQueueInfo getPrinterInfo(java.lang.String printerName) throws java.io.IOException, SMBException
printerName
- Name of the remote printer to return information for.SMBException
- If an SMB error occursjava.io.IOException
- If an I/O error occurspublic final PrinterList getPrinterList() throws java.io.IOException, SMBException
java.io.IOException
- If an I/O error occursSMBException
- If an SMB error occurspublic final PrintJob getPrintJobInfo(int id) throws SMBException, java.io.IOException
id
- Id of the print job to return information forSMBException
- The exception description.java.io.IOException
- The exception description.public final PrintJobList getPrintJobs(java.lang.String qnam) throws java.io.IOException, SMBException
qnam
- Name of the queue to return jobs forjava.io.IOException
- If an I/O error occursSMBException
- If an SMB error occurspublic final ServerInfo getServerInfo() throws java.io.IOException, SMBException
java.io.IOException
- If an I/O error occursSMBException
- If an SMB error occurspublic final ServerInfo getServerInfo(java.lang.String node) throws SMBException, java.io.IOException
node
- Node name of the server to return information for.SMBException
- An SMB exception has occurred.java.io.IOException
- An I/O exception has occurred.public final ServerList getServerList(int flags) throws java.io.IOException, SMBException
flags
- Server enumerate flags.java.io.IOException
- If an I/O error occursSMBException
- If an SMB exception occurspublic final StringList getServerNames(int flags) throws java.io.IOException, SMBException
flags
- Server enumerate flags.java.io.IOException
- If an I/O error occursSMBException
- If an SMB exception occurspublic final StringList getServiceList() throws SMBException, java.io.IOException
SMBException
- SMB error occurred.java.io.IOException
- I/O exception.public Session getSession()
public final SessionInfoList getSessionList() throws SMBException, DCEException, java.io.IOException
SMBException
DCEException
java.io.IOException
public final ShareInfo getShareInfo(java.lang.String shr) throws java.io.IOException, SMBException, DCEException
shr
- Remote share name to return information for.java.io.IOException
- If an I/O error occursSMBException
- If an SMB error occursDCEException
public final ShareInfoList getShareList() throws java.io.IOException, SMBException, DCEException
java.io.IOException
- If an I/O error occursSMBException
DCEException
public final UserInfo getUserInfo(java.lang.String usr) throws java.io.IOException, SMBException
usr
- User name of the user to return information for.java.io.IOException
- If an I/O error occursSMBException
- If an SMB error occurspublic final StringList getUserList() throws java.io.IOException, SMBException, DCEException
java.io.IOException
- If an I/O error occursSMBException
- If an SMB error occursDCEException
- If a DCE/RPC error occurspublic final WorkstationInfo getWorkstationInfo() throws java.io.IOException, SMBException, DCEException
java.io.IOException
- If an I/O error occursSMBException
- If an SMB error occursDCEException
- If a DCE/RPC error occurspublic final int getAccountType(java.lang.String userName) throws java.io.IOException, SMBException, DCEException
userName
- Stringjava.io.IOException
SMBException
DCEException
public final void PausePrintJob(PrintJob job) throws java.io.IOException, SMBException
job
- PrintJob containing the details of the print job to pausejava.io.IOException
- If an I/O error occursSMBException
- If an SMB exception occurspublic final void PausePrintQueue(java.lang.String qname) throws java.io.IOException, SMBException
qname
- Remote print queue to be pausedjava.io.IOException
- If an I/O error occursSMBException
- If an SMB error occurspublic final WinregPipeFile openWindowsRegistryPipe() throws java.io.IOException, SMBException, DCEException
java.io.IOException
SMBException
DCEException
public final SrvsvcPipeFile openServerPipe() throws java.io.IOException, SMBException, DCEException
java.io.IOException
SMBException
DCEException
public final WkssvcPipeFile openWorkstationPipe() throws java.io.IOException, SMBException, DCEException
java.io.IOException
SMBException
DCEException
public final EventlogPipeFile openEventLogPipe() throws java.io.IOException, SMBException, DCEException
java.io.IOException
SMBException
DCEException
public final SvcctlPipeFile openServiceManagerPipe() throws java.io.IOException, SMBException, DCEException
java.io.IOException
SMBException
DCEException
public final SamrPipeFile openSecurityAccountsManagerPipe() throws java.io.IOException, SMBException, DCEException
java.io.IOException
SMBException
DCEException
public final InitShutPipeFile openInitShutdownPipe() throws java.io.IOException, SMBException, DCEException
java.io.IOException
SMBException
DCEException
public void setBufferSize(int siz)
siz
- intpublic final IPCPipeFile openPipe(int pipeId) throws java.io.IOException, SMBException, DCEException
pipeId
- DCE/RPC pipe typejava.io.IOException
SMBException
DCEException
public final void closePipes()
public final StringList getRAPUserGroups(java.lang.String userName) throws SMBException, java.io.IOException
userName
- java.lang.String USer name to return group list for.SMBException
- If an SMB error occurs.java.io.IOException
- If an I/O error occurs.Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.