org.jinterop.winreg.smb
Class JIWinRegStub

java.lang.Object
  extended by Stub
      extended by org.jinterop.winreg.smb.JIWinRegStub
All Implemented Interfaces:
IJIWinReg

public class JIWinRegStub
extends Stub
implements IJIWinReg

Since:
1.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jinterop.winreg.IJIWinReg
IJIWinReg.closeKey, IJIWinReg.createKey, IJIWinReg.deleteValueOrKey, IJIWinReg.enumKey, IJIWinReg.enumValue, IJIWinReg.openHKCR, IJIWinReg.openHKCU, IJIWinReg.openHKLM, IJIWinReg.openHKU, IJIWinReg.openKey, IJIWinReg.queryValue, IJIWinReg.saveFile, IJIWinReg.setValue
 
Field Summary
 
Fields inherited from interface org.jinterop.winreg.IJIWinReg
KEY_ALL_ACCESS, KEY_CREATE_LINK, KEY_CREATE_SUB_KEY, KEY_ENUMERATE_SUB_KEYS, KEY_EXECUTE, KEY_NOTIFY, KEY_QUERY_VALUE, KEY_READ, KEY_SET_VALUE, KEY_WRITE, REG_BINARY, REG_DWORD, REG_EXPAND_SZ, REG_MULTI_SZ, REG_NONE, REG_OPTION_NON_VOLATILE, REG_OPTION_VOLATILE, REG_SZ
 
Constructor Summary
JIWinRegStub(IJIAuthInfo authInfo, java.lang.String serverName)
           
JIWinRegStub(java.lang.String serverName)
           
 
Method Summary
 void closeConnection()
          Closes this connection, but a word of caution, it does not close any OPEN Key.
protected  java.lang.String getSyntax()
           
 void winreg_CloseKey(JIPolicyHandle handle)
          Closes the key.
 JIPolicyHandle winreg_CreateKey(JIPolicyHandle handle, java.lang.String subKey, int options, int accessMask)
          Creates a new key by name subKey under the handle.
 void winreg_DeleteKeyOrValue(JIPolicyHandle handle, java.lang.String valueName, boolean isKey)
          Deletes a key or value specified by valueName.
 java.lang.String[] winreg_EnumKey(JIPolicyHandle handle, int index)
          Returns name and class (in that order) for the key identified by index under parent handle.
 java.lang.Object[] winreg_EnumValue(JIPolicyHandle handle, int index)
          Returns name and type (in that order) for the value identified by index under parent handle.
 JIPolicyHandle winreg_OpenHKCR()
          Opens the HKEY_CLASSES_ROOT key
 JIPolicyHandle winreg_OpenHKCU()
          Opens the HKEY_CURRENT_USER key
 JIPolicyHandle winreg_OpenHKLM()
          Opens the HKEY_LOCAL_MACHINE key
 JIPolicyHandle winreg_OpenHKU()
          Opens the HKEY_USERS key
 JIPolicyHandle winreg_OpenKey(JIPolicyHandle handle, java.lang.String key, int accessMask)
          Opens the subkey of key specified by handle.
 byte[] winreg_QueryValue(JIPolicyHandle handle, int bufferSize)
          Query the key for it's name.
 java.lang.Object[] winreg_QueryValue(JIPolicyHandle handle, java.lang.String valueName, int bufferSize)
          Query the key-value for it's value.Please put buffer size more than the estimated expected value.
 void winreg_SaveFile(JIPolicyHandle handle, java.lang.String fileName)
          Saves registry entries from handle location to local fileName.
 void winreg_SetValue(JIPolicyHandle handle, java.lang.String valueName)
          Sets an empty name-value for a REG_NONE type.
 void winreg_SetValue(JIPolicyHandle handle, java.lang.String valueName, byte[][] data)
          Sets name-value for a REG_MULTI_SZ type.
 void winreg_SetValue(JIPolicyHandle handle, java.lang.String valueName, byte[] data, boolean isBinary, boolean expand_sz)
          Sets name-value for a REG_SZ\REG_EXPAND_SZ\REG_BINARY type.
 void winreg_SetValue(JIPolicyHandle handle, java.lang.String valueName, int data)
          Sets name-value for a REG_DWORD type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIWinRegStub

public JIWinRegStub(IJIAuthInfo authInfo,
                    java.lang.String serverName)
             throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

JIWinRegStub

public JIWinRegStub(java.lang.String serverName)
             throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException
Method Detail

winreg_OpenHKLM

public JIPolicyHandle winreg_OpenHKLM()
                               throws JIException
Description copied from interface: IJIWinReg
Opens the HKEY_LOCAL_MACHINE key

Specified by:
winreg_OpenHKLM in interface IJIWinReg
Returns:
handle representing the opened key
Throws:
JIException

winreg_OpenHKCR

public JIPolicyHandle winreg_OpenHKCR()
                               throws JIException
Description copied from interface: IJIWinReg
Opens the HKEY_CLASSES_ROOT key

Specified by:
winreg_OpenHKCR in interface IJIWinReg
Returns:
handle representing the opened key
Throws:
JIException

winreg_OpenHKCU

public JIPolicyHandle winreg_OpenHKCU()
                               throws JIException
Description copied from interface: IJIWinReg
Opens the HKEY_CURRENT_USER key

Specified by:
winreg_OpenHKCU in interface IJIWinReg
Returns:
handle representing the opened key
Throws:
JIException

winreg_OpenHKU

public JIPolicyHandle winreg_OpenHKU()
                              throws JIException
Description copied from interface: IJIWinReg
Opens the HKEY_USERS key

Specified by:
winreg_OpenHKU in interface IJIWinReg
Returns:
handle representing the opened key
Throws:
JIException

winreg_OpenKey

public JIPolicyHandle winreg_OpenKey(JIPolicyHandle handle,
                                     java.lang.String key,
                                     int accessMask)
                              throws JIException
Description copied from interface: IJIWinReg
Opens the subkey of key specified by handle.

Specified by:
winreg_OpenKey in interface IJIWinReg
accessMask - type of access required.
Returns:
Throws:
JIException

winreg_CloseKey

public void winreg_CloseKey(JIPolicyHandle handle)
                     throws JIException
Description copied from interface: IJIWinReg
Closes the key.

Specified by:
winreg_CloseKey in interface IJIWinReg
Throws:
JIException

winreg_DeleteKeyOrValue

public void winreg_DeleteKeyOrValue(JIPolicyHandle handle,
                                    java.lang.String valueName,
                                    boolean isKey)
                             throws JIException
Description copied from interface: IJIWinReg
Deletes a key or value specified by valueName.

Specified by:
winreg_DeleteKeyOrValue in interface IJIWinReg
Throws:
JIException

winreg_QueryValue

public byte[] winreg_QueryValue(JIPolicyHandle handle,
                                int bufferSize)
                         throws JIException
Description copied from interface: IJIWinReg
Query the key for it's name. Please put buffer size more than the estimated expected value. In this case 1024 would do.

Specified by:
winreg_QueryValue in interface IJIWinReg
Returns:
Throws:
JIException

winreg_QueryValue

public java.lang.Object[] winreg_QueryValue(JIPolicyHandle handle,
                                            java.lang.String valueName,
                                            int bufferSize)
                                     throws JIException
Description copied from interface: IJIWinReg
Query the key-value for it's value.Please put buffer size more than the estimated expected value.

Specified by:
winreg_QueryValue in interface IJIWinReg
Returns:
first param contains the class type as an Integer, second param contains the value as a 1 dimensional byte array,if any. In case of REG_MULTI_SZ you will get a 2 dimensional byte array as the second param.
Throws:
JIException

winreg_SaveFile

public void winreg_SaveFile(JIPolicyHandle handle,
                            java.lang.String fileName)
                     throws JIException
Description copied from interface: IJIWinReg
Saves registry entries from handle location to local fileName. This path is local to the target machine.

Specified by:
winreg_SaveFile in interface IJIWinReg
Throws:
JIException

winreg_CreateKey

public JIPolicyHandle winreg_CreateKey(JIPolicyHandle handle,
                                       java.lang.String subKey,
                                       int options,
                                       int accessMask)
                                throws JIException
Description copied from interface: IJIWinReg
Creates a new key by name subKey under the handle. If REG_OPTION_NON_VOLATILE option is used then the key is preserved in the registry when the machine shutsdown, otherwise it is stored only in memory.

Specified by:
winreg_CreateKey in interface IJIWinReg
Returns:
Throws:
JIException

winreg_SetValue

public void winreg_SetValue(JIPolicyHandle handle,
                            java.lang.String valueName,
                            byte[][] data)
                     throws JIException
Description copied from interface: IJIWinReg
Sets name-value for a REG_MULTI_SZ type. data is a 2 dimensional array, each primary dimension representing one string. Please make sure that the encoding is correct while doing String.getBytes(...).

Specified by:
winreg_SetValue in interface IJIWinReg
Throws:
JIException

winreg_SetValue

public void winreg_SetValue(JIPolicyHandle handle,
                            java.lang.String valueName)
                     throws JIException
Description copied from interface: IJIWinReg
Sets an empty name-value for a REG_NONE type.

Specified by:
winreg_SetValue in interface IJIWinReg
Throws:
JIException

winreg_SetValue

public void winreg_SetValue(JIPolicyHandle handle,
                            java.lang.String valueName,
                            byte[] data,
                            boolean isBinary,
                            boolean expand_sz)
                     throws JIException
Description copied from interface: IJIWinReg
Sets name-value for a REG_SZ\REG_EXPAND_SZ\REG_BINARY type. The data will be considered as String if the binary flag is not set to true. In case of non binary data, please make sure that the encoding is correct while doing String.getBytes(...). Set expand_sz to true if the String contains environment variables. When both binary and expand_sz are set , binary will take precedence.

Specified by:
winreg_SetValue in interface IJIWinReg
Throws:
JIException

winreg_SetValue

public void winreg_SetValue(JIPolicyHandle handle,
                            java.lang.String valueName,
                            int data)
                     throws JIException
Description copied from interface: IJIWinReg
Sets name-value for a REG_DWORD type.

Specified by:
winreg_SetValue in interface IJIWinReg
Throws:
JIException

winreg_EnumKey

public java.lang.String[] winreg_EnumKey(JIPolicyHandle handle,
                                         int index)
                                  throws JIException
Description copied from interface: IJIWinReg
Returns name and class (in that order) for the key identified by index under parent handle.

Specified by:
winreg_EnumKey in interface IJIWinReg
Returns:
Throws:
JIException

winreg_EnumValue

public java.lang.Object[] winreg_EnumValue(JIPolicyHandle handle,
                                           int index)
                                    throws JIException
Description copied from interface: IJIWinReg
Returns name and type (in that order) for the value identified by index under parent handle.

Specified by:
winreg_EnumValue in interface IJIWinReg
Returns:
First is a String (valueName) and second param is an Integer (type)
Throws:
JIException

getSyntax

protected java.lang.String getSyntax()

closeConnection

public void closeConnection()
                     throws JIException
Description copied from interface: IJIWinReg
Closes this connection, but a word of caution, it does not close any OPEN Key. Just releases the NP resources it is holding.

Specified by:
closeConnection in interface IJIWinReg
Throws:
JIException