X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmoonshot-server.vala;h=bb26dc0cb87a395ffd6591f5fe6ddf1758f5c444;hb=3be9164b4ef280f25b996238a135b2f29e95e8fb;hp=67c22ab2ebc3495aa2d1746a6ee3fbb776a2c9b1;hpb=c64066e0fd6838caafba7cac51b00ea2980a717e;p=moonshot-ui.git diff --git a/src/moonshot-server.vala b/src/moonshot-server.vala index 67c22ab..bb26dc0 100644 --- a/src/moonshot-server.vala +++ b/src/moonshot-server.vala @@ -34,20 +34,30 @@ [DBus (name = "org.janet.Moonshot")] public class MoonshotServer : Object { + static MoonshotLogger logger = get_logger("MoonshotServer"); + + private string app_name = "Moonshot"; + private IdentityManagerApp parent_app; public MoonshotServer(IdentityManagerApp app) { + logger.trace("MoonshotServer.; app=" + (app == null ? "null" : "non-null")); this.parent_app = app; } public bool show_ui() { + logger.trace("MoonshotServer.show_ui"); + if (parent_app.view == null) { + stderr.printf(app_name, "show_ui: parent_app.view is null!\n"); + logger.warn("show_ui: parent_app.view is null!"); return false; } parent_app.show(); parent_app.explicitly_launched = true; + logger.trace("MoonshotServer.show_ui: returning true"); return true; } @@ -61,13 +71,17 @@ public class MoonshotServer : Object { out string subject_name_constraint, out string subject_alt_name_constraint) { + logger.trace(@"MoonshotServer.get_identity: nai='$nai'; service='$service'"); var request = new IdentityRequest(parent_app, nai, password, service); + logger.trace(@"MoonshotServer.get_identity: Calling request.execute()"); request.set_callback((IdentityRequest) => get_identity.callback()); request.execute(); + logger.trace(@"MoonshotServer.get_identity: Back from request.execute()"); yield; + logger.trace(@"MoonshotServer.get_identity: back from yield"); nai_out = ""; password_out = ""; @@ -80,7 +94,7 @@ public class MoonshotServer : Object { if ((id_card != null) && (id_card.display_name != IdCard.NO_IDENTITY)) { nai_out = id_card.nai; - if ((request.password!=null) && (request.password != "")) + if ((request.password != null) && (request.password != "")) password_out = request.password; else password_out = id_card.password; @@ -103,9 +117,12 @@ public class MoonshotServer : Object { if (subject_alt_name_constraint == null) subject_alt_name_constraint = ""; + logger.trace("MoonshotServer.get_identity: returning true"); + return true; } + logger.trace("MoonshotServer.get_identity: returning false"); return false; } @@ -116,6 +133,7 @@ public class MoonshotServer : Object { out string subject_name_constraint, out string subject_alt_name_constraint) { + logger.trace("MoonshotServer.get_default_identity"); var request = new IdentityRequest.default(parent_app); request.set_callback((IdentityRequest) => get_default_identity.callback()); request.execute(); @@ -151,24 +169,25 @@ public class MoonshotServer : Object { if (subject_alt_name_constraint == null) subject_alt_name_constraint = ""; + logger.trace("MoonshotServer.get_default_identity: returning true"); return true; } return false; } - public bool install_id_card (string display_name, - string user_name, - string ?password, - string ?realm, - string[] ?rules_patterns, - string[] ?rules_always_confirm, - string[] ?services, - string ?ca_cert, - string ?subject, - string ?subject_alt, - string ?server_cert, - int force_flat_file_store) + public bool install_id_card(string display_name, + string user_name, + string ?password, + string ?realm, + string[] ?rules_patterns, + string[] ?rules_always_confirm, + string[] ?services, + string ?ca_cert, + string ?subject, + string ?subject_alt, + string ?server_cert, + int force_flat_file_store) { IdCard idcard = new IdCard(); @@ -290,6 +309,8 @@ public class MoonshotServer : Object { ref string subject_name_constraint, ref string subject_alt_name_constraint) { + logger.trace("(static) get_identity"); + bool result = false; var request = new IdentityRequest(parent_app, @@ -355,6 +376,8 @@ public class MoonshotServer : Object { ref string subject_name_constraint, ref string subject_alt_name_constraint) { + logger.trace("(static) get_default_identity"); + bool result; var request = new IdentityRequest.default(parent_app); @@ -428,7 +451,9 @@ public class MoonshotServer : Object { string server_cert, bool force_flat_file_store) { + logger.trace("(static) install_id_card"); IdCard idcard = new IdCard(); + bool success = false; Mutex mutex = new Mutex(); Cond cond = new Cond();