public class XCapClientImpl extends BaseHttpXCapClient implements XCapClient
HEADER_CONTENT_TYPE, HEADER_ETAG, HEADER_IF_NONE_MATCH, uri, userAddress, XCAP_ERROR_CONTENT_TYPE
CONTENT_TYPE, DOCUMENT_FORMAT
DOCUMENT_FORMAT, ELEMENT_CONTENT_TYPE, NAMESPACE, RESOURCE_LISTS_CONTENT_TYPE
CONTENT_TYPE, DOCUMENT_FORMAT, NAMESPACE
CONTENT_TYPE, DOCUMENT_FORMAT, NAMESPACE
Constructor and Description |
---|
XCapClientImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertPresContentSupported()
Utility method throwing an exception if the pres-content
is not supported.
|
protected void |
assertPresRulesSupported()
Utility method throwing an exception if the pres-rules
is not supported.
|
protected void |
assertResourceListsSupported()
Utility method throwing an exception if the resource-lists
is not supported.
|
void |
connect(java.net.URI uri,
javax.sip.address.Address userAddress,
java.lang.String username,
java.lang.String password)
Connects user to XCap server.
|
void |
deletePresContent(java.lang.String imageName)
Deletes the pres-content from the server.
|
void |
deletePresRules()
Deletes the pres-rules from the server.
|
void |
deleteResourceLists()
Deletes the resource-lists from the server.
|
void |
disconnect()
Disconnects user from the XCAP server.
|
byte[] |
getImage(java.net.URI imageUri)
Gets image from the specified uri.
|
ListType |
getList(java.lang.String anchor)
Gets the resource-lists from the server.
|
ContentType |
getPresContent(java.lang.String imageName)
Gets the pres-content from the server.
|
java.net.URI |
getPresContentImageUri(java.lang.String imageName)
Gets the pres-content image uri.
|
RulesetType |
getPresRules()
Gets the pres-rules from the server.
|
ResourceListsType |
getResourceLists()
Gets the resource-lists from the server.
|
XCapCapsType |
getXCapCaps()
Gets the xcap-caps from the server.
|
boolean |
isPresContentSupported()
Indicates whether or not pres-rules is supported.
|
boolean |
isPresRulesSupported()
Indicates whether or not pres-rules is supported.
|
boolean |
isResourceListsSupported()
Indicates whether or not pres-rules is supported.
|
void |
putPresContent(ContentType content,
java.lang.String imageName)
Puts the pres-content to the server.
|
void |
putPresRules(RulesetType presRules)
Puts the pres-rules to the server.
|
void |
putResourceLists(ResourceListsType resourceLists)
Puts the resource-lists to the server.
|
assertConnected, delete, get, get, getResourceURI, getSingleHeaderValue, getUri, getUserName, getXCapErrorMessage, isConnected, put, showError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
delete, get, getUri, getUserName, isConnected, put
public void connect(java.net.URI uri, javax.sip.address.Address userAddress, java.lang.String username, java.lang.String password) throws XCapException
connect
in interface HttpXCapClient
connect
in class BaseHttpXCapClient
uri
- the server location.userAddress
- the URI of the user used for requestsusername
- the user name.password
- the user password.XCapException
- if there is some error during operation.public void disconnect()
disconnect
in interface HttpXCapClient
disconnect
in class BaseHttpXCapClient
public void putResourceLists(ResourceListsType resourceLists) throws XCapException
putResourceLists
in interface ResourceListsClient
resourceLists
- the resource-lists to be saved on the server.java.lang.IllegalStateException
- if the user has not been connected, or
resource-lists is not supported.XCapException
- if there is some error during operation.public ResourceListsType getResourceLists() throws XCapException
getResourceLists
in interface ResourceListsClient
java.lang.IllegalStateException
- if the user has not been connected, or
resource-lists is not supported.XCapException
- if there is some error during operation.public void deleteResourceLists() throws XCapException
deleteResourceLists
in interface ResourceListsClient
java.lang.IllegalStateException
- if the user has not been connected, or
resource-lists is not supported.XCapException
- if there is some error during operation.public ListType getList(java.lang.String anchor) throws XCapException
getList
in interface ResourceListsClient
anchor
- reference to the list.java.lang.IllegalStateException
- if the user has not been connected, or
resource-lists is not supported.XCapException
- if there is some error during operation.public XCapCapsType getXCapCaps() throws XCapException
getXCapCaps
in interface XCapCapsClient
java.lang.IllegalStateException
- if the user has not been connected.XCapException
- if there is some error during operation.public RulesetType getPresRules() throws XCapException
getPresRules
in interface PresRulesClient
java.lang.IllegalStateException
- if the user has not been connected, or
pres-rules is not supported.XCapException
- if there is some error during operation.public void putPresRules(RulesetType presRules) throws XCapException
putPresRules
in interface PresRulesClient
presRules
- the pres-rules to be saved on the server.java.lang.IllegalStateException
- if the user has not been connected, or
pres-rules is not supported.XCapException
- if there is some error during operation.public void deletePresRules() throws XCapException
deletePresRules
in interface PresRulesClient
java.lang.IllegalStateException
- if the user has not been connected, or
pres-rules is not supported.XCapException
- if there is some error during operation.public void putPresContent(ContentType content, java.lang.String imageName) throws XCapException
putPresContent
in interface PresContentClient
content
- the pres-content to be saved on the server.imageName
- the image name under which pres-content would be saved.java.lang.IllegalStateException
- if the user has not been connected, or
pres-content is not supported.XCapException
- if there is some error during operation.public ContentType getPresContent(java.lang.String imageName) throws XCapException
getPresContent
in interface PresContentClient
imageName
- the image name under which pres-content is saved.java.lang.IllegalStateException
- if the user has not been connected, or
pres-content is not supported.XCapException
- if there is some error during operation.public void deletePresContent(java.lang.String imageName) throws XCapException
deletePresContent
in interface PresContentClient
imageName
- the image name under which pres-content is saved.java.lang.IllegalStateException
- if the user has not been connected, or
pres-content is not supported.XCapException
- if there is some error during operation.public java.net.URI getPresContentImageUri(java.lang.String imageName)
getPresContentImageUri
in interface PresContentClient
imageName
- the image name under which pres-content is saved.java.lang.IllegalStateException
- if the user has not been connected.public byte[] getImage(java.net.URI imageUri) throws XCapException
getImage
in interface PresContentClient
imageUri
- the image uri.XCapException
- if there is some error during operation.protected void assertResourceListsSupported()
java.lang.IllegalStateException
- if the user is not connected.protected void assertPresRulesSupported()
java.lang.IllegalStateException
- if the user is not connected.protected void assertPresContentSupported()
java.lang.IllegalStateException
- if the user is not connected.public boolean isResourceListsSupported()
isResourceListsSupported
in interface XCapClient
public boolean isPresRulesSupported()
isPresRulesSupported
in interface XCapClient
public boolean isPresContentSupported()
isPresContentSupported
in interface XCapClient
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.