public class AuthorisedExtensionsSet
extends java.lang.Object
implements java.io.Serializable
This bean captures a set of extensions, and/or ExtensionRange
, which
can be used to control access to records or operations on a Total Recall VR
system. This set does not define the meaning of access, rather it is a
mechanisam that remote clients can use to control access to Total Recall VR
system resources and functions.
The set can specify that:
Modifier and Type | Field and Description |
---|---|
static int |
ALL
All extensions are authorised.
|
static int |
EXCEPT_SPECIFIED
All extensions, except those specified in this set, are authorised.
|
static int |
SPECIFIED
Only the extensions specified in this set are authorised.
|
Constructor and Description |
---|
AuthorisedExtensionsSet()
Creates a set which makes all extensions authorised.
|
AuthorisedExtensionsSet(AuthorisedExtensionsSet other)
Creates a set which is a (deep) copy of the specified set.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtension(java.lang.String ext)
Adds an individual extension to the set.
|
void |
addExtensionRange(java.lang.String first,
java.lang.String last)
Adds an extension range to the set.
|
java.lang.String |
getExtension(int index)
Returns the individual extension at the specified index in the set.
|
int |
getExtensionCnt() |
ExtensionRange |
getExtensionRange(int index)
Returns the extension range at the specified index position in the set
|
int |
getExtensionRangeCnt() |
int |
getMode() |
java.lang.String |
getStringRepresentation()
Creates a string representation of the set content.
|
boolean |
isAllAuthorized()
Query for all extensions authorised.
|
boolean |
isAuthorized(Recording rec)
Query for recording authorisation.
|
boolean |
isAuthorized(java.lang.String extension)
Query for extension authorisation.
|
boolean |
isNoneAuthorized()
Query for no extension is authorised.
|
void |
removeExtension(int index)
Removes the individual extension at the specified index in the set.
|
void |
removeExtensionRange(int index)
Removes the extension range at the specified index in the set.
|
void |
setFromStringRepresentation(java.lang.String stringRepresentation)
Initialises this instance of the bean from the string representation of
the set content.
|
void |
setMode(int mode)
Sets the autorisation mode for this instance.
|
public static final int ALL
public static final int SPECIFIED
public static final int EXCEPT_SPECIFIED
public AuthorisedExtensionsSet()
public AuthorisedExtensionsSet(AuthorisedExtensionsSet other)
other
- The set to copy.public java.lang.String getStringRepresentation()
public void setFromStringRepresentation(java.lang.String stringRepresentation)
Use getStringRepresentation()
to create a string representation
of another instance.
stringRepresentation
- Valid string representation of a another instance of this bean.public int getMode()
ALL
,
SPECIFIED
or EXCEPT_SPECIFIED
.public void setMode(int mode)
mode
- One of ALL
, SPECIFIED
or EXCEPT_SPECIFIED
.public boolean isAllAuthorized()
true
if all extensions are authorised. false
otherwise.public boolean isNoneAuthorized()
true
if all extensions are NOT authorised. false
otherwise.public boolean isAuthorized(java.lang.String extension)
extension
- An extension to check.true
if the extensions authorised. false
otherwise.public boolean isAuthorized(Recording rec)
rec
- A recording to check.true
if the recording authorised. false
otherwise.public int getExtensionCnt()
public int getExtensionRangeCnt()
public void addExtension(java.lang.String ext)
Note that if the authorisation mode of the set is ALL
before
this request, then after this request the authorisation mode will be
SPECIFIED
.
ext
- The extension to add to the set. For example: 2000.public void removeExtension(int index)
For example:
AuthorisedExtensionsSet set = new AuthorisedExtensionsSet(); set.addExtension("2000"); // this extension is at index 0 set.addExtension("2001"); // this extension is at index 1 set.addExtension("2002"); // this extension is at index 2 set.removeExtension(2); // removes extension 2002 from the set
index
- The index, in the set, of the extension to remove.public void addExtensionRange(java.lang.String first, java.lang.String last)
Note that if the authorisation mode of the set is ALL
before
this request, then after this request the authorisation mode will be
SPECIFIED
.
first
- The first extension in the range. For example: 2000.last
- The last extension in the range. For example: 2999.public void removeExtensionRange(int index)
For example:
AuthorisedExtensionsSet set = new AuthorisedExtensionsSet(); set.addExtensionRange("2000", "2999"); // this range is at index 0 set.addExtensionRange("4001", "4010"); // this range is at index 1 set.addExtensionRange("6002", "6300"); // this range is at index 2 set.removeExtensionRange(2); // removes range 6002-6300 from the set
index
- The index, in the set, of the extension to remove.public java.lang.String getExtension(int index)
For example:
AuthorisedExtensionsSet set = new AuthorisedExtensionsSet(); set.addExtension("2000"); // this extension is at index 0 set.addExtension("2001"); // this extension is at index 1 set.addExtension("2002"); // this extension is at index 2 String ext = set.getExtension(2); // ext is 2002
index
- An index, in the set, of an extension.public ExtensionRange getExtensionRange(int index)
For example:
AuthorisedExtensionsSet set = new AuthorisedExtensionsSet(); set.addExtensionRange("2000", "2999"); // this range is at index 0 set.addExtensionRange("4001", "4010"); // this range is at index 1 set.addExtensionRange("6002", "6300"); // this range is at index 2 ExtensionRage er = set.getExtensionRange(2); // er is a set representing 6002-6300.
index
- An index, in the set, of an extension range.Copyright ©, 2005-2012 Prolancer Pty Ltd, Sydney Australia.