private String get (String prop) throws ConfigurationException { String value = cfg.get (prop); if (value == null) throw new ConfigurationException ("null property "+prop); return value; } }
/** * @param cfg Configuration object * @throws ConfigurationException */ @Override public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; queueName = cfg.get("queue", null); if (queueName == null) throw new ConfigurationException("'queue' property not configured"); timeout = cfg.getLong("timeout", timeout); frozen = cfg.getBoolean("frozen", true); }
public void setConfiguration (Configuration cfg) throws ConfigurationException { host = cfg.get ("host", null); if (host == null) throw new ConfigurationException ( "host property has not been specified" ); port = cfg.getInt ("port", 7); } }
public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; keyStore = cfg.get("keystore"); clientAuthNeeded = cfg.getBoolean("clientauth"); serverAuthNeeded = cfg.getBoolean("serverauth"); serverName = cfg.get("servername"); password = cfg.get("storepassword", null); keyPassword = cfg.get("keypassword", null); enabledCipherSuites = cfg.getAll("addEnabledCipherSuite"); enabledProtocols = cfg.getAll("addEnabledProtocol"); } public Configuration getConfiguration() {
public void setConfiguration (Object obj, Element e) throws ConfigurationException { try { if (obj instanceof Configurable) ((Configurable)obj).setConfiguration (getConfiguration (e)); if (obj instanceof XmlConfigurable) ((XmlConfigurable)obj).setConfiguration(e); } catch (ConfigurationException ex) { throw new ConfigurationException (ex); } } /**
@Override public void run () { shutdownServer (); if (!cfg.getBoolean ("keep-channels")) { shutdownChannels (); } } }.start();
/** * @param cfg * <ul> * <li>delay (expressed in milliseconds) * </ul> */ public void setConfiguration (Configuration cfg) { delay = cfg.getInt ("delay"); }
private String[] getPrefixes() { String[] prefixes=cfg.getAll("prefixes"); if(prefixes!=null && prefixes.length>0) return prefixes; return new String[]{"org.jpos.q2.cli.", "org.jpos.ee.cli.cmds."}; }
/** * Verify Card's PAN * @param p full card PAN * @return true if pan LUHN's matches */ public boolean verify (String p) throws InvalidCardException { if (p == null || p.length() < 5) throw new InvalidCardException ("Invalid PAN " + p); return p.charAt(p.length()-1) == calculate (p.substring(0, p.length()-1)); } }
/** * @param counterName * @return counterName's value + 1 */ public int get (String counterName) { return get (counterName, 1); } /**
/** * @return reconstructed track2 or null */ public String getTrack2() { if (hasTrack2()) return pan + TRACK2_SEPARATOR + exp + trailer; else return null; } /**
/** * creates a new CardHolder based on track2 * @param track2 cards track2 * @exception InvalidCardException */ public CardHolder (String track2) throws InvalidCardException { super(); parseTrack2 (track2); }
public static CardSelector getDefault () { if (defaultInstance == null) defaultInstance = new CardSelector(); return defaultInstance; } public CardBrand getCardBrand(String bin)
public IgnoreLuhnCardValidator() { super(); setLuhnCalculator(null); } }
private String get (String prop) throws ConfigurationException { String value = cfg.get (prop); if (value == null) throw new ConfigurationException ("null property "+prop); return value; } /**
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; serviceName = cfg.get ("channel", null); if (serviceName == null) throw new ConfigurationException ("property 'channel' is null"); } }
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; safName = cfg.get ("saf", null); if (safName == null) throw new ConfigurationException ("property 'saf' is null"); } }
private void assertProperty (String propName) throws ConfigurationException { if (cfg.get (propName) == null) throw new ConfigurationException (propName + " property not present"); } }