|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.telephony.media.provider.Base_Owner | +--javax.telephony.media.provider.Base_MediaService
Reference implementation of MediaService. This implementation of MediaService and Async.MediaService delegates to MPI.GroupProvider and MPI.MediaGroup, but manages the sync/async method layering, Listener and event dispatching.
Communication back to the MediaService is via Async.Events, which extend MediaEvent to include completion and notification methods. The Base.Event classes are used within the provider package, and they contain additional event processing and framework control methods.
Note:
Why Base_MediaService sits between MediaService and the MPI:
Base_MediaService provides a controlled implementation between the application and the MediaGroup implementation. The MediaService and MPI interfaces can be used reliably by each side (application developer and MediaGroup implementor), while the Base_MediaService class can be modified to provide services and adaptations for various frameworks. Base_MediaService enforces protocols and invariants that the MediaGroup would not trust the application to implement rigorously, and that the application and/or MediaGroup would find tedious to implement explicitly.
Note: provider implementers are encouraged to consult the source code for this and other provider package classes.
Fields inherited from interface javax.telephony.media.MediaConstants |
e_OK, q_Duration, q_Standard, q_Stop |
Fields inherited from interface javax.telephony.media.DelegationConstants |
ev_Delegated, q_Released, q_Removed, q_Retrieved, q_Returned, tag_CatchAll, tag_CatchNone, tag_DestroyRequest, tag_NeverReturn, tag_NormalReturn, tag_RemoveSession, tag_SessionDeath, v_Released |
Constructor Summary | |
Base_MediaService()
Create an unbound MediaService, using services identified as the installation default. |
|
Base_MediaService(MediaProvider provider)
Create an unbound MediaService, using services associated with the supplied MediaProvider object. |
|
Base_MediaService(java.lang.String peerName,
java.lang.String providerString)
Create an unbound MediaService, using services identified by the two String arguments. |
Method Summary | |
void |
addMediaListener(MediaListener listener)
Deprecated. |
Async.BindToCallEvent |
async_bindAndConnect(ConfigSpec configspec0,
java.lang.String string1,
java.lang.String string2)
Async version of bindAndConnect. |
Async.BindToCallEvent |
async_bindToCall(ConfigSpec configspec0,
Call call1)
Async version of bindToCall. |
Async.BindEvent |
async_bindToServiceName(ConfigSpec configspec0,
java.lang.String string1)
Async version of bindToServiceName. |
Async.BindEvent |
async_bindToTerminal(ConfigSpec configspec0,
Terminal terminal1)
Async version of bindToTerminal. |
Async.BindEvent |
async_bindToTerminalName(ConfigSpec configspec0,
java.lang.String string1)
Async version of bindToTerminalName. |
Async.Event |
async_cancelBindRequest()
Asynchronous version of cancelBindRequest. |
Async.MediaGroupEvent |
async_configure(ConfigSpec configspec0)
Async version of MediaService.configure(). |
Async.DelegationEvent |
async_delegateToService(java.lang.String serviceName,
int timeout,
java.lang.String catchTags)
Async version of delegateToService. |
Async.MediaGroupEvent |
async_getConfiguration()
Async version of MediaService.getConfiguration(). |
Async.MediaGroupEvent |
async_getParameters(Symbol[] symbol0)
Async version of MediaService.getParameters(). |
Async.MediaGroupEvent |
async_getTerminal()
Async version of MediaService.getTerminal(). |
Async.MediaGroupEvent |
async_getTerminalName()
Async version of MediaService.getTerminalName(). |
Async.MediaGroupEvent |
async_getUserValues(Symbol[] symbol0)
Async version of MediaService.getUserValues(). |
Async.ReleaseEvent |
async_release()
Async version of release(). |
Async.DelegationEvent |
async_releaseDelegated()
Cancel the delegation that is in progress on this MediaService. |
Async.ReleaseEvent |
async_releaseToDestroy()
Async version of releaseToDestroy(). |
Async.ReleaseEvent |
async_releaseToService(java.lang.String string0,
int int1)
Async version of releaseToService(). |
Async.ReleaseEvent |
async_releaseToTag(java.lang.String string0)
Async version of releaseToTag(). |
Async.DelegationEvent |
async_retrieve(Symbol cause)
Cancel the delegation that is in progress on this MediaService. |
Async.MediaGroupEvent |
async_setParameters(java.util.Dictionary dictionary0)
Async version of MediaService.setParameters(). |
Async.MediaGroupEvent |
async_setUserDictionary(java.util.Dictionary dictionary0)
Async version of MediaService.setUserDictionary(). |
Async.MediaGroupEvent |
async_setUserValues(java.util.Dictionary dictionary0)
Async version of MediaService.setUserValues(). |
Async.MediaGroupEvent |
async_stop()
Async version of MediaService.stop(). |
Async.MediaGroupEvent |
async_triggerRTC(Symbol symbol0)
Trigger an RTC action from the application. |
void |
bindAndConnect(ConfigSpec configspec0,
java.lang.String string1,
java.lang.String string2)
the Bind and Release Methods. |
Connection |
bindToCall(ConfigSpec configspec0,
Call call1)
Bind this MediaService to a particular Call. |
void |
bindToServiceName(ConfigSpec configspec0,
java.lang.String string1)
Bind this MediaService to a call directed to serviceName . |
void |
bindToTerminal(ConfigSpec configspec0,
Terminal terminal1)
Bind this MediaService to a particular Terminal. |
void |
bindToTerminalName(ConfigSpec configspec0,
java.lang.String string1)
Bind this MediaService to a particular Terminal. |
void |
cancelBindRequest()
Revoke previous bind or release method on this MediaService. |
void |
configure(ConfigSpec configspec0)
MediaGroup Methods: configure |
DelegationEvent |
delegateToService(java.lang.String serviceName,
int timeout,
java.lang.String catchTags)
Delegation methods |
static MediaProvider |
findMediaProvider(java.lang.String peerName,
java.lang.String providerString)
Get a MediaProvider from the given Strings. |
ConfigSpec |
getConfiguration()
Return a ConfigSpec that describes the current configuration of this MediaService. |
MediaProvider |
getMediaProvider()
Return the MediaProvider used by this MediaService. |
java.util.Dictionary |
getParameters(Symbol[] symbol0)
Get the value of various parameters from the MediaGroup bound to this MediaService. |
Terminal |
getTerminal()
Return the Terminal associated with the MediaService. |
java.lang.String |
getTerminalName()
Return the installation-specific String that identifies the Terminal to which this MediaService is bound. |
java.util.Dictionary |
getUserValues(Symbol[] symbol0)
Creates and returns a new Dictionary that contains the UserDictionary values corresponding to a given set of keys. |
boolean |
isBinding()
|
boolean |
isBound()
Return true iff this MediaService is bound to a MediaGroup. |
boolean |
isDelegated()
Return true if this MediaService is delegating ownership so some other MediaService. |
boolean |
isOwner()
Return true if this MediaService is currently the owner of a bound MediaGroup. |
void |
onEventDone(Base.Event event)
If event is a BindAndReleaseEvent, invoke callback in _bindAndReleaseListener |
void |
release()
Release the MediaGroup from this MediaService using a NormalReturn. |
void |
releaseDelegated()
Release while delegation is active. |
void |
releaseToDestroy()
Release with an indication that the call is or should be disconnected and the MediaGroup destroyed. |
void |
releaseToService(java.lang.String string0,
int int1)
Release the MediaGroup from this MediaService with an indication that the call should to be processed by some other service. |
void |
releaseToTag(java.lang.String string0)
Release MediaGroup from this MediaService to a previous owner. |
void |
removeMediaListener(MediaListener listener)
Deprecated. |
void |
retrieve(Symbol cause)
Terminate the delegation that is in progress on this MediaService. |
void |
setParameters(java.util.Dictionary dictionary0)
Set the value of various parameters for the MediaGroup bound to this MediaService. |
void |
setUserDictionary(java.util.Dictionary dictionary0)
Set the entire UserDictionary to a new collection of key-value pairs. |
void |
setUserValues(java.util.Dictionary dictionary0)
Set the values of several UserDictionary keys. |
void |
stop()
Stop media operations on this MediaService. |
java.lang.String |
toString()
|
void |
triggerRTC(Symbol symbol0)
Trigger a RTC action from the application. |
Methods inherited from class javax.telephony.media.provider.Base_Owner |
addListener, removeListener, setExceptionHandler |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.telephony.media.MediaService |
addListener, removeListener |
Constructor Detail |
public Base_MediaService(MediaProvider provider)
provider
- a MediaProvider instancepublic Base_MediaService()
public Base_MediaService(java.lang.String peerName, java.lang.String providerString) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, ProviderUnavailableException
peerName
- the name of a Class that implements MediaPeer.providerString
- a "login" string for that MediaPeer.java.lang.ClassNotFoundException
- if MediaPeer class is not foundjava.lang.IllegalAccessException
- if MediaPeer class is not accessiblejava.lang.InstantiationException
- if MediaPeer class does not instantiateProviderUnavailableException
- if Provider is not availableClassCastException
- if Provider instance is not a MediaProviderMethod Detail |
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isBinding()
public boolean isBound()
MediaService
true
iff this MediaService is bound to a MediaGroup.isBound
in interface MediaService
public boolean isDelegated()
Delegation
isDelegated
in interface Delegation
public boolean isOwner()
Delegation
isOwner() is: (isBound() && !isDelegated())
isOwner
in interface Delegation
public void onEventDone(Base.Event event)
onEventDone
in interface MPI.Owner
onEventDone
in class Base_Owner
javax.telephony.media.provider.MPI.Owner
Base.Event
public void addMediaListener(MediaListener listener)
Implements deprecated MediaService method.
addMediaListener
in interface MediaService
javax.telephony.media.MediaService
listener
- an object that implements
one or more of the ResourceListener interfaces and/or
the MediaServiceListener interface.MediaService.removeMediaListener(javax.telephony.media.MediaListener)
public void removeMediaListener(MediaListener listener)
Implements deprecated MediaService method.
removeMediaListener
in interface MediaService
javax.telephony.media.MediaService
listener
- an object that implements MediaListenerMediaService.addMediaListener(javax.telephony.media.MediaListener)
public static MediaProvider findMediaProvider(java.lang.String peerName, java.lang.String providerString) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, ProviderUnavailableException
If the given peerName is null:
Note: This method can be used as a MediaProvider Factory.
For example:
MediaProvider mp = BasicMediaService.findMediaProvider(...);
peerName
- name of the MediaPeer ClassproviderString
- a String that identifies
the (MediaPeer-specific) MediaProvider and other information.java.lang.ClassNotFoundException
- if MediaPeer class is not foundjava.lang.IllegalAccessException
- if MediaPeer class is not accessiblejava.lang.InstantiationException
- if MediaPeer class does not instantiateProviderUnavailableException
- if Provider is not availableClassCastException
- if Provider instance is not a MediaProviderpublic MediaProvider getMediaProvider()
getMediaProvider
in interface MediaService
public void cancelBindRequest()
Note: This functions identically to async_cancelBindRequest, but does not return the Event [it is part of the synchronous API].
cancelBindRequest
in interface MediaService
public Async.Event async_cancelBindRequest()
Applications that do not care about the completion status may as well use cancelBindRequest.
async_cancelBindRequest
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
MediaService.cancelBindRequest()
public DelegationEvent delegateToService(java.lang.String serviceName, int timeout, java.lang.String catchTags) throws MediaBindException, MediaConfigException
delegateToService
in interface Delegation
javax.telephony.media.Delegation
serviceName
- the service name of the recipient.timeout
- the time to wait for a service to become ready.catchTags
- a String of tags to control releaseToTag(String);
NotBoundException
- if not currently bound to a MediaGroupNotOwnerException
- if delegateToService in progress.MediaBindException
- one of:
BindInProgressException,
NoServiceAssignedException,
NoServiceReadyException,
BindCancelledExceptionBindCancelledException
- if interrupted by cancelBindRequest.NoServiceAssignedException
- if serviceName is not recognised
or is not mapped to any known serviceName.NoServiceReadyException
- if none of the MediaServices registered to serviceName are ready
and none become ready within timeout
milliseconds.MediaConfigException
- if the MediaGroup could not be configured for the recipient service.MediaService.releaseToService(String, int)
,
Async.DelegationListener.onDelegateToServiceDone(MediaServiceEvent)
public Async.DelegationEvent async_delegateToService(java.lang.String serviceName, int timeout, java.lang.String catchTags) throws MediaBindException
Async_Delegation
Transfer ownership of the bound MediaGroup to another MediaService, and stay on the owner stack until the MediaGroup is returned.
Invokes onDelegateToServiceDone
when complete.
async_delegateToService
in interface Async_Delegation
javax.telephony.media.async.Async_Delegation
serviceName
- a String naming the servicetimeout
- an int specifying the timeout in millisecondscatchTags
- a String of tags to match a possible releaseTagNotBoundException
- if not currently bound to a MediaGroup.MediaBindException
- a BindInProgressException
if bind or release already in progressNotOwnerException
- if MediaGroup is already delegated.Delegation.delegateToService(java.lang.String, int, java.lang.String)
public void retrieve(Symbol cause) throws NotBoundException, MediaBindException, NotDelegatedException
Delegation
The sequence of processing is:
If retrieve is processed when this MediaService.isOwner() is true, because delegateToService has returned (or was never invoked), this method succeeds with no other effect.
If retrieve() is processed when this MediaService.isBound() is false, then it throws NotBoundException.
Note: the state of isOwner() and isBound() may change between the time retrieve() is invoked and when it is processed by the platform. Other owners may release or retrieve the MediaGroup.
Note: This method may have undesirable effects on the application to which the MediaGroup has been delegated, or may have undersirable effects on the user interface experience of a caller. This function is intended to be used within suites of coordinated applicatations where the effects are understood and acceptable. If you do not know the effect of this method on the application which is currently the owner, then do not use this method.
Note: the current owner (or any owner between the current and the requesting owner) could delay retrieval by setting an parameter p_RetrieveDelay to the maximum milliseconds to wait (up to a framework determined maximum) before responding to the retrieval request. That would give the owner time to say goodbye, and issue releaseToTag(tab_Retrieval). The framework could intervene after the specified delay to enforce timely retrieval. The current specification corresponds to p_RetrieveDelay = 0, which is appropriate for retrieving from a music-on-hold application when a live agent is available.
retrieve
in interface Delegation
javax.telephony.media.Delegation
cause
- a Symbol that becomes the return value
for getRetrieveCause().NotBoundException
- if not currently bound to a MediaGroupMediaBindException
- a BindInProgressException
if a bind or release is in progress.NotDelegatedException
- (a RuntimeException) if
delegateToService has completed or not been called.public Async.DelegationEvent async_retrieve(Symbol cause) throws NotBoundException, BindInProgressException, NotDelegatedException
Async_Delegation
Async version of Delegation.retrieve(Symbol)
.
Invokes onRetrieveDone
when complete.
async_retrieve
in interface Async_Delegation
javax.telephony.media.async.Async_Delegation
cause
- a Symbol that becomes the return value for getRetrieveCause().NotBoundException
- if not currently bound to a MediaGroup.MediaBindException
- a BindInProgressException
if bind or release is already in progressNotDelegatedException
- if delegateToService is not active.Delegation.retrieve(javax.telephony.media.Symbol)
public void releaseDelegated() throws NotBoundException, MediaBindException, NotDelegatedException
Delegation
pre-conditions: (isBound() && isDelegated())
post-conditions: (!isBound() && !isDelegated())
Note: may throw an Exception if the pre-conditions are not true when the request is actually processed by the platform. Processing by other owners may change these properties between the time the method is invoked and when it is processed.
Note: releaseDelegated() can succeed only if it is processed while delegateToService is active on this MediaService. This is the one case where the platform may refuse to release. This restriction protects against a race when the application tries to get off the ownerstack just after (but before the app has been informed that) the MediaService has regained ownership. [that is, the previous/current owner just released the MediaGroup to this MediaService.] With this restriction, when the application eventually gets the onDelegateDone() notification, it is and will continue to be the owner; when the platform eventually processes releaseDelegated() it will throw NotDelegatedException.
releaseDelegated
in interface Delegation
javax.telephony.media.Delegation
NotBoundException
- if not currently bound to a MediaGroupMediaBindException
- a BindInProgressException
if a bind or release is in progress.NotDelegatedException
- (a RuntimeException) if
delegateToService has completed or not been called.public Async.DelegationEvent async_releaseDelegated() throws NotBoundException, BindInProgressException, NotDelegatedException
Async_Delegation
Async version of Delegation.releaseDelegated()
.
Invokes onRetrieveDone
when complete.
async_releaseDelegated
in interface Async_Delegation
javax.telephony.media.async.Async_Delegation
NotBoundException
- if not currently bound to a MediaGroup.MediaBindException
- a BindInProgressException
if bind or release is already in progressNotDelegatedException
- if delegateToService is not active.Delegation.releaseDelegated()
public void bindAndConnect(ConfigSpec configspec0, java.lang.String string1, java.lang.String string2) throws MediaBindException, MediaConfigException, MediaCallException
bindAndConnect
in interface MediaService
javax.telephony.media.MediaService
configSpec
- a ConfigSpec describing the requested configurationorigAddr
- a String identifying the origination AddressdialDigits
- a String identifying the destination AddressMediaBindException
- one of
AlreadyBoundException, BindInProgressException, BindCancelledException.MediaConfigException
- if a MediaGroup can not be configured as requested.MediaCallException
- if the Call or Connections cannot be established.Call.connect(Terminal, Address, String)
public Async.BindToCallEvent async_bindAndConnect(ConfigSpec configspec0, java.lang.String string1, java.lang.String string2) throws MediaBindException
Async.MediaService
async_bindAndConnect
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
cs
- a ConfigSpec objects1
- a String specifing the origAddrs2
- a String specifing the dialDigitsMediaBindException
- for preconditions;
AlreadyBoundException or
BindInProgressExceptionMediaService.bindAndConnect(javax.telephony.media.ConfigSpec, java.lang.String, java.lang.String)
public Connection bindToCall(ConfigSpec configspec0, Call call1) throws MediaBindException, MediaConfigException, MediaCallException
MediaService
The Call must be in the ACTIVE
state (or else
attribute a_DealloateOnIdle
must be FALSE
).
Otherwise, disconnect processing
may interfere with allocating resources.
To create Connections and bind to a new Call,
use bindAndConnect
.
bindToCall
in interface MediaService
javax.telephony.media.MediaService
configSpec
- a ConfigSpec describing the requested configuration.call
- a JTAPI Call objectMediaBindException
- one of
AlreadyBoundException, BindInProgressException, BindCancelledException.MediaConfigException
- if a MediaGroup can not be configured as requested.MediaCallException
- encapsulates any call processing exceptions
generated while trying to establish the new Call and Connection.public Async.BindToCallEvent async_bindToCall(ConfigSpec configspec0, Call call1) throws MediaBindException
Async.MediaService
async_bindToCall
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
cs
- a ConfigSpec objectcall
- a Call objectMediaBindException
- for preconditions;
AlreadyBoundException or
BindInProgressExceptionMediaService.bindToCall(javax.telephony.media.ConfigSpec, javax.telephony.Call)
public void bindToServiceName(ConfigSpec configspec0, java.lang.String string1) throws MediaBindException, MediaConfigException
MediaService
serviceName
.
Wait until this MediaService is bound to the MediaGroup of a Terminal
connected to a Call that is directed to the given serviceName
.
A call is directed to this serviceName
when:
serviceName
.disposition
String of
releaseToService
maps to serviceName
The mapping of disposition strings or call characteristics to service names is implementation specific, and is controlled by implementation specific administrative interfaces. For example:
releaseToService
serviceName
that matches Address.toString()
RunnableMediaService
interface.
This method does not complete unless the ConfigSpec is satisfied. If resources are not available when a call arrives, then the underlying call discrimination or routing process may leave the call unanswered until resources are available, or the call may be routed to some other service.
By default, the Connection of the Call to this Terminal is brought
to the CONNECTED
state before this method returns.
The attribute
can be set in the ConfigSpec to override the default.
a_LocalState
Note:
This function blocks, waiting for a call to be directed to
the given serviceName
.
If MediaService.cancelBindRequest()
is subsequently invoked,
this method unblocks throwing a BindCancelledException
.
bindToServiceName
in interface MediaService
javax.telephony.media.MediaService
configSpec
- a ConfigSpec describing the requested configurationserviceName
- the administrative name for this MediaServiceMediaBindException
- one of
AlreadyBoundException, BindInProgressException, BindCancelledException.MediaConfigException
- one of
BadConfigSpecException, ResourceNotSupportedExceptiona_LocalState
,
RunnableMediaService
public Async.BindEvent async_bindToServiceName(ConfigSpec configspec0, java.lang.String string1) throws MediaBindException
Async.MediaService
async_bindToServiceName
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
cs
- a ConfigSpec objectserviceName
- a StringMediaBindException
- for preconditions;
AlreadyBoundException or
BindInProgressExceptionMediaService.bindToServiceName(javax.telephony.media.ConfigSpec, java.lang.String)
public void bindToTerminalName(ConfigSpec configspec0, java.lang.String string1) throws MediaBindException, MediaConfigException
MediaService
It is possible to bind to a Terminal that does not have any Connections. However, disconnect processing may prevent configuration of a MediaGroup unless there is an active Connection to the Terminal.
Throws a MediaConfigException if the Terminal cannot be connected to a MediaGroup, or if the MediaGroup cannot be configured as requested.
bindToTerminalName
in interface MediaService
javax.telephony.media.MediaService
configSpec
- a ConfigSpec describing the requested configurationterminalName
- a String that names a media capable TerminalMediaBindException
- one of
AlreadyBoundException, BindInProgressException, BindCancelledException.MediaConfigException
- if a MediaGroup can not be configured as requestedpublic Async.BindEvent async_bindToTerminalName(ConfigSpec configspec0, java.lang.String string1) throws MediaBindException
Async.MediaService
async_bindToTerminalName
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
cs
- a ConfigSpec objects1
- a terminal name StringMediaBindException
- for preconditions;
AlreadyBoundException or
BindInProgressExceptionMediaService.bindToTerminalName(javax.telephony.media.ConfigSpec, java.lang.String)
public void bindToTerminal(ConfigSpec configspec0, Terminal terminal1) throws MediaBindException, MediaConfigException
MediaService
This is functionally equivalent to:
bindToTerminalName
(configSpec, term.getName())
,
but may perform better in some implementations.
bindToTerminal
in interface MediaService
javax.telephony.media.MediaService
configSpec
- a ConfigSpec describing the requested configurationterminal
- a media-capable Terminal objectMediaBindException
- one of
AlreadyBoundException, BindInProgressException, BindCancelledException.MediaConfigException
- if a MediaGroup can not be configured as requested.public Async.BindEvent async_bindToTerminal(ConfigSpec configspec0, Terminal terminal1) throws MediaBindException
Async.MediaService
async_bindToTerminal
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
cs
- a ConfigSpec objectt1
- a JTAPI Terminal objectMediaBindException
- for preconditions;
AlreadyBoundException or
BindInProgressExceptionMediaService.bindToTerminal(javax.telephony.media.ConfigSpec, javax.telephony.Terminal)
public void release() throws NotBoundException, MediaBindException
MediaService
For this and other MediaService release methods:
pre-conditions: (isBound() && isOwner())
post-conditions: (!isBound())
How the call is processed after release()
depends on whether some other media service has
delegated
the call.
If the call was delegated,
then ownership of the call is returned to the
MediaService which delegated the call.
If the call was not delegated, then the system
framework gets ownership and (typically) disconnects the
call and releases the resources.
Note:To indicate that framework disconnect processing
should be done even if the call is delegated,
use the MediaService.releaseToDestroy()
method.
Note:To release this MediaService, but direct the further
processing of the call to a specific new owner,
an application may use:
MediaService.releaseToService(String, int)
.
Note:To release this MediaService, but direct the further
processing of the call to a specific previous owner
(which used delegateToService()),
an application may use:
MediaService.releaseToTag(String)
.
release
in interface MediaService
javax.telephony.media.MediaService
NotBoundException
- if not currently bound to a MediaGroupMediaBindException
- one of:
BindInProgressException or BindCancelledException.BindInProgressException
- if a bind or release is already in progress.BindCancelledException
- if interrupted by cancelBindRequest.public Async.ReleaseEvent async_release() throws MediaBindException
Async.MediaService
async_release
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
MediaBindException
- a BindInProgressExceptionMediaService.release()
public void releaseToService(java.lang.String string0, int int1) throws NotBoundException, MediaBindException, MediaConfigException
MediaService
Typically, the framework maps the
disposition string to the serviceName of some other MediaService.
The framework finds another MediaService that is waiting
(in bindToServiceName
) for that serviceName,
configures the MediaGroup for that MediaService,
binds the MediaGroup to that MediaService,
and releases the MediaGroup from this MediaService.
If the given disposition string can not be mapped to a recognised serviceName, NoServiceAssignedException is thrown. If the disposition code is recognised, but no service suppliers are ready, this method waits for up to timeout milliseconds for a service to become ready and then throw NoServiceReadyException.
On completion, this MediaService is unbound from the MediaGroup. Further operations on this MediaService throw NotBoundException, until another MediaGroup is bound to this MediaService.
Note:
The releasing media service can store additional information
for the new owner by using MediaService.setUserValues(Dictionary)
.
Implementation note: The disposition strings used by an application should be defined and documented as part of the external interface of the application. The installation and administration processes of a framework use that information to setup the mapping from disposition codes to the handling services. In some cases the framework may supply services to handle some disposition codes.
Note:
Disposition strings beginning with "Special:" are reserved
for standardized treatment.
For example:
Special:Queue?address=<address> | queue the call at the given address | |
Special:Transfer?address=<address> | transfer the call to the given address |
releaseToService
in interface MediaService
javax.telephony.media.MediaService
disposition
- a String that identifies the next MediaService.timeout
- milliseconds to wait for service to become ready.NotBoundException
- if not currently bound to a MediaGroupMediaBindException
- one of:
NoServiceAssignedException, NoServiceReadyException,
BindInProgressException, BindCancelledExceptionNoServiceAssignedException
- if disposition is not recognised or is not mapped to any serviceName.NoServiceReadyException
- if none of the MediaServices registered to disposition are ready
and none become ready within timeout
milliseconds.BindInProgressException
- if a bind or release
is already in progress.BindCancelledException
- if interrupted by cancelBindRequest.MediaConfigException
- if the MediaGroup could not be configured for the recipient service.public Async.ReleaseEvent async_releaseToService(java.lang.String string0, int int1) throws MediaBindException
Async.MediaService
async_releaseToService
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
serviceName
- a Stringtimeout
- an int specifying timeout in millisecondsMediaBindException
- a BindInProgressExceptionMediaService.releaseToService(java.lang.String, int)
public void releaseToTag(java.lang.String string0) throws MediaBindException
MediaService
delegateToService()
with catchTags that matche one of the given returnTags.
Some return tags have assigned usage:
Tag Name: | Used for: |
tag_NormalReturn | simple release() |
tag_DestroyRequest | releaseToDestroy |
tag_RemoveSession | releaseToRemove |
null or "" | NormalReturn |
Note: each previous owner is checked, from most recent to oldest. If the previous owner does not catch the return tag, then delegateToService completes with qualifier q_Released, and that MediaService !isBound(). If the previous owner does catch the return tag, then it becomes the new owner: delegateToService completes with qualifier q_Returned and that MediaService isBound() and isOwner().
Note: the returnTag conceptually specifies a single tag, indicating the terminatation status of this MediaService. Each 'catcher' should catch all that apply, using catchTags. However, to enable interoperability with applications that may be catching disjoint names, the MediaService invoking returnToTag is allowed to supply a space-separated list of tags in returnTag. The list of tags is consdered to be a list of synonyms, each previous owner is checked to see if its list of catchTags matches any one of the given returnTag tags.
releaseToTag
in interface MediaService
javax.telephony.media.MediaService
returnTag
- a String of tags to match a previous catchTagsMediaBindException
- a BindInProgressException
if a bind or release is already in process.MediaService.release()
,
MediaService.releaseToService(String, int)
public Async.ReleaseEvent async_releaseToTag(java.lang.String string0) throws NotBoundException, MediaBindException
Async.MediaService
async_releaseToTag
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
returnTag
- a String of tags to match delegated catchTagsNotBoundException
- if not currently bound to a MediaGroup.MediaBindException
- a BindInProgressExceptionMediaService.releaseToTag(java.lang.String)
public void releaseToDestroy() throws MediaBindException
MediaService
Equivalent to releaseToTag(tag_DestroyRequest).
releaseToDestroy
in interface MediaService
javax.telephony.media.MediaService
MediaBindException
- a BindInProgressException
if a bind or release is already in process.MediaService.releaseToTag(String)
public Async.ReleaseEvent async_releaseToDestroy() throws MediaBindException
Async.MediaService
async_releaseToDestroy
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
MediaBindException
- a BindInProgressExceptionMediaService.releaseToDestroy()
public void configure(ConfigSpec configspec0) throws NotBoundException, MediaConfigException
configure
in interface MediaService
javax.telephony.media.MediaService
configSpec
- a ConfigSpec describing the requested configurationNotBoundException
- if not currently bound to a MediaGroupMediaConfigException
- if resources can not be configured as requestedpublic Async.MediaGroupEvent async_configure(ConfigSpec configspec0)
Async.MediaService
async_configure
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
cs
- a ConfigSpec objectMediaService.configure(javax.telephony.media.ConfigSpec)
public ConfigSpec getConfiguration() throws NotBoundException
MediaService
Note:. This does not generally return a copy of the ConfigSpec used to create/configure this MediaGroup. The returned ConfigSpec describes the MediaService/MediaGroup as it is currently and actually configured.
The attributes of the individual resources
appear in the ResourceSpec corresponding to that resource.
The parameters and attributes of the MediaService/MediaGroup
as a whole are available using
ConfigSpec.getAttributes()
and
ConfigSpec.getParameters()
.
getConfiguration
in interface MediaService
javax.telephony.media.MediaService
NotBoundException
- if not currently bound to a MediaGrouppublic Async.MediaGroupEvent async_getConfiguration()
Async.MediaService
async_getConfiguration
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
MediaService.getConfiguration()
public java.lang.String getTerminalName() throws NotBoundException
MediaService
getTerminalName
in interface MediaService
javax.telephony.media.MediaService
NotBoundException
- if not currently bound to a MediaGroupTerminal.getName()
public Async.MediaGroupEvent async_getTerminalName()
Async.MediaService
async_getTerminalName
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
MediaService.getTerminalName()
public Terminal getTerminal() throws NotBoundException
MediaService
Note:
If this MediaService is not associated with a JTAPI Provider,
this method may return null
.
Note:
This method is supplied as a potential accelerator for some
implementations. Applications that need a reference to the
bound Terminal without reference to other JTAPI objects should
restrict their usage to MediaService.getTerminalName()
.
getTerminal
in interface MediaService
javax.telephony.media.MediaService
NotBoundException
- if not currently bound to a MediaGrouppublic Async.MediaGroupEvent async_getTerminal()
Async.MediaService
async_getTerminal
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
MediaService.getTerminal()
public void triggerRTC(Symbol symbol0) throws NotBoundException
MediaService
This is a non-blocking, one-way invocation.
This method allows the application to synthesize the triggering
of RTC actions. The RTC Condition associated with this action
is rtcc_TriggerRTC
.
The rtca actions are documented by various Resources in the ResourceConstants interface. Look for Symbol fields with the rtca_ prefix.
Note: this method was ill-conceived and has been recalled. RTC actions internally are associated with a specific transaction. Until implementations with the correct semantics are defined, it is better to use the existing transactional commands.
For example: use Player.pause() instead of triggerRTC(Player.rtca_Pause).
In a future release there may be:
void triggerRTC(Symbol rtca, Async.Event event)
which would effect only the transaction associated
with the given event.
triggerRTC
in interface MediaService
javax.telephony.media.MediaService
rtca
- a Symbol for a recognized RTC action: rtca_ActionNotBoundException
- if not currently bound to a MediaGrouppublic Async.MediaGroupEvent async_triggerRTC(Symbol symbol0)
Async.MediaService
async_triggerRTC
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
rtca
- an RTC action SymbolMediaService.triggerRTC(javax.telephony.media.Symbol)
public void stop() throws NotBoundException
MediaService
ResourceEvent.getQualifier() == ResourceEvent.q_Stop
This method may not unblock a bind or release request.
For that effect, use MediaService.cancelBindRequest()
.
stop
in interface MediaService
javax.telephony.media.MediaService
NotBoundException
- if not currently bound to a MediaGrouppublic Async.MediaGroupEvent async_stop()
Async.MediaService
async_stop
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
MediaService.stop()
public java.util.Dictionary getUserValues(Symbol[] symbol0) throws NotBoundException
MediaService
If the keys argument is null
then a snapshot of
the entire UserDictionary is returned.
For interoperability with other languages, the keys in the Dictionary are restricted to type Symbol. The result of using keys of other types is undefined, but throwing a ClassCastException is considered compliant.
getUserValues
in interface MediaService
javax.telephony.media.MediaService
keys
- an array of key SymbolsNotBoundException
- if not currently bound to a MediaGroupMediaService.setUserValues(java.util.Dictionary)
public Async.MediaGroupEvent async_getUserValues(Symbol[] symbol0)
Async.MediaService
async_getUserValues
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
keys
- an array of Symbols indicating parameters to getMediaService.getUserValues(javax.telephony.media.Symbol[])
public void setUserValues(java.util.Dictionary dictionary0) throws NotBoundException
MediaService
dict
are merged with the current UserDictionary.setUserValues
in interface MediaService
javax.telephony.media.MediaService
dict
- a Dictionary whose contents is merged into the UserDictionary.NotBoundException
- if not currently bound to a MediaGroupMediaService.getUserValues(javax.telephony.media.Symbol[])
public Async.MediaGroupEvent async_setUserValues(java.util.Dictionary dictionary0)
Async.MediaService
async_setUserValues
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
dict
- a Dictionary of user valuesMediaService.setUserValues(java.util.Dictionary)
public void setUserDictionary(java.util.Dictionary dictionary0) throws NotBoundException
MediaService
Note:
setUserDictionary(null)
achieves the same result
as setUserDictionary(new Hashtable())
;
setUserDictionary
in interface MediaService
javax.telephony.media.MediaService
newDict
- A Dictionary whose contents is copied into the MediaGroup.NotBoundException
- if not currently bound to a MediaGrouppublic Async.MediaGroupEvent async_setUserDictionary(java.util.Dictionary dictionary0)
Async.MediaService
async_setUserDictionary
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
dict
- a Dictionary of user valuesMediaService.setUserDictionary(java.util.Dictionary)
public java.util.Dictionary getParameters(Symbol[] symbol0) throws NotBoundException
MediaService
If the params is null
, then get all parameters.
For example:
Dictionary parms; parms = getParameters(null); // on return, parms contains all parameters.Some implementations may not be able to retrieve parameter values when one or more resources are busy. In that case,
null
is returned.
If a key refers to a Resource that is not present, or the resource has no meaning associated with a particular Symbol, the key is ignored, no error is generated, and that key does not appear returned Dictionary.
getParameters
in interface MediaService
javax.telephony.media.MediaService
params
- an array of Symbols naming parameters to be retrieved.NotBoundException
- if not currently bound to a MediaGroupMediaService.setParameters(java.util.Dictionary)
public Async.MediaGroupEvent async_getParameters(Symbol[] symbol0)
Async.MediaService
async_getParameters
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
keys
- an array of Symbols indicating parameters to getMediaService.getParameters(javax.telephony.media.Symbol[])
public void setParameters(java.util.Dictionary dictionary0) throws NotBoundException
MediaService
For interoperability with other languages,
the keys in the Dictionary are restricted to type Symbol
.
The result of using keys of other types is undefined,
but a compliant implementation may throw
a ClassCastException or IllegalArgumentException.
If a parameter Symbol refers to a resource that is not present, or the MediaGroup or Resource has no meaning associated with a particular Symbol, the setting for that parameter is quietly ignored.
setParameters
in interface MediaService
javax.telephony.media.MediaService
params
- a Dictionary in which the keys are Symbols
and the values are assigned to the parameter with that Symbol name.NotBoundException
- if not currently bound to a MediaGroupMediaService.getParameters(javax.telephony.media.Symbol[])
public Async.MediaGroupEvent async_setParameters(java.util.Dictionary dictionary0)
Async.MediaService
async_setParameters
in interface Async.MediaService
javax.telephony.media.async.Async.MediaService
dict
- a Dictionary of parameters to setMediaService.setParameters(java.util.Dictionary)
|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |