001/*
002 * IBM Confidential
003 * OCO Source Materials
004 * Rational ClearCase
005 * (C) Copyright IBM Corporation. 2013.  All rights reserved.
006 *
007 * The source code for this program is not published or otherwise
008 * divested of its trade secrets, irrespective of what has been
009 * deposited with the U.S. Copyright Office.
010 */
011package com.ibm.rational.wvcm.stp.cc;
012
013import javax.wvcm.WvcmException;
014
015/**
016 * Handler for remote view agent callback operations.
017 */
018public interface CcRemoteViewAgentCallback {
019    
020    /**
021     * Event to indicate a remote view agent has connected
022     */
023    public interface ConnectEvent {
024        /**
025         * Answers with the remote view agent's provider
026         * @return Provider for this view
027         */
028        CcProvider getProvider();
029        
030        /**
031         * Answers with the view tag of the connected view
032         * @return the view tag
033         */
034        String getViewTag();
035        
036        /**
037         * Answers with the uuid of the connected view
038         * @return A dense representation of the uuid as a string. 
039         */
040        String getViewUuid();
041        
042        /**
043         * Answers with an error, or null if successful.
044         * @return a WvcmException, or null if no errors
045         */
046        WvcmException getError();
047    }
048    
049    /**
050     * Event to indicate a remote view agent has disconnected
051     */
052    public interface DisconnectEvent {
053        /**
054         * Answers with the remote view agent's provider
055         * @return Provider for this view
056         */
057        CcProvider getProvider();
058        
059        /**
060         * Answers with the view tag for the disconnected view
061         * @return the view tag
062         */
063        String getViewTag();
064        
065        /**
066         * Answers with the uuid of the connected view
067         * @return A dense representation of the uuid as a string. 
068         */
069        String getViewUuid();
070        
071        /**
072         * Answers with an error,or null if successful.
073         * @return a WvcmException, or null if no errors
074         */
075        WvcmException getError();
076    }
077    
078    /**
079     * Handle a remote view agent connection event.
080     * @param event the connect event
081     */
082    void handleConnect(ConnectEvent event);
083    
084    /**
085     * Handle a remote view agent disconnect event
086     * @param event the disconnect event
087     */
088    void handleDisconnect(DisconnectEvent event);
089}