[sip-comm-dev] OTR Plugin Implementation Details


#1

Hello all,

I assume that I will have to create an OtrActivator and an
OtrTransofrmationLayer. I also assume that I have to build an
OperationSetInstantMessageTransform for each ProtocolProviderService
(for example OperationSetInstantMessageTransformJabberImpl), and put
it in the supportedOperationSets.

Then, in OperationSetBasicInstantMessagingJabberImpl, in sendMessage I
will have to query the jabberProvider for a
OperationSetInstantMessageTransform and transform the message to be
sent. Am I thinking it correctly up till here?

So, to my understanding, OperationSetInstantMessageTransform has to
have a method to return all TransformLayers sorted by priority. Should
this method be added in the interface
OperationSetInstantMessageTransform and maybe implement it in an
AbstractOperationSetInstantMessageTransform?

OtrActivator's job would simply be to attach the
OtrTransformationLayer in the OperationSetInstantMessageTransform of
all ProtocolProviderService, correct? That can happen when
OtrActivator starts and when a ProtocolProviderService is added (so it
must implement ServiceListener).

Thank you for your time reading and answering this,
George

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hey George,

Geekius Caesar wrote:

Hello all,

I assume that I will have to create an OtrActivator and an
OtrTransofrmationLayer.

Ineed, you'd need those.

I also assume that I have to build an
OperationSetInstantMessageTransform for each ProtocolProviderService
(for example OperationSetInstantMessageTransformJabberImpl), and put
it in the supportedOperationSets.

Correct again. Only you'd need to do this for all protocols and not only
Jabber I am afraid.

It may also be worth considering adding the implementation of
OperationSetInstantMessageTransform inside the
OperationSetBasicInstantMessagingXxxImpl classes. This would make
transformers easier to use.

Then, in OperationSetBasicInstantMessagingJabberImpl, in sendMessage I
will have to query the jabberProvider for a
OperationSetInstantMessageTransform and transform the message to be
sent. Am I thinking it correctly up till here?

Well depends on how you implement it. If you follow my suggestion from
above then you would simply need to check whether any there have been
any transform layers added to your local transofmers list.

So, to my understanding, OperationSetInstantMessageTransform has to
have a method to return all TransformLayers sorted by priority. Should
this method be added in the interface
OperationSetInstantMessageTransform and maybe implement it in an
AbstractOperationSetInstantMessageTransform?

Not that OperationSet-s are meant for bundles _other_ than the protocol
providers to access functionality _within_ the protocol providers. You
don't need to us the interface within the protocol provider.

Adding a method that returns all TransformLayer-s could probably still
be useful for some reason (even though I can't really come up with an
use case right now) but that reason isn't its usage from the protocol
OpSetBasicIM

OtrActivator's job would simply be to attach the
OtrTransformationLayer in the OperationSetInstantMessageTransform of
all ProtocolProviderService, correct? That can happen when
OtrActivator starts and when a ProtocolProviderService is added (so it
must implement ServiceListener).

It would also be up to the Activator to register the OTR configuration
UI into the ConfigurationForm.

Thank you for your time reading and answering this,

You are most welcome!

Emil

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

I think you've been clear enough, thank you :slight_smile:

···

On Wed, Jul 1, 2009 at 11:39 AM, Emil Ivov<emcho@sip-communicator.org> wrote:

Hey George,

Geekius Caesar wrote:

Hello all,

I assume that I will have to create an OtrActivator and an
OtrTransofrmationLayer.

Ineed, you'd need those.

I also assume that I have to build an
OperationSetInstantMessageTransform for each ProtocolProviderService
(for example OperationSetInstantMessageTransformJabberImpl), and put
it in the supportedOperationSets.

Correct again. Only you'd need to do this for all protocols and not only
Jabber I am afraid.

It may also be worth considering adding the implementation of
OperationSetInstantMessageTransform inside the
OperationSetBasicInstantMessagingXxxImpl classes. This would make
transformers easier to use.

Then, in OperationSetBasicInstantMessagingJabberImpl, in sendMessage I
will have to query the jabberProvider for a
OperationSetInstantMessageTransform and transform the message to be
sent. Am I thinking it correctly up till here?

Well depends on how you implement it. If you follow my suggestion from
above then you would simply need to check whether any there have been
any transform layers added to your local transofmers list.

So, to my understanding, OperationSetInstantMessageTransform has to
have a method to return all TransformLayers sorted by priority. Should
this method be added in the interface
OperationSetInstantMessageTransform and maybe implement it in an
AbstractOperationSetInstantMessageTransform?

Not that OperationSet-s are meant for bundles _other_ than the protocol
providers to access functionality _within_ the protocol providers. You
don't need to us the interface within the protocol provider.

Adding a method that returns all TransformLayer-s could probably still
be useful for some reason (even though I can't really come up with an
use case right now) but that reason isn't its usage from the protocol
OpSetBasicIM

OtrActivator's job would simply be to attach the
OtrTransformationLayer in the OperationSetInstantMessageTransform of
all ProtocolProviderService, correct? That can happen when
OtrActivator starts and when a ProtocolProviderService is added (so it
must implement ServiceListener).

It would also be up to the Activator to register the OTR configuration
UI into the ConfigurationForm.

Thank you for your time reading and answering this,

You are most welcome!

Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net