private static NumberRule selectNumberRule(int field, int padding) { switch (padding) { case 1: return new UnpaddedNumberField(field); case 2: return new TwoDigitNumberField(field); default: return new PaddedNumberField(field, padding); } }
private SmsService() { sessionPool = new SMPPSessionPool(); PropertyEventDispatcher.addListener( sessionPool ); }
/** * Return all property names as a list of strings, or an empty list if jiveHome has not been loaded. * * @return all child property for the given parent. */ public static List<String> getXMLPropertyNames() { if (openfireProperties == null) { loadOpenfireProperties(); } return openfireProperties.getAllPropertyNames(); }
SMPPSessionPool() { super( new SMPPSessionFactory() ); setMaxTotal( JiveGlobals.getIntProperty( "sms.smpp.connections.maxAmount", 1 ) ); setNumTestsPerEvictionRun( getMaxTotal() ); setMinEvictableIdleTimeMillis( JiveGlobals.getLongProperty( "sms.smpp.connections.idleMillis", 1000 * 60 * 2 ) ); if ( getMinEvictableIdleTimeMillis() > 0 ) { setTimeBetweenEvictionRunsMillis( getMinEvictableIdleTimeMillis() / 10 ); } setTestOnBorrow( true ); setTestWhileIdle( true ); }
/** * Returns true if the roster versioning is enabled. * * @return true if the roster versioning is enabled. */ public static boolean isRosterVersioningEnabled() { return JiveGlobals.getBooleanProperty("xmpp.client.roster.versioning.active", true); }
@Override int getMaxIdleTime() { return JiveGlobals.getIntProperty("xmpp.multiplex.idle", 5 * 60 * 1000) / 1000; } }
@Override public String put(String key, String value) { JiveGlobals.setProperty(key, value); // Always return null since XMLProperties doesn't support the normal semantics. return null; }
@Override public void run() { if (Type.put == event) { JiveProperties.getInstance().localPut(key, value, isEncrypted); } else if (Type.deleted == event) { JiveProperties.getInstance().localRemove(key); } }
@Override public String remove(Object key) { JiveGlobals.deleteProperty((String)key); // Always return null since XMLProperties doesn't support the normal semantics. return null; }
/** * Deletes a locale property. If the property doesn't exist, the method * does nothing. * * @param name the name of the property to delete. */ public static void deleteXMLProperty(String name) { if (openfireProperties == null) { loadOpenfireProperties(); } openfireProperties.deleteProperty(name); }
private void enableLog(String property, boolean enabled) { switch (property) { case LOG_TRACE_ENABLED: setTraceEnabled(enabled); break; case LOG_DEBUG_ENABLED: setDebugEnabled(enabled); break; } } });
/** * Returns the value of the specified property. * * @param name the name of the property to get. * @return the value of the specified property. */ public synchronized String getProperty(String name) { return getProperty(name, true); }
/** * Adds a node to the beginning of the list. * * @param node the node to add to the beginning of the list. */ public LinkedListNode<E> addFirst(LinkedListNode<E> node) { return node.insert(head.next, head); }
public static synchronized SmsService getInstance() { if ( INSTANCE == null ) { INSTANCE = new SmsService(); } return INSTANCE; }
@Override public void propertyDeleted( String property, Map<String, Object> params ) { processPropertyChange( property ); }
public IQAdminHandler(LocalMUCRoom chatroom, PacketRouter packetRouter) { this.room = chatroom; this.router = packetRouter; this.skipInvite = JiveGlobals.getBooleanProperty("xmpp.muc.skipInvite", false); }
/** * Returns the HTTP binding port which uses SSL. * * @return the HTTP binding port which uses SSL. */ public int getHttpBindSecurePort() { return JiveGlobals.getIntProperty(HTTP_BIND_SECURE_PORT, HTTP_BIND_SECURE_PORT_DEFAULT); }
@Override public void setAuditPresence(boolean auditPresence) { this.auditPresence = auditPresence; JiveGlobals.setProperty("xmpp.audit.presence", auditPresence ? "true" : "false"); }
/** * Returns the number of milliseconds to elapse between clearing of idle server sessions. * * @return the number of milliseconds to elapse between clearing of idle server sessions. */ public int getServerSessionTimeout() { return JiveGlobals.getIntProperty("xmpp.server.session.timeout", 5 * 60 * 1000); }