Avaya Conferencing Provider API

com.avaya.conferencing.api.acp.control.operations
Class AbstractOperationImpl<RESULT,IMPL extends Operation<RESULT,IMPL>>

java.lang.Object
  extended by com.avaya.conferencing.api.acp.control.operations.AbstractOperationImpl<RESULT,IMPL>
Type Parameters:
RESULT - The result type returned by this Operation's get method
IMPL - The operation type that is extending AbstractOperationImpl.
All Implemented Interfaces:
Operation<RESULT,IMPL>, java.lang.Cloneable
Direct Known Subclasses:
AbortSignalToNoiseRatioMeasurement, AccessNextEntry, CallListGet, CallListSet, CallListsGet, CancelHelp, Create, DeleteURI, Disconnect, ForceConnectionUpdate, GetCurrentTime, GetRecordingURIs, MakeCall, MakeCallsFromList, MeasureSignalToNoiseRatio, MediaSourceConnect, ModifyDetails, Open, OperatorLogin, OperatorLogout, PlaceInConference, PlaceInMainConference, PlaceInSubconference, PlayAndCollect, PlaybackModePause, PlaybackModeResume, PlaybackModeStart, PlaybackModeStop, PlayConferenceRoster, PlayMessage, PlayParticipantName, PollingAssist, PollingModeStart, PollingModeStop, PollingQuery, PollingQueryDetail, PollingReset, QACancelQuestion, QAFinishedQuestion, QAHaveQuestion, QAModeStart, QAModeStop, QAMoveQuestion, QANextQuestion, QAPostponeQuestion, QAPreviousQuestion, RecordingModePause, RecordingModeResume, RecordingModeStart, RecordingModeStop, RequestHelp, SendDTMF, StateChangingOperation

public abstract class AbstractOperationImpl<RESULT,IMPL extends Operation<RESULT,IMPL>>
extends java.lang.Object
implements Operation<RESULT,IMPL>

Abstract base class for all Operation implementations.

Since:
5.1.0.0.29

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.avaya.conferencing.api.acp.control.operations.Operation
Operation.Impact
 
Constructor Summary
AbstractOperationImpl()
           
 
Method Summary
 void await()
          Blocks until the operation is completed.
 boolean await(long timeout, java.util.concurrent.TimeUnit unit)
          Causes the current thread to wait until the operation is completed, unless the thread is interrupted, or the specified waiting time elapses.
protected  void checkNotSubmitted()
          For use in Operations, throws an IllegalStateException if this operation has been submitted.
protected  void checkSubmitted()
          For use in Operations, throws an IllegalStateException if this operation has not been submitted.
 IMPL clone()
          Creates and returns a copy of this operation.
 RESULT get()
          Waits if necessary for the operation to complete, and then retrieves its result.
 RESULT get(long timeout, java.util.concurrent.TimeUnit unit)
          Waits if necessary for at most the given time for the operation to complete, and then retrieves its result, if available.
 boolean isDone()
          Returns true if this operation completed.
 boolean isSubmitted()
          Returns true if this operation has been submitted for execution.
 void set(java.util.concurrent.Future<RESULT> vFuture)
          This method is called by the ConferencingObject when the operation is accepted for execution.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.avaya.conferencing.api.acp.control.operations.Operation
getImpact, getVerb
 

Constructor Detail

AbstractOperationImpl

public AbstractOperationImpl()
Method Detail

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
Since:
5.1.0.0.29

isSubmitted

public boolean isSubmitted()
Returns true if this operation has been submitted for execution.

Specified by:
isSubmitted in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Returns:
true if this operation has been submitted for execution.
Since:
5.1.0.0.29

isDone

public boolean isDone()
Returns true if this operation completed. Completion may be due to normal termination, an exception, or cancellation - in all of these cases, this method will return true.

Specified by:
isDone in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Returns:
true if this operation completed.
Since:
5.1.0.0.29

get

public RESULT get()
           throws java.lang.InterruptedException,
                  java.util.concurrent.ExecutionException
Waits if necessary for the operation to complete, and then retrieves its result.

Specified by:
get in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Returns:
the computed result.
Throws:
java.lang.InterruptedException - If the current thread was interrupted while waiting.
java.util.concurrent.ExecutionException - If the computation threw an exception.
Since:
5.1.0.0.29

await

public void await()
           throws java.lang.InterruptedException
Blocks until the operation is completed. Completion may be due to normal termination, an exception, or cancellation.

Specified by:
await in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Throws:
java.lang.InterruptedException - if interrupted.
Since:
5.1.0.0.29

await

public boolean await(long timeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException
Causes the current thread to wait until the operation is completed, unless the thread is interrupted, or the specified waiting time elapses.

If the operation is completed then this method returns immediately.

If the operation has yet to complete then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happen:

If the operation completes then the method returns with the value true.

If the current thread:

then InterruptedException is thrown and the current thread's interrupted status is cleared.

If the specified waiting time elapses then the value false is returned. If the time is less than or equal to zero, the method will not wait at all.

Specified by:
await in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Parameters:
timeout - The maximum time to wait.
unit - The time unit of the timeout argument.
Returns:
true If the operation completed and false if the waiting time elapsed before the operation completed.
Throws:
java.lang.InterruptedException - if the current thread is interrupted while waiting.
Since:
5.1.0.0.29

get

public RESULT get(long timeout,
                  java.util.concurrent.TimeUnit unit)
           throws java.lang.InterruptedException,
                  java.util.concurrent.ExecutionException,
                  java.util.concurrent.TimeoutException
Waits if necessary for at most the given time for the operation to complete, and then retrieves its result, if available.

Specified by:
get in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Parameters:
timeout - The maximum time to wait.
unit - The time unit of the timeout argument.
Returns:
the computed result
Throws:
java.lang.InterruptedException - If the current thread was interrupted while waiting.
java.util.concurrent.ExecutionException - If the computation threw an exception.
java.util.concurrent.TimeoutException - If the wait timed out.
Since:
5.1.0.0.29

set

public void set(java.util.concurrent.Future<RESULT> vFuture)
This method is called by the ConferencingObject when the operation is accepted for execution.

Specified by:
set in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Parameters:
vFuture - The future for completion of the operation.
Since:
5.1.0.0.29

checkNotSubmitted

protected final void checkNotSubmitted()
For use in Operations, throws an IllegalStateException if this operation has been submitted.

Throws:
java.lang.IllegalStateException - if this operation has been submitted.
Since:
5.1.0.0.29

checkSubmitted

protected final void checkSubmitted()
For use in Operations, throws an IllegalStateException if this operation has not been submitted.

Throws:
java.lang.IllegalStateException - if this operation has not been submitted.
Since:
5.1.0.0.46

clone

public final IMPL clone()
Creates and returns a copy of this operation.

Specified by:
clone in interface Operation<RESULT,IMPL extends Operation<RESULT,IMPL>>
Overrides:
clone in class java.lang.Object
Returns:
a clone of this operation.
See Also:
Cloneable

Avaya Conferencing Provider API

Copyright © 2008-2009 Avaya. All Rights Reserved.