@Override public String toString() { String result = StringUtil.isEmpty(address) ? ITCPAcceptor.DEFAULT_ADDRESS : address; if (port != NO_PORT) { result = result + PORT_SEPARATOR + port; } return result; } }
@Override public String toString() { String result = StringUtil.safe(host); if (userID != null) { result = userID + CREDENTIALS_SEPARATOR + result; } if (port != NO_PORT) { result = result + PORT_SEPARATOR + port; } return result; }
String capName = StringUtil.cap(featureName);
public IQueryHandler getQueryHandler(CDOQueryInfo info) { String queryLanguage = info.getQueryLanguage(); if (StringUtil.equalsUpperOrLowerCase(queryLanguage, SQLQueryHandler.QUERY_LANGUAGE)) { return new SQLQueryHandler(this); } return null; }
private String getTableNamePrefix() { String value = getProperties().get(PROP_TABLE_NAME_PREFIX); return StringUtil.safe(value); }
@Override protected void doBeforeActivate() throws Exception { super.doBeforeActivate(); if (StringUtil.isEmpty(name)) { throw new IllegalStateException("No name"); //$NON-NLS-1$ } }
public CDOViewProviderDescriptor(IConfigurationElement element) { super(element.getAttribute("regex"), Integer.parseInt(element.getAttribute("priority"))); //$NON-NLS-1$ //$NON-NLS-2$ this.element = element; if (StringUtil.isEmpty(element.getAttribute("class"))) //$NON-NLS-1$ { throw new IllegalArgumentException(MessageFormat.format( Messages.getString("CDOViewProviderRegistryImpl.4"), element)); //$NON-NLS-1$ } if (StringUtil.isEmpty(element.getAttribute("regex"))) //$NON-NLS-1$ { throw new IllegalArgumentException(MessageFormat.format( Messages.getString("CDOViewProviderRegistryImpl.6"), element)); //$NON-NLS-1$ } }
public CDOViewProviderDescriptor(IConfigurationElement element) { super(element.getAttribute("regex"), Integer.parseInt(element.getAttribute("priority"))); //$NON-NLS-1$ //$NON-NLS-2$ this.element = element; if (StringUtil.isEmpty(element.getAttribute("class"))) //$NON-NLS-1$ { throw new IllegalArgumentException(MessageFormat.format( Messages.getString("CDOViewProviderRegistryImpl.4"), element)); //$NON-NLS-1$ } if (StringUtil.isEmpty(element.getAttribute("regex"))) //$NON-NLS-1$ { throw new IllegalArgumentException(MessageFormat.format( Messages.getString("CDOViewProviderRegistryImpl.6"), element)); //$NON-NLS-1$ } }
protected IConnector getConnector(IManagedContainer container, String description) { int pos = description.indexOf(SCHEME_SEPARATOR); if (pos == -1) { throw new IllegalArgumentException("Malformed URI, could not find scheme separator :// in " + description); } String factoryType = description.substring(0, pos); if (StringUtil.isEmpty(factoryType)) { throw new IllegalArgumentException("Factory type not defined in " + description); } String connectorDescription = description.substring(pos + SCHEME_SEPARATOR.length()); if (StringUtil.isEmpty(connectorDescription)) { throw new IllegalArgumentException("Connector description not defined in " + description); } pos = connectorDescription.indexOf('?'); if (pos != -1) { connectorDescription = connectorDescription.substring(0, pos); } return Net4jUtil.getConnector(container, factoryType, connectorDescription); } }
/** * @since 4.0 */ public static Map<String, String> getParameters(String query) { Map<String, String> result = new HashMap<String, String>(); StringTokenizer tokenizer = new StringTokenizer(query, "&"); //$NON-NLS-1$ while (tokenizer.hasMoreTokens()) { String parameter = tokenizer.nextToken(); if (!StringUtil.isEmpty(parameter)) { int pos = parameter.indexOf('='); if (pos == -1) { String key = parameter.trim(); result.put(key, ""); //$NON-NLS-1$ } else { String key = parameter.substring(0, pos).trim(); String value = parameter.substring(pos + 1); result.put(key, value); } } } return result; } }
/** * @since 4.0 */ public static Map<String, String> getParameters(String query) { Map<String, String> result = new HashMap<String, String>(); StringTokenizer tokenizer = new StringTokenizer(query, "&"); //$NON-NLS-1$ while (tokenizer.hasMoreTokens()) { String parameter = tokenizer.nextToken(); if (!StringUtil.isEmpty(parameter)) { int pos = parameter.indexOf('='); if (pos == -1) { String key = parameter.trim(); result.put(key, ""); //$NON-NLS-1$ } else { String key = parameter.substring(0, pos).trim(); String value = parameter.substring(pos + 1); result.put(key, value); } } } return result; } }
public IStore createStore(String repositoryName, Map<String, String> repositoryProperties, Element storeConfig) { Map<String, String> properties = RepositoryConfigurator.getProperties(storeConfig, 1); String uri = properties.get("uri"); if (StringUtil.isEmpty(uri)) { throw new IllegalArgumentException("Property 'uri' missing"); } MongoURI mongoURI = new MongoURI(uri); String dbName = properties.get("db"); if (StringUtil.isEmpty(dbName)) { dbName = repositoryName; } String drop = properties.get("drop"); if (Boolean.toString(true).equals(drop)) { dropDatabase(mongoURI, dbName); } return CDOMongoDBUtil.createStore(uri, dbName); }
public ConnectorData(String description) { if (!StringUtil.isEmpty(description)) { try { URL url = parse(description); userID = url.getUserInfo(); host = url.getHost(); port = url.getPort(); } catch (MalformedURLException ex) { throw new ProductCreationException(ex); } } }
public CDOSession create(String description) { try { URI uri = new URI(description); String query = uri.getQuery(); if (StringUtil.isEmpty(query)) { throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOSessionFactory.1"), description)); //$NON-NLS-1$ } Map<String, String> parameters = CDOURIUtil.getParameters(query); return createSession(uri, parameters); } catch (URISyntaxException ex) { throw new IllegalArgumentException(ex); } }
public CDOSession create(String description) { try { URI uri = new URI(description); String query = uri.getQuery(); if (StringUtil.isEmpty(query)) { throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOSessionFactory.1"), description)); //$NON-NLS-1$ } Map<String, String> result = CDOURIUtil.getParameters(query); String repositoryName = result.get("repositoryName"); //$NON-NLS-1$ if (repositoryName == null) { throw new IllegalArgumentException("Repository name is missing: " + description); } boolean automaticPackageRegistry = TRUE.equals(result.get("automaticPackageRegistry")); //$NON-NLS-1$ return createSession(repositoryName, automaticPackageRegistry); } catch (URISyntaxException ex) { throw new IllegalArgumentException(ex); } }
public CDOServerBrowser.ContainerBased create(String description) throws ProductCreationException { CDOServerBrowser.ContainerBased browser = new CDOServerBrowser.ContainerBased(container); try { if (!StringUtil.isEmpty(description)) { browser.setPort(Integer.valueOf(description)); } } catch (Exception ex) { OM.LOG.warn(ex); } return browser; } }
/** * @since 3.0 */ public Store(String type, Set<CDOID.ObjectType> objectIDTypes, Set<ChangeFormat> supportedChangeFormats, Set<RevisionTemporality> supportedRevisionTemporalities, Set<RevisionParallelism> supportedRevisionParallelisms) { checkArg(!StringUtil.isEmpty(type), "Empty type"); //$NON-NLS-1$ this.type = type; this.objectIDTypes = objectIDTypes; checkArg(supportedChangeFormats != null && !supportedChangeFormats.isEmpty(), "Empty supportedChangeFormats"); //$NON-NLS-1$ this.supportedChangeFormats = supportedChangeFormats; checkArg(supportedRevisionTemporalities != null && !supportedRevisionTemporalities.isEmpty(), "Empty supportedRevisionTemporalities"); //$NON-NLS-1$ this.supportedRevisionTemporalities = supportedRevisionTemporalities; checkArg(supportedRevisionParallelisms != null && !supportedRevisionParallelisms.isEmpty(), "Empty supportedRevisionParallelisms"); //$NON-NLS-1$ this.supportedRevisionParallelisms = supportedRevisionParallelisms; }
protected boolean showCommitInfo(PrintStream out, CDOCommitInfo commitInfo, CDOServerBrowser browser, String param, boolean auditing) { String timeStamp = String.valueOf(commitInfo.getTimeStamp()); boolean selected = timeStamp.equals(param); String formatted = CDOCommonUtil.formatTimeStamp(commitInfo.getTimeStamp()).replaceAll(" ", " "); String label = formatted; if (!selected && auditing) { label = browser.href(formatted, getName(), "time", timeStamp); } out.print("<tr>\r\n"); out.print("<td valign=\"top\">\r\n"); out.print(label); out.print("</td>\r\n"); CDOBranch branch = commitInfo.getBranch(); out.print("<td valign=\"top\">\r\n"); out.print(branch.getName() + "[" + branch.getID() + "]"); out.print("</td>\r\n"); String userID = commitInfo.getUserID(); out.print("<td valign=\"top\">\r\n"); out.print(StringUtil.isEmpty(userID) ? " " : browser.escape(userID)); out.print("</td>\r\n"); String comment = commitInfo.getComment(); out.print("<td valign=\"top\">\r\n"); out.print(StringUtil.isEmpty(comment) ? " " : browser.escape(comment)); out.print("</td>\r\n"); out.print("</tr>\r\n"); return selected; }