Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » REST / SSE Clazz type(Does it really need to be the full class name)
REST / SSE Clazz type [message #1702056] Sat, 18 July 2015 13:47 Go to next message
Chris Jackson is currently offline Chris JacksonFriend
Messages: 256
Registered: December 2013
Senior Member
The recent change to the event system introduced the class name to the event, but it's the full class (ie org.eclipse.smarthome.core.library.types.DecimalType). Is this really necessary, or could we change this to the simple name (ie DecimalType)? It just seems neater to use the simple name since that's how it is referenced in the DSL type config files.

Chris
Re: REST / SSE Clazz type [message #1702137 is a reply to message #1702056] Mon, 20 July 2015 09:34 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Can you provide a (code) reference as which event type you are referring to and where the FQDN appears?
Re: REST / SSE Clazz type [message #1702141 is a reply to message #1702137] Mon, 20 July 2015 09:47 Go to previous messageGo to next message
Chris Jackson is currently offline Chris JacksonFriend
Messages: 256
Registered: December 2013
Senior Member
I don't have the code as I've not looked through to find where the events are sent, but this occurs in the item state update messages (ie SSE).
Re: REST / SSE Clazz type [message #1702144 is a reply to message #1702141] Mon, 20 July 2015 10:03 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
I think I found it: https://github.com/eclipse/smarthome/blob/6da2cdc2772a9c53ac8040ca5669624c1f375c32/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/items/events/ItemEventFactory.java#L171

@Dennis: Is there any risk in changing this to the simple class name?
Re: REST / SSE Clazz type [message #1702206 is a reply to message #1702144] Mon, 20 July 2015 16:02 Go to previous messageGo to next message
Dennis Nobel is currently offline Dennis NobelFriend
Messages: 166
Registered: September 2014
Senior Member
It will not work if we change it. We use the className for recreating the command and state classes: https://github.com/eclipse/smarthome/blob/6da2cdc2772a9c53ac8040ca5669624c1f375c32/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/items/events/ItemEventFactory.java#L101
Re: REST / SSE Clazz type [message #1702215 is a reply to message #1702206] Mon, 20 July 2015 17:00 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
So we could assume that the type is always in the org.eclipse.smarthome.core.library.types package Smile
Re: REST / SSE Clazz type [message #1702223 is a reply to message #1702215] Mon, 20 July 2015 18:05 Go to previous messageGo to next message
Dennis Nobel is currently offline Dennis NobelFriend
Messages: 166
Registered: September 2014
Senior Member
Yes of course. But if we do so, it will not possible anymore to provide new item types - at least not with own commands or states. Because the types would not be deserializable from the event bus. In that case I would suggest to completely remove the possibility to implement an own ItemFactory.
Re: REST / SSE Clazz type [message #1702424 is a reply to message #1702223] Wed, 22 July 2015 09:25 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Assuming you had a custom item type with custom state types defined in your own bundle - wouldn't this line in the code anyhow fail with a CNFE as it won't be available on the bundle classpath?
Re: REST / SSE Clazz type [message #1702549 is a reply to message #1702424] Thu, 23 July 2015 07:22 Go to previous messageGo to next message
Dennis Nobel is currently offline Dennis NobelFriend
Messages: 166
Registered: September 2014
Senior Member
Quote:
wouldn't this line in the code anyhow fail with a CNFE as it won't be available on the bundle classpath?


Yes you are right. So it is not extensible any more in any case. Well than we could change the event data to the simple class name and we should also change the event attribute "clazz" to "type".
Re: REST / SSE Clazz type [message #1702551 is a reply to message #1702549] Thu, 23 July 2015 07:45 Go to previous message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
I've created https://github.com/eclipse/smarthome/pull/398
Previous Topic:Making the SmartHome web UI "read-only"
Next Topic:Editable sitemaps through REST
Goto Forum:
  


Current Time: Thu Apr 18 22:47:55 GMT 2024

Powered by FUDForum. Page generated in 0.01882 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top