Examples of Dictionary


Examples of java.util.Dictionary

    public void runTest() throws Throwable {
      asynchMessages=0;
      synchMessages=0;
      /* create the hashtable to put properties in */
      Dictionary props = new Hashtable();
      /* put service.pid property in hashtable */
      props.put(EventConstants.EVENT_TOPIC, topicsToConsume);
      /* register the service */
      serviceRegistration = bundleContext.registerService(
                                                          EventHandler.class.getName(), this, props);

      assertNotNull(getName()
View Full Code Here

Examples of java.util.Dictionary

  // public methods

  public static Dictionary getDefaultConfig() {

    final Dictionary config = new Hashtable();

    config.put(TelnetConfig.PORT_KEY, new Integer(port));
    config.put(TelnetConfig.HOST_KEY, host);
    config.put(TelnetConfig.UM_KEY, new Boolean(um));
    config.put(TelnetConfig.REQUIRED_GROUP_KEY, requiredGroup);
    config.put(TelnetConfig.FORBIDDEN_GROUP_KEY, forbiddenGroup);

    return config;
  }
View Full Code Here

Examples of java.util.Dictionary

        m_bc = bc;
        m_log = new LogRef(m_bc);

        m_factory = new SslServiceFactory(m_bc, m_log);

        Dictionary parameters = new Hashtable();
        parameters.put("service.pid", SslServiceFactory.PID);
        m_reg = bc.registerService(ManagedServiceFactory.class.getName(),
                                           m_factory,
                                           parameters);

        ServiceReference adminRef = null;
View Full Code Here

Examples of java.util.Dictionary

                    log.info("User " + telnetLogin.getUser() + " logged in");
                    Authorization authorization
                        = telnetLogin.getAuthorization();
                    s = consoleService.runSession("telnet session", reader,
                                                  printWriter);
                    Dictionary props = s.getProperties();

                    if (authorization != null) {
                        props.put(Session.PROPERTY_AUTHORIZATION,
                                  authorization);
                    }

                    printWriter.println("'quit' to end session");
View Full Code Here

Examples of java.util.Dictionary

                    String inputPath = telnetConfig.getInputPath();
                    String authMethod = telnetConfig.getAuthorizationMethod();

                    ((ContextualAuthorization) telnetLogin.getAuthorization())
                            .setIPAMContext(inputPath, authMethod);
                    Dictionary context = ((ContextualAuthorization) telnetLogin
                            .getAuthorization()).getContext();
                    log.info("User " + telnetLogin.getAuthorization().getName()
                            + " logged in, authentication context is "
                            + context + ".");
                } else if (telnetLogin.getAuthorization() == null) {
View Full Code Here

Examples of java.util.Dictionary

            }
            for (int i = 0; i < cs.length; ++i) {
                if (i > 0) {
                    out.println();
                }
                Dictionary d = cs[i].getProperties();
                if (d == null) {
                    out.println("No properties set in " + cs[i].getPid());
                } else {
                    out.println("Properties for " + cs[i].getPid());
                    printDictionary(out, d);
View Full Code Here

Examples of java.util.Dictionary

            out.println("No configuration open currently");
        } else {
            if (isEditing(session)) {
                printDictionary(out, getEditingDict(session));
            } else {
                Dictionary d = cfg.getProperties();
                if (d == null) {
                    out.println("No properties set in current configuration");
                } else {
                    printDictionary(out, d);
                }
View Full Code Here

Examples of java.util.Dictionary

                throw new Exception("No configuration open currently");

            String p = (String) opts.get("property");
            String v = (String) opts.get("value");
            String t = (String) opts.get("type");
            Dictionary dict = getEditingDict(session);
            Object ov = dict.get(p);

            if (t == null) {
                if (ov == null) {
                    dict.put(p, v);
                } else {
                    Class ovc = ov.getClass();
                    Object nv = stringToObjectOfClass(v, ovc);
                    if (nv == null) {
                        throw new Exception(
                                "Unable to convert argument to the same type as old value of property");
                    }
                    dict.put(p, nv);
                }
            } else {
                Object o = null;
                try {
                    o = createValue(t, v);
                } catch (Exception e) {
                    o = null;
                }
                if (o == null) {
                    throw new Exception("Unable to convert " + v + " to " + t);
                }
                dict.put(p, o);
            }
            retcode = 0; // Success!
        } catch (Exception e) {
            out.println("Set failed. Details:");
            String reason = e.getMessage();
View Full Code Here

Examples of java.util.Dictionary

        try {
            if (getCurrent(session) == null) {
                throw new Exception("No configuration open currently");
            }
            String p = (String) opts.get("property");
            Dictionary dict = getEditingDict(session);
            Object o = dict.remove(p);
            if (o == null) {
                throw new Exception("No property named " + p
                        + " in current configuration.");
            }
            retcode = 0; // Success!
View Full Code Here

Examples of java.util.Dictionary

     * Helper method that gets the editing dictionary of the current *
     * configuration from the session. Returns a new empty dictionary if current
     * is set but have no dictionary set yet.*
     **************************************************************************/
    private Dictionary getEditingDict(Session session) {
        Dictionary dict = (Dictionary) session.getProperties().get(EDITED);
        if (dict == null) {
            Configuration cfg = getCurrent(session);
            if (cfg != null) {
                dict = cfg.getProperties();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.