org.gnu.jcifs
Class RemoteAdminImpl

java.lang.Object
  |
  +--org.gnu.jcifs.SessionImpl
        |
        +--org.gnu.jcifs.RemoteAdminImpl
All Implemented Interfaces:
CifsRemoteAdmin, CifsSession

final class RemoteAdminImpl
extends SessionImpl
implements CifsRemoteAdmin

The Remote Administration Protocol (RAP) provides operations

- to get list of share names;
- to get user informations;
- to get workstation informations;
- to get informations about print jobs;
- to manage print jobs.

Since:
1.0

Fields inherited from class org.gnu.jcifs.SessionImpl
CAP_BULK_TRANSFER, CAP_COMPRESSED_DATA, CAP_DFS, CAP_EXTENDED_SECURITY, CAP_LARGE_FILES, CAP_LEVEL_II_OPLOCKS, CAP_LOCK_AND_READ, CAP_MPX_MODE, CAP_NT_FIND, CAP_NT_SMBS, CAP_RAW_MODE, CAP_RPC_REMOTE_APIS, CAP_STATUS32, CAP_UNICODE, fCallerProperties, fCapabilities, fEncryptionKeyLen, fExtendedSecurity, fLoggedAsGuest, fMaxBufferSize, fMaxPendingMPRequests, fMaxRawSize, fMaxVCs, fMsg, fNBTSession, fPID, fProtocol, fSecurityMode, fServerLanMan, fServerOS, fServerPrimaryDomain, fSessionKey, fSessionName, fShare, fSystemTime, fTID, fTimeZone, fUID, LANMAN_1_0, LM_1_2X002, NT_LM_0_12, SMB_CORE, SUPPORTED_DIALECTS
 
Constructor Summary
(package private) RemoteAdminImpl(java.lang.String sessionname, int prot, Share share, NBTSession nbt, SMBMessage packet)
           
 
Method Summary
 void changePassword(java.lang.String user, java.lang.String oldpwd, java.lang.String newpwd)
           
 void continuePrintJob(int jobId)
          Resumes a paused print job
 void deletePrintJob(int jobId)
          Deletes a print job
 CifsPrintJobInfo getPrintJobInfo(int jobId)
          Lists print jobs in the specified printer queue
 CifsServerInfo getServerInfo()
          Returns information about the current server
(package private)  int getSortPosition()
           
 CifsUserInfo getUserInfo(java.lang.String user)
          Returns detailed information about a particular user
 CifsWorkstationInfo getWorkstationInfo()
          Returns detailed information about a workstation.
 CifsPrinterQueueInfo[] listPrinterQueues()
           
 CifsPrintJobInfo[] listPrintJobs(java.lang.String queuename)
          Lists print jobs in the specified printer queue
 CifsServerInfo[] listServersInfo(java.lang.String domain, int types)
          Lists all computers of the specified type or types that are visible in the specified domain.
 java.lang.String[] listServersNames(java.lang.String domain, int types)
          Lists all computers of the specified type or types that are visible in the specified domain.
 CifsShareInfo[] listSharesInfo(boolean sort)
          Returns the list of shares on the computer
 void pausePrintJob(int jobId)
          Pauses a print job in a printer queue
 java.lang.String toString()
           
 
Methods inherited from class org.gnu.jcifs.SessionImpl
addSession, allocateSMBMessage, checkConnection, connect, disconnect, echo, enumerateSessions, finalize, getConnectTime, getNetBIOSName, getProperty, getServerAddress, getServerLanMan, getServerOS, getServerPrimaryDomain, getServerTime, getServerTimeZone, getSessionName, getSessions, getShareName, howManyBytesCanWeSend, isConnected, isUserLevelSecurity, lookupSession, negotiate, promptLogin, receiveTransaction, reconnect, removeSession, sendTransaction, sendTransaction2, setAllowAutoReconnection, setProperty, setupSMBMessage, setupSMBMessageSecondary
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.gnu.jcifs.CifsSession
disconnect, echo, getConnectTime, getNetBIOSName, getProperty, getServerAddress, getServerLanMan, getServerOS, getServerPrimaryDomain, getServerTime, getServerTimeZone, getSessionName, getShareName, isConnected, isUserLevelSecurity, reconnect, setAllowAutoReconnection, setProperty
 

Constructor Detail

RemoteAdminImpl

RemoteAdminImpl(java.lang.String sessionname,
                int prot,
                Share share,
                NBTSession nbt,
                SMBMessage packet)
          throws java.io.IOException
Method Detail

listSharesInfo

public CifsShareInfo[] listSharesInfo(boolean sort)
                               throws java.io.IOException
Returns the list of shares on the computer
Specified by:
listSharesInfo in interface CifsRemoteAdmin
Parameters:
sort - if true the names are sorted
Returns:
list of CifsShareInfo objects
Throws:
java.io.IOException - if an I/O error occurs.

getWorkstationInfo

public CifsWorkstationInfo getWorkstationInfo()
                                       throws java.io.IOException
Returns detailed information about a workstation.
Specified by:
getWorkstationInfo in interface CifsRemoteAdmin
Throws:
java.io.IOException - if an I/O error occurs.

getUserInfo

public CifsUserInfo getUserInfo(java.lang.String user)
                         throws java.io.IOException
Returns detailed information about a particular user
Specified by:
getUserInfo in interface CifsRemoteAdmin
Parameters:
user - user name
Returns:
user inforations
Throws:
java.io.IOException - if an I/O error occurs.

listPrinterQueues

public CifsPrinterQueueInfo[] listPrinterQueues()
                                         throws java.io.IOException
Specified by:
listPrinterQueues in interface CifsRemoteAdmin
Throws:
java.io.IOException - if an I/O error occurs.

getPrintJobInfo

public CifsPrintJobInfo getPrintJobInfo(int jobId)
                                 throws java.io.IOException
Lists print jobs in the specified printer queue
Specified by:
getPrintJobInfo in interface CifsRemoteAdmin
Parameters:
queuename - printer queue name
Returns:
CifsPrintJobInfo
Throws:
java.io.IOException - if an I/O error occurs.

listPrintJobs

public CifsPrintJobInfo[] listPrintJobs(java.lang.String queuename)
                                 throws java.io.IOException
Lists print jobs in the specified printer queue
Specified by:
listPrintJobs in interface CifsRemoteAdmin
Parameters:
queuename - printer queue name
Returns:
CifsPrintJobInfo array
Throws:
java.io.IOException - if an I/O error occurs.

pausePrintJob

public void pausePrintJob(int jobId)
                   throws java.io.IOException
Pauses a print job in a printer queue
Specified by:
pausePrintJob in interface CifsRemoteAdmin
Parameters:
jobId - print job id
Throws:
java.io.IOException - if an I/O error occurs.

continuePrintJob

public void continuePrintJob(int jobId)
                      throws java.io.IOException
Resumes a paused print job
Specified by:
continuePrintJob in interface CifsRemoteAdmin
Parameters:
jobId - print job id
Throws:
java.io.IOException - if an I/O error occurs.

deletePrintJob

public void deletePrintJob(int jobId)
                    throws java.io.IOException
Deletes a print job
Specified by:
deletePrintJob in interface CifsRemoteAdmin
Parameters:
jobId - print job id
Throws:
java.io.IOException - if an I/O error occurs.

listServersInfo

public CifsServerInfo[] listServersInfo(java.lang.String domain,
                                        int types)
                                 throws java.io.IOException
Lists all computers of the specified type or types that are visible in the specified domain. It may also enumerate domains.
Specified by:
listServersInfo in interface CifsRemoteAdmin
Parameters:
domain - the name of the workgroup in which to enumerate computers of the specified type or types. If domain is null, servers are enumerated for the current domain of the computer
types - the type or types of computer to enumerate. Computer that match at least one of the specified types are returned (SV_*)
Throws:
java.io.IOException - if an I/O error occurs.

listServersNames

public java.lang.String[] listServersNames(java.lang.String domain,
                                           int types)
                                    throws java.io.IOException
Lists all computers of the specified type or types that are visible in the specified domain. It may also enumerate domains.
Specified by:
listServersNames in interface CifsRemoteAdmin
Parameters:
domain - the name of the workgroup in which to enumerate computers of the specified type or types. If domain is null, servers are enumerated for the current domain of the computer
types - the type or types of computer to enumerate. Computer that match at least one of the specified types are returned (SV_*)
Returns:
java.lang.String (sorted)
Throws:
java.io.IOException - if an I/O error occurs.

getServerInfo

public CifsServerInfo getServerInfo()
                             throws java.io.IOException
Returns information about the current server
Specified by:
getServerInfo in interface CifsRemoteAdmin
Returns:
server informations
Throws:
java.io.IOException - if an I/O error occurs.

changePassword

public void changePassword(java.lang.String user,
                           java.lang.String oldpwd,
                           java.lang.String newpwd)
                    throws java.io.IOException
Specified by:
changePassword in interface CifsRemoteAdmin

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSortPosition

int getSortPosition()
Overrides:
getSortPosition in class SessionImpl