Coverage Report - org.jscsi.target.connection.phase.TargetPhase
 
Classes in this File Line Coverage Branch Coverage Complexity
TargetPhase
0%
0/6
N/A
1.5
 
 1  
 package org.jscsi.target.connection.phase;
 2  
 
 3  
 
 4  
 import java.io.IOException;
 5  
 import java.security.DigestException;
 6  
 
 7  
 import javax.naming.OperationNotSupportedException;
 8  
 
 9  
 import org.jscsi.exception.InternetSCSIException;
 10  
 import org.jscsi.parser.ProtocolDataUnit;
 11  
 import org.jscsi.target.connection.Connection;
 12  
 import org.jscsi.target.settings.SettingsException;
 13  
 
 14  
 
 15  
 /**
 16  
  * Instances of this class represent a connection's phase (see {@link Connection} for a description of the relationship
 17  
  * between stages, phases, connections, and sessions).
 18  
  * <p>
 19  
  * To start a phase, one of the <i>execute</i> methods must be called, which one is sub-class-specific.
 20  
  * 
 21  
  * @author Andreas Ergenzinger, University of Konstanz
 22  
  */
 23  
 public abstract class TargetPhase {
 24  
 
 25  
     /**
 26  
      * The connection this phase is a part of.
 27  
      */
 28  
     protected Connection connection;
 29  
 
 30  
     /**
 31  
      * The abstract constructor.
 32  
      * 
 33  
      * @param connection the connection is phase is a part of
 34  
      */
 35  0
     public TargetPhase (Connection connection) {
 36  0
         this.connection = connection;
 37  0
     }
 38  
 
 39  
     /**
 40  
      * Throws an {@link OperationNotSupportedException} unless overwritten.
 41  
      * 
 42  
      * @param pdu the first PDU to be processes as part of the phase
 43  
      * @return <code>true</code> if and only if the phase was completed successfully
 44  
      * @throws OperationNotSupportedException if the method is not overwritten
 45  
      * @throws IOException if an I/O error occurs
 46  
      * @throws InterruptedException if the current Thread is interrupted
 47  
      * @throws InternetSCSIException if a iSCSI protocol violation is detected
 48  
      * @throws DigestException if a PDU digest error is detected
 49  
      * @throws SettingsException if the target tries to access a parameter that has not been declared or negotiated and
 50  
      *             that has no default value
 51  
      */
 52  
     public boolean execute (ProtocolDataUnit pdu) throws OperationNotSupportedException , IOException , InterruptedException , InternetSCSIException , DigestException , SettingsException {
 53  0
         throw new OperationNotSupportedException();
 54  
     }
 55  
 
 56  
     /**
 57  
      * Throws an {@link OperationNotSupportedException} unless overwritten.
 58  
      * 
 59  
      * @return <code>true</code> if and only if the phase was completed successfully
 60  
      * @throws OperationNotSupportedException if the method is not overwritten
 61  
      * @throws IOException if an I/O error occurs
 62  
      * @throws InterruptedException if the current Thread is interrupted
 63  
      * @throws InternetSCSIException if a iSCSI protocol violation is detected
 64  
      * @throws DigestException if a PDU digest error is detected
 65  
      * @throws SettingsException if the target tries to access a parameter that has not been declared or negotiated and
 66  
      *             that has no default value
 67  
      * @throws InitiatorLoginRequestException
 68  
      */
 69  
     public boolean execute () throws OperationNotSupportedException , InternetSCSIException , DigestException , IOException , InterruptedException , SettingsException {
 70  0
         throw new OperationNotSupportedException();
 71  
     }
 72  
 
 73  
     /**
 74  
      * Getting the related connection
 75  
      * 
 76  
      * @return the connection
 77  
      */
 78  
     public Connection getTargetConnection () {
 79  0
         return connection;
 80  
     }
 81  
 }