Package org.linphone.core
Interface Event
public interface Event
Object representing an event state, which is subcribed or published.
see:
see:
see:
Core.publish(org.linphone.core.Address, java.lang.String, int, org.linphone.core.Content) see:
Core.subscribe(org.linphone.core.Address, java.lang.String, int, org.linphone.core.Content) -
Method Summary
Modifier and TypeMethodDescriptionintAccept an incoming publish.intAccept an incoming subcription.voidaddCustomHeader(String name, String value) Add a custom header to an outgoing susbscription or publish.voidaddListener(EventListener listener) intdenyPublish(Reason reason) Deny an incoming publish with given reason.intdenySubscription(Reason reason) Deny an incoming subscription with given reason.getCore()getCustomHeader(String name) Obtain the value of a given header for an incoming subscription.Get full details about an error occured.getFrom()Get the "from" address of the subscription.getName()Get the name of the event as specified in the event package RFC.longGets the native pointer used by this class to make native method calls.Get publish state.Return reason code (in case of error state reached).Get the "contact" address of the subscription.Get the resource address of the subscription or publish.Get subscription direction.Get subscription state.getTo()Get the "to" address of the subscription.Gets the object stored in this object user's dataintSend a notification.voidPrevent an event from refreshing its publish.intRefresh an outgoing publish keeping the same body.intRefresh an outgoing subscription keeping the same body.voidremoveCustomHeader(String name) Remove custom header to an outgoing susbscription or publish.voidremoveListener(EventListener listener) intsendPublish(Content body) Send a publish created byCore.createPublish(org.linphone.core.Address, java.lang.String, int).intsendSubscribe(Content body) Send a subscription previously created byCore.createSubscribe(org.linphone.core.Address, java.lang.String, int).voidsetUserData(Object data) Sets the object to store in this object user's datavoidTerminate an incoming or outgoing subscription that was previously acccepted,
or a previous publication.toString()intupdatePublish(Content body) Update (refresh) a publish.intupdateSubscribe(Content body) Update (refresh) an outgoing subscription, changing the body.
-
Method Details
-
getCore
- Returns:
- the
Coreobject associated.
-
getErrorInfo
Get full details about an error occured.
- Returns:
- a
ErrorInfoobject.
-
getFrom
Get the "from" address of the subscription.
- Returns:
- the from
Address.
-
getName
Get the name of the event as specified in the event package RFC.
- Returns:
- the event name.
-
getPublishState
PublishState getPublishState()Get publish state.
If the event object was not created by a publish mechanism,PublishState.None
is returned.- Returns:
- the current
PublishState
-
getReason
Reason getReason()Return reason code (in case of error state reached).
- Returns:
- a
Reasonenum
-
getRemoteContact
Get the "contact" address of the subscription.
- Returns:
- The "contact" address of the subscription
-
getResource
Get the resource address of the subscription or publish.
- Returns:
- the resource
Address.
-
getSubscriptionDir
SubscriptionDir getSubscriptionDir()Get subscription direction.
If the object wasn't created by a subscription mechanism,SubscriptionDir.InvalidDir
is returned.- Returns:
- the
SubscriptionDir
-
getSubscriptionState
SubscriptionState getSubscriptionState()Get subscription state.
If the event object was not created by a subscription mechanism,SubscriptionState.None
is returned.- Returns:
- the current
SubscriptionState
-
getTo
Get the "to" address of the subscription.
- Returns:
- the "to"
Address.
-
acceptPublish
int acceptPublish()Accept an incoming publish.
- Returns:
- 0 if successful, error code otherwise
-
acceptSubscription
int acceptSubscription()Accept an incoming subcription.
- Returns:
- 0 if successful, error code otherwise
-
addCustomHeader
Add a custom header to an outgoing susbscription or publish.
- Parameters:
name- header's namevalue- the header's value.
-
denyPublish
Deny an incoming publish with given reason.
- Parameters:
reason- TheReasonof denial.- Returns:
- 0 if successful, error code otherwise
-
denySubscription
Deny an incoming subscription with given reason.
- Parameters:
reason- TheReasonof denial.- Returns:
- 0 if successful, error code otherwise
-
getCustomHeader
Obtain the value of a given header for an incoming subscription.
- Parameters:
name- header's name- Returns:
- the header's value or null if such header doesn't exist.
-
notify
Send a notification.
- Parameters:
body- an optional body containing the actual notification data.- Returns:
- 0 if successful, -1 otherwise.
-
pausePublish
void pausePublish()Prevent an event from refreshing its publish.
This is useful to let registrations to expire naturally (or) when the
application wants to keep control on when refreshes are sent. The refreshing
operations can be resumed withProxyConfig.refreshRegister(). -
refreshPublish
int refreshPublish()Refresh an outgoing publish keeping the same body.
- Returns:
- 0 if successful, -1 otherwise.
-
refreshSubscribe
int refreshSubscribe()Refresh an outgoing subscription keeping the same body.
- Returns:
- 0 if successful, -1 otherwise.
-
removeCustomHeader
Remove custom header to an outgoing susbscription or publish.
- Parameters:
name- header's name
-
sendPublish
- Parameters:
body- the new data to be published- Returns:
- 0 if successful, -1 otherwise.
-
sendSubscribe
Send a subscription previously created byCore.createSubscribe(org.linphone.core.Address, java.lang.String, int).
- Parameters:
body- optional content to attach with the subscription.- Returns:
- 0 if successful, -1 otherwise.
-
terminate
void terminate()Terminate an incoming or outgoing subscription that was previously acccepted,
or a previous publication.
TheEventshall not be used anymore after this operation. -
updatePublish
Update (refresh) a publish.
- Parameters:
body- the new data to be published- Returns:
- 0 if successful, error code otherwise
-
updateSubscribe
Update (refresh) an outgoing subscription, changing the body.
- Parameters:
body- an optional body to include in the subscription update, may be
null.- Returns:
- 0 if successful, error code otherwise
-
addListener
-
removeListener
-
setUserData
Sets the object to store in this object user's data- Parameters:
data- the object to store
-
getUserData
Object getUserData()Gets the object stored in this object user's data- Returns:
- the object store if any, null otherwise
-
getNativePointer
long getNativePointer()Gets the native pointer used by this class to make native method calls.- Returns:
- the nativer pointer, as long
-
toString
String toString()
-