com.starla.smb
Class SMBAdminSession

java.lang.Object
  |
  +--com.starla.smb.SMBAdminSession

public final class SMBAdminSession
extends java.lang.Object

SMB admin session class

The SMBAdminSession 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 SMBAdminSession is created, as with all SMB sessions, via the SMBSessionFactory static class. The SMBSessionFactory.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.


Method Summary
 void CloseSession()
          Close the session to the remote server
 void ContinuePrintJob(SMBPrintJob job)
          Continue, unpause, the specified print job
 void ContinuePrintQueue(java.lang.String qname)
          Start, unpause, the specified remote printer queue.
 void DeletePrintJob(SMBPrintJob job)
          Delete the specified print job
 SMBPrintQueueInfo getPrinterInfo(java.lang.String printerName)
          Return printer queue information for the specified printer queue.
 SMBPrinterList getPrinterList()
          Return the list of printer queues available on this server.
 SMBPrintJobList getPrintJobs(java.lang.String qnam)
          Return the list of print jobs in the specified printer queue.
 SMBServerInfo getServerInfo()
          Return the server information for the server we are connected to
 SMBServerList getServerList(int flags)
          Return the list of available servers on the network
 SMBShareInfo2 getShareInfo(java.lang.String shr)
          Return the full share information for the specified share
 SMBShareList getShareList()
          Return the list of available shares on the remote server
 SMBUserInfo getUserInfo(java.lang.String usr)
          Return the user information for the specified user
 java.util.Vector getUserList()
          Return the list of users on the remote server.
 void PausePrintJob(SMBPrintJob job)
          Pause the specified print job
 void PausePrintQueue(java.lang.String qname)
          Pause the specified print queue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

CloseSession

public void CloseSession()
                  throws java.io.IOException
Close the session to the remote server

ContinuePrintJob

public final void ContinuePrintJob(SMBPrintJob job)
                            throws java.io.IOException,
                                   SMBException
Continue, unpause, the specified print job
Parameters:
job - SMBPrintJob containing the details of the print job to continue
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB exception occurs

ContinuePrintQueue

public final void ContinuePrintQueue(java.lang.String qname)
                              throws java.io.IOException,
                                     SMBException
Start, unpause, the specified remote printer queue.
Parameters:
qname - Remote print queue to continue
Throws:
java.io.IOException - If an I/O error occurs.
SMBException - If an SMB error occurs

DeletePrintJob

public final void DeletePrintJob(SMBPrintJob job)
                          throws java.io.IOException,
                                 SMBException
Delete the specified print job
Parameters:
job - SMBPrintJob containing the details of the print job to pause
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB exception occurs

getPrinterInfo

public final SMBPrintQueueInfo getPrinterInfo(java.lang.String printerName)
                                       throws java.io.IOException,
                                              SMBException
Return printer queue information for the specified printer queue.
Parameters:
printerName - Name of the remote printer to return information for.
Returns:
com.starla.smb.SMBPrintQueueInfo
Throws:
SMBException - If an SMB error occurs
java.io.IOException - If an I/O error occurs

getPrinterList

public final SMBPrinterList getPrinterList()
                                    throws java.io.IOException,
                                           SMBException
Return the list of printer queues available on this server.
Returns:
SMBPrinterList containing the list of available printers
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB error occurs

getPrintJobs

public final SMBPrintJobList getPrintJobs(java.lang.String qnam)
                                   throws java.io.IOException,
                                          SMBException
Return the list of print jobs in the specified printer queue.
Parameters:
qnam - Name of the queue to return jobs for
Returns:
SMBPrintJobList containing the list of jobs in the queue
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB error occurs

getServerInfo

public final SMBServerInfo getServerInfo()
                                  throws java.io.IOException,
                                         SMBException
Return the server information for the server we are connected to
Returns:
SMBServerInfo containing the server information
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB error occurs

getServerList

public final SMBServerList getServerList(int flags)
                                  throws java.io.IOException,
                                         SMBException
Return the list of available servers on the network
Parameters:
flags - Server enumerate flags.
Returns:
List of available servers, as an SMBServerList, else null if there are no servers available.
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB exception occurs

getShareInfo

public final SMBShareInfo2 getShareInfo(java.lang.String shr)
                                 throws java.io.IOException,
                                        SMBException
Return the full share information for the specified share
Parameters:
shr - Remote share name to return information for.
Returns:
SMBShareInfo2 containing the full share details
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB error occurs

getShareList

public final SMBShareList getShareList()
                                throws java.io.IOException,
                                       SMBException
Return the list of available shares on the remote server
Returns:
List of available shares, as an SMBShareList, else null if there are no shares available.
Throws:
java.io.IOException - If an I/O error occurs

getUserInfo

public final SMBUserInfo getUserInfo(java.lang.String usr)
                              throws java.io.IOException,
                                     SMBException
Return the user information for the specified user
Parameters:
usr - User name of the user to return information for.
Returns:
SMBUserInfo containing the user details
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB error occurs

getUserList

public final java.util.Vector getUserList()
                                   throws java.io.IOException,
                                          SMBException
Return the list of users on the remote server.
Returns:
Vector of user name strings.
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB error occurs

PausePrintJob

public final void PausePrintJob(SMBPrintJob job)
                         throws java.io.IOException,
                                SMBException
Pause the specified print job
Parameters:
job - SMBPrintJob containing the details of the print job to pause
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB exception occurs

PausePrintQueue

public final void PausePrintQueue(java.lang.String qname)
                           throws java.io.IOException,
                                  SMBException
Pause the specified print queue.
Parameters:
qname - Remote print queue to be paused
Throws:
java.io.IOException - If an I/O error occurs
SMBException - If an SMB error occurs