|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Methods for manipulating Containers. Containers correspond to filesystem directories. A Container may contain other Containers, Media Data Objects (MDOs), file objects, or other data objects.
MDO data objects in a Container are used for playing and recording with the Player.play() and Recorder.record() methods. File data objects are used to hold contexts and grammars for the the ASR interface.
Containers are manipulated by reference to their full name,
which is a String in the usual heirarchical format as
commonly seen in file pathnames or URLs.
That is, strings of the form:
//servername/container1/.../containerN/dataobject
The separator characters between containers can be either of "/" or "\" (forward slash or back slash), and those characters can only be used as separators.
Note: the "//servername/" prefix can be omitted; the MediaProvider uses the servername of the host to which the MediaProvider is connected.
Note: in the future this format may be extended to include additional "protocol" names in the URL format. Developers should use the ":" character in names with caution.
A ContainerService object is obtained using:
((ContainerProvider)MediaProvider).getContainerService()
Fields inherited from interface javax.telephony.media.container.ContainerConstants |
b_Append, b_Create, b_Exclusive, b_Truncate, e_OK, k_InputParameters, k_MediaType, k_MediaTypes, v_AccessCopy, v_AccessRead, v_AccessWrite, v_Begin, v_Bytes, v_Create, v_Current, v_End, v_Fail, v_MDO, v_MilliSeconds |
Fields inherited from interface javax.telephony.media.CoderConstants |
v_24kADPCM, v_32kADPCM, v_44kADPCM, v_48k8BitLinear, v_48kALawPCM, v_48kMuLawPCM, v_64k8BitLinear, v_64kALawPCM, v_64kMuLawPCM, v_88k8BitLinear, v_88kALawPCM, v_88kMuLawPCM, v_ADPCM_24k, v_ADPCM_32k, v_ADPCM_44k, v_ADSI, v_ALawPCM_48k, v_ALawPCM_64k, v_ALawPCM_88k, v_ASCII, v_Linear8Bit_48k, v_Linear8Bit_64k, v_Linear8Bit_88k, v_MuLawPCM_48k, v_MuLawPCM_64k, v_MuLawPCM_88k, v_TDD |
Method Summary | |
void |
changeMode(java.lang.String fullName,
Symbol accessMode,
java.util.Dictionary optargs)
Change the static access rights of the named DataObject. |
void |
copy(java.lang.String fullName,
java.lang.String target,
java.util.Dictionary optargs)
Copy a DataObject to a new DataObject name. |
void |
createContainer(java.lang.String fullName,
java.util.Dictionary optargs)
Create a new Container. |
DataObject |
createDataObject(java.lang.String fullName,
Symbol accessMode,
java.util.Dictionary optargs)
Create a new Media Data Object and open it. |
void |
destroy(java.lang.String fullName,
java.util.Dictionary optargs)
Remove the named Container or DataObject. |
java.util.Dictionary |
getInfo(java.lang.String fullName,
Symbol[] keys,
java.util.Dictionary optargs)
Return arbitrary user infomation stored with a Container or DataObject. |
java.util.Dictionary |
getParameters(java.lang.String fullName,
Symbol[] keys,
java.util.Dictionary optargs)
Get system parameters on a Container or DataObject. |
java.lang.String[] |
listObjects(java.lang.String fullName,
java.util.Dictionary optargs)
List Containers and DataObjects contained in the named Container. |
DataObject |
openDataObject(java.lang.String fullName,
Symbol accessMode,
boolean ifNoExist,
boolean truncate,
java.util.Dictionary optargs)
Open a Media Data Object. |
void |
rename(java.lang.String fullName,
java.lang.String newName,
java.util.Dictionary optargs)
Rename a Container or DataObject within its current Container. |
void |
setInfo(java.lang.String fullName,
java.util.Dictionary dict)
Store arbitrary user infomation with a Container or DataObject. |
void |
setParameters(java.lang.String fullName,
java.util.Dictionary params)
Set system parameters on a Container or DataObject. |
Method Detail |
public void setInfo(java.lang.String fullName, java.util.Dictionary dict) throws ContainerException
fullName
- the full Container or DataObject path String.dict
- a Dictionary of infomation to be stored on the container.ContainerException
- if anything goes wrong.getInfo(java.lang.String, javax.telephony.media.Symbol[], java.util.Dictionary)
public java.util.Dictionary getInfo(java.lang.String fullName, Symbol[] keys, java.util.Dictionary optargs) throws ContainerException
fullName
- the full Container or DataObject path String.keys
- a Symbol[] selecting the items to retrieve.
optargs
- a Dictionary of implementation-specific information.ContainerException
- if anything goes wrong.setInfo(java.lang.String, java.util.Dictionary)
public void setParameters(java.lang.String fullName, java.util.Dictionary params) throws ContainerException
fullName
- the full Container or DataObject path String.params
- a Dictionary of parameters to be set.ContainerException
- if anything goes wrong.getParameters(java.lang.String, javax.telephony.media.Symbol[], java.util.Dictionary)
public java.util.Dictionary getParameters(java.lang.String fullName, Symbol[] keys, java.util.Dictionary optargs) throws ContainerException
fullName
- the full Container or DataObject path String.keys
- a Symbol[] selecting the items to retrieve.
optargs
- a Dictionary of implementation-specific information.ContainerException
- if anything goes wrong.setParameters(java.lang.String, java.util.Dictionary)
public void changeMode(java.lang.String fullName, Symbol accessMode, java.util.Dictionary optargs) throws ContainerException
fullName
- the name of the DataObject.accessMode
- one of the Symbols
v_AccessRead, v_AccessWriteoptargs
- a Dictionary of implementation-specific information.ContainerException
- if anything goes wrong.public void copy(java.lang.String fullName, java.lang.String target, java.util.Dictionary optargs) throws ContainerException
This operation can fail for numerous reasons, including:
fullName
- the current name of the Containertarget
- the new name for the Containeroptargs
- a Dictionary of implementation-specific information.ContainerException
- if anything goes wrong.public void rename(java.lang.String fullName, java.lang.String newName, java.util.Dictionary optargs) throws ContainerException
Note: the newName is not a full path; it is just the last component of the new name, without any path separator characters.
fullName
- the current name of Container/DataObject.newName
- the new name for the Container/DataObject.optargs
- a Dictionary of implementation-specific information.ContainerException
- if fullName does not exist,
or if newName already exists.public void destroy(java.lang.String fullName, java.util.Dictionary optargs) throws ContainerException
Note: Destroy can succeed even if the Container is in read-only mode.
fullName
- the full Container or DataObject path String.optargs
- a Dictionary of implementation-specific information.ContainerException
- if container does not exist.public java.lang.String[] listObjects(java.lang.String fullName, java.util.Dictionary optargs) throws ContainerException
The order of objects in the list is not specified.
fullName
- the full Container path String.optargs
- a Dictionary of implementation-specific information.ContainerException
- if container does not exist.public void createContainer(java.lang.String fullName, java.util.Dictionary optargs) throws ContainerException
Note:to create a new Data Object, use openObject().
fullName
- the name of the new Container.optargs
- a Dictionary of implementation-specific information.ContainerException
- container cannot be created.public DataObject createDataObject(java.lang.String fullName, Symbol accessMode, java.util.Dictionary optargs) throws ContainerException
fullName
- the name of the DataObject to create.accessMode
- one of the Symbols
v_AccessRead, v_AccessWrite, v_AccessCopyoptargs
- a Dictionary of implementation-specific information.ContainerException
- if the Data Object is not opened.public DataObject openDataObject(java.lang.String fullName, Symbol accessMode, boolean ifNoExist, boolean truncate, java.util.Dictionary optargs) throws ContainerException
Note: unlike java.io streams, a DataObject is not differentiated between InputStream and OutputStream.
Argument accessMode
one of the Symbols:
Symbol: | Description: |
v_AccessRead |
Sets non-exclusive READ access |
v_AccessWrite |
Sets exclusive WRITE access |
v_AccessCopy |
Sets WRITE access to the object while other READ accesses are being made. This access mode causes a new copy of the Object payload to be created. When the handle is closed, the new data will replace the old data such that any OPENs with READ access that occurred before this close will continue to see the old data, and any OPENs with READ access occurring after the close will see the new data. |
If the named Data Object does not exist, the result is determined by the value of argument ifNoExist:
If argument accessMode is v_AccessWrite or v_AccessCopy, then argument truncate can be used to erase the contents of MDO when it is opened.
fullName
- the name of the DataObject to open.accessMode
- one of the Symbols
v_AccessRead, v_AccessWrite, v_AccessCopyifNoExist
- one of v_Fail (false) or v_Create (true)truncate
- if true and
v_AccessWrite or v_AccessCopy
then immediately erase previous contents.optargs
- a Dictionary of implementation-specific information.ContainerException
- if the Data Object is not opened.
|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |