+ case "setPin":
+ if (dBusConn != null) {
+ System.err.println("setPin is not yet implemented via dbus");
+ return 1;
+ }
+ if (!m.isRegistered()) {
+ System.err.println("User is not registered.");
+ return 1;
+ }
+ try {
+ String registrationLockPin = ns.getString("registrationLockPin");
+ m.setRegistrationLockPin(Optional.of(registrationLockPin));
+ } catch (IOException e) {
+ System.err.println("Set pin error: " + e.getMessage());
+ return 3;
+ }
+ break;
+ case "removePin":
+ if (dBusConn != null) {
+ System.err.println("removePin is not yet implemented via dbus");
+ return 1;
+ }
+ if (!m.isRegistered()) {
+ System.err.println("User is not registered.");
+ return 1;
+ }
+ try {
+ m.setRegistrationLockPin(Optional.<String>absent());
+ } catch (IOException e) {
+ System.err.println("Remove pin error: " + e.getMessage());
+ return 3;
+ }
+ break;