Overview | Package | Class | Tree | Deprecated | Index | Help
| JavaSVN Home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.tmatesoft.svn.core.wc
Interface ISVNEventHandler

All Known Implementing Classes:
  SVNBasicClient

public interface ISVNEventHandler

The ISVNEventHandler interface should be implemented in order to be further provided to an SVN*Client object as a handler of a sequence of events generated by SVN*Client's do*() methods.

This is a way how a custom event handler can be registered:

     import org.tmatesoft.svn.core.wc.ISVNOptions;
     import org.tmatesoft.svn.core.wc.SVNWCUtil;
     import org.tmatesoft.svn.core.wc.SVNClientManager;
     import org.tmatesoft.svn.core.wc.ISVNEventHandler;
     ...

     ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
     String authName = "myName";
     String authPassword = "myPassword";
     SVNClientManager clientManager = SVNClientManager.newInstance(options, authName, authPassword);
     clientManager.getCommitClient().setEventHandler(new ISVNEventHandler(){
         public void handleEvent(SVNEvent event, double progress){
             //handle event here
         }

         public void checkCancelled() throws SVNCancelException {
             //handle cancel of the operation - throw SVNCancelException
         }
     });

or like this:

     ...
     import org.tmatesoft.svn.core.wc.SVNCommitClient;
     ...

     ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
     SVNCommitClient commitClient = new SVNCommitClient(null, options);
     commitClient.setEventHandler(new ISVNEventHandler(){
     ...
     });

All calls to handleEvent() and checkCancelled() methods are synchronous - that is the caller is blocked till a method finishes.

Version:
  1.0
Author:
  TMate Software Ltd.
See Also:
  `SVNEvent`, Examples

Field Summary
`static double` | `UNKNOWN` Constant that is currently the value of the `progress` parameter (in `handleEvnt()`)

Method Summary
`void` | `checkCancelled()` Checks if the current operation is cancelled (somehow interrupted) and should throw an SVNCancelException.
`void` | `handleEvent(SVNEvent event, double progress)` Handles the current event.

Field Detail

### UNKNOWN

    public static final double UNKNOWN

  Constant that is currently the value of the `progress` parameter (in `handleEvnt()`)

  See Also:
    Constant Field Values

Method Detail

### handleEvent

    public void handleEvent(SVNEvent event,
                            double progress)
                     throws SVNException

  Handles the current event.

  Generally all operations represented by do*() methods of SVN*Client objects are followed by generating a sequence of events that are passed to the registered ISVNEventHandler object for custom processing. For example, during an update operation each local item being modified is signaled about by dispatching a specific for this item SVNEvent object to this method where this event can be scrutinized and handled in a desired way.

  Parameters:
    `event` - the current event that keeps detailed information on the type of action occured and other attributes like path, status, etc.
    `progress` - currently reserved for future use; now it's value is always set to `UNKNOWN`
  Throws:
    `SVNException`

### checkCancelled

    public void checkCancelled()
                        throws SVNCancelException

  Checks if the current operation is cancelled (somehow interrupted) and should throw an SVNCancelException.

  Throws:
    `SVNCancelException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| JavaSVN Home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 TMate Software Ltd. All Rights Reserved.