Refine search
public static SerializerDefinition readSerializer(Element elmt) { String name = elmt.getChild(STORE_SERIALIZATION_TYPE_ELMT).getText(); boolean hasVersion = true; Map<Integer, String> schemaInfosByVersion = new HashMap<Integer, String>(); throw new IllegalArgumentException("Specified multiple schemas AND version=none, which is not permitted."); Element compressionElmt = elmt.getChild(STORE_COMPRESSION_ELMT); Compression compression = null; if(compressionElmt != null) compression = new Compression(compressionElmt.getChildText("type"), compressionElmt.getChildText("options")); return new SerializerDefinition(name, schemaInfosByVersion, hasVersion, compression);
private StoreDefinition readView(Element store, List<StoreDefinition> stores) { String name = store.getChildText(STORE_NAME_ELMT); String targetName = store.getChildText(VIEW_TARGET_ELMT); String description = store.getChildText(STORE_DESCRIPTION_ELMT); String ownerText = store.getChildText(STORE_OWNERS_ELMT); List<String> owners = Lists.newArrayList(); if(ownerText != null) { if(store.getChildText(VIEW_SERIALIZER_FACTORY_ELMT) != null) { viewSerializerFactoryName = store.getChild(VIEW_SERIALIZER_FACTORY_ELMT).getText(); if(store.getChild(STORE_VALUE_SERIALIZER_ELMT) != null) valueSerializer = readSerializer(store.getChild(STORE_VALUE_SERIALIZER_ELMT)); if(store.getChildText(STORE_ROUTING_TIER_ELMT) != null) { routingTier = RoutingTier.fromDisplay(store.getChildText(STORE_ROUTING_TIER_ELMT)); } else { routingTier = target.getRoutingPolicy(); String viewClass = store.getChildText(VIEW_TRANS_ELMT);
private String findNamedWorkflowInstanceContainerFactory(Element rootElement) { String result=null; Element named = rootElement.getChild("namedcomponents"); if (named!=null) { List<Element> namedComponents = named.getChildren("namedcomponent"); for (Element namedComponent : namedComponents) { String className=namedComponent.getChildTextTrim("classname"); if (className!=null && className.equals("org.embl.ebi.escience.scuflui.WorkflowInstanceContainerFactory")) { result=namedComponent.getChildText("name"); break; } } } return result; }
public String getWorkspace() { Element rootLayer = rootElem.getChild("workspace"); if (rootLayer != null) { return rootLayer.getChildText("name"); } else { return null; } }
@SuppressWarnings("unchecked") private static StoreDefinition readStore(Element store) { String name = store.getChildText(STORE_NAME_ELMT); String storeType = store.getChildText(STORE_PERSISTENCE_ELMT); String description = store.getChildText(STORE_DESCRIPTION_ELMT); String ownerText = store.getChildText(STORE_OWNERS_ELMT); List<String> owners = Lists.newArrayList(); if(ownerText != null) { int replicationFactor = Integer.parseInt(store.getChildText(STORE_REPLICATION_FACTOR_ELMT)); HashMap<Integer, Integer> zoneReplicationFactor = null; Element zoneReplicationFactorNode = store.getChild(STORE_ZONE_REPLICATION_FACTOR_ELMT); if(zoneReplicationFactorNode != null) { zoneReplicationFactor = new HashMap<Integer, Integer>(); String zoneCountReadsStr = store.getChildText(STORE_ZONE_COUNT_READS); Integer zoneCountReads = null; if(zoneCountReadsStr != null) zoneCountReads = Integer.parseInt(zoneCountReadsStr); String zoneCountWritesStr = store.getChildText(STORE_ZONE_COUNT_WRITES); Integer zoneCountWrites = null; if(zoneCountWritesStr != null) zoneCountWrites = Integer.parseInt(zoneCountWritesStr); int requiredReads = Integer.parseInt(store.getChildText(STORE_REQUIRED_READS_ELMT)); int requiredWrites = Integer.parseInt(store.getChildText(STORE_REQUIRED_WRITES_ELMT)); String preferredReadsStr = store.getChildText(STORE_PREFERRED_READS_ELMT); Integer preferredReads = null; if(preferredReadsStr != null)
public String getRootLayer() { Element rootLayer = rootElem.getChild("rootLayer"); if (rootLayer != null) { return rootLayer.getChildText("name"); } else { return null; } }
public OpenSearchResults(Document response) { if (response.getRootElement().getName().equals(OutputFormat.rss.getRootElementName())) { format = OutputFormat.rss; Element channel = response.getRootElement().getChild("channel"); totalResults = Integer.parseInt( channel.getChildText("totalResults", OPEN_SEARCH_NAMESPACE)); //itemsPerPage = Integer.parseInt( channel.getChildText("itemsPerPage", OPEN_SEARCH_NAMESPACE)); items = ImmutableList.copyOf(channel.getChildren("item")); }else if (response.getRootElement().getName().equals(OutputFormat.xml.getRootElementName())) { format = OutputFormat.xml; totalResults = Integer.parseInt( response.getRootElement().getChildText("totalResults")); Element results = response.getRootElement().getChild("results"); items = ImmutableList.copyOf(results.getChildren("result")); } else { throw new NotImplementedException("parser of output format ["+response.getRootElement().getName()+"] is not implemented"); } }
public String getCRS() { Element bounds = rootElem.getChild("bounds"); return bounds.getChildText("crs"); }
@SuppressWarnings("unchecked") private static Context parseLanguages(Context src, Element languages){ src.enableMultiLanguageSupport(); Element supportedLanguages = languages.getChild("supported"); List<Element> supLangs = supportedLanguages.getChildren("language"); for (Element e: supLangs){ src.addLanguage(e.getText()); } String defLang = languages.getChild("default").getChildText("language"); src.setDefaultLanguage(defLang); return src; }
public String getDefaultStyleWorkspace() { Element defaultStyle = layerElem.getChild("defaultStyle"); return defaultStyle == null? null : defaultStyle.getChildText("workspace"); }
public List<GSAttributeEncoder> getEncodedAttributeList() { List<GSAttributeEncoder> attrsList = null; final Element attrsRoot = rootElem.getChild("attributes"); if(attrsRoot!=null){ final List<Element> attrs = attrsRoot.getChildren(); if (attrs != null) { attrsList = new ArrayList<GSAttributeEncoder>(attrs.size()); for (Element attr : attrs) { final GSAttributeEncoder attrEnc = new GSAttributeEncoder(); for (FeatureTypeAttribute at : FeatureTypeAttribute.values()) { String key = at.toString(); attrEnc.setAttribute(at, attr.getChildText(key)); } attrsList.add(attrEnc); } } } return attrsList; } }
public String getTitle() { Element resource = layerElem.getChild("resource"); return resource.getChildText("title"); }
private Map<String, Build> createLatestBuildList(Document doc) { Map<String, Build> buildMap = new LinkedHashMap<String, Build>(); Element rootElement = doc.getRootElement(); List<Element> elements = rootElement.getChildren(RSS_ENTRY, rootElement.getNamespace()); for (Element element : elements) { String title = element.getChildText(RSS_TITLE, rootElement.getNamespace()); String publishedBuild = element.getChildText(RSS_PUBLISHED, rootElement.getNamespace()); String jobName = RssUtil.extractBuildJob(title); String number = RssUtil.extractBuildNumber(title); BuildStatusEnum status = RssUtil.extractStatus(title); Element linkElement = element.getChild(RSS_LINK, rootElement.getNamespace()); String link = linkElement.getAttributeValue(RSS_LINK_HREF); if (!BuildStatusEnum.NULL.equals(status)) { buildMap.put(jobName, Build.createBuildFromRss(link, number, status.getStatus(), Boolean.FALSE.toString(), publishedBuild, title)); } } return buildMap; } }
public String getAbstract() { Element resource = layerElem.getChild("resource"); return resource.getChildText("abstract"); }
private void validateGroundOverlay(String name, Object overlay, Namespace namespace) { Element groundOverlay = (Element) overlay; assertEquals("GroundOverlay", groundOverlay.getName()); assertEquals(3, groundOverlay.getChildren().size()); assertEquals(name, groundOverlay.getChildText("name", namespace)); Element icon = groundOverlay.getChild("Icon", namespace); assertEquals(name + ".png", icon.getChildText("href", namespace)); final Element latLonBox = groundOverlay.getChild("LatLonBox", namespace); assertNotNull(latLonBox); assertEquals("70.0", latLonBox.getChildText("north", namespace)); assertEquals("30.0", latLonBox.getChildText("south", namespace)); assertEquals("20.0", latLonBox.getChildText("east", namespace)); assertEquals("0.0", latLonBox.getChildText("west", namespace)); }
public String getDefaultStyle() { Element defaultStyle = layerElem.getChild("defaultStyle"); return defaultStyle == null? null : defaultStyle.getChildText("name"); }
public String getStoreName() { return rootElem.getChild("store").getChildText("name"); }
public String getWorkspaceName() { return dsElem.getChild("workspace").getChildText("name"); }
public String getNameSpace() { return rootElem.getChild("namespace").getChildText("name"); }
public String getWorkspaceName() { return cs.getChild("workspace").getChildText("name"); }