Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [kura-dev] another question

Hi Scott,

Please see the example of how MqttDataTransport is using the Password class [1]. Just search for “Password” and you can find what you need.


Thanks,
--Dave

On Nov 8, 2016, at 19:05, Lewis, ScottX <scottx.lewis@xxxxxxxxx> wrote:

I'm creating a ConfigurableService and I would like to put a password into the web UI.   I looked at the metatype for the MqttDataTransport...which has a password used to connect to the cloud service...and the acd for that field looks like this:

       <AD id="password"  
           name="password"
           type="Password"
           cardinality="0"
           required="false"
           default="password"
           description="Password to be used when connecting to the MQTT broker."/>


And the code that handles this configuration looks like this:

Password password = (Password) properties.get("password");

The Password class is:  org.eclipse.kura.configuration.Password

Fair enough.   But when I put the exact same AD into my metatype, and try to use the property the following line throws an exception:

Password password = (Password) properties.get("password");

The type of the password property is not Password, but rather it's a String and what looks like a uuencoded value for the String...e.g.:  1LnomW8pXWdXQLVTfyMQ1Q==

Obviously there is something I'm doing differently to not get a Password instance via the Kura Config Admin.   Any idea what that is?

Thanksinadvance for any thoughts,

Scott



_______________________________________________
kura-dev mailing list
kura-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kura-dev


Back to the top