public MetadataMap getMetadata() { if (metadata == null) { metadata = new MetadataMap(); } return metadata; }
public synchronized MetadataMap getMetadata() { if (metadata == null) { metadata = new MetadataMap(); } return metadata; }
public LayerGroupInfoImpl() { mode = Mode.SINGLE; publishables = new ArrayList<PublishedInfo>(); styles = new ArrayList<StyleInfo>(); metadata = new MetadataMap(); }
@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { Map map = (Map) super.unmarshal(reader, context); if (!(map instanceof MetadataMap)) { map = new MetadataMap(map); } return map; } }
private MetadataMap cloneMetadataMap(MetadataMap original) { MetadataMap clone = new MetadataMap(); for (Entry<String, Serializable> entry : original.entrySet()) { String key = entry.getKey(); Serializable value = entry.getValue(); if (value instanceof CatalogInfo) { CatalogInfo replacement = replaceCatalogInfo((CatalogInfo) value); if (replacement != null) { value = replacement; } } clone.put(key, value); } return clone; }
@Override protected void postDoMarshal( Object result, HierarchicalStreamWriter writer, MarshallingContext context) { FeatureTypeInfoImpl featureType = (FeatureTypeInfoImpl) result; // ensure null list does not result if (featureType.getAttributes() == null) { featureType.setAttributes(new ArrayList()); } if (featureType.getResponseSRS() == null) { featureType.setResponseSRS(new ArrayList()); } if (featureType.getMetadata() == null) { featureType.setMetadata(new MetadataMap()); } callback.postEncodeFeatureType(featureType, writer, context); } }
protected void resolve(GeoServerInfo info) { GeoServerInfoImpl global = (GeoServerInfoImpl) info; if (global.getMetadata() == null) { global.setMetadata(new MetadataMap()); } if (global.getClientProperties() == null) { global.setClientProperties(new HashMap<Object, Object>()); } if (global.getCoverageAccess() == null) { global.setCoverageAccess(new CoverageAccessInfoImpl()); } }
/** * Fills in the blanks of the service object loaded by XStream. This implementation makes sure * all collections in {@link ServiceInfoImpl} are initialized, subclasses should override to add * more specific initializations (such as the actual supported versions and so on) * * @param service */ protected T initialize(T service) { if (service instanceof ServiceInfoImpl) { // initialize all collections to ServiceInfoImpl impl = (ServiceInfoImpl) service; if (impl.getClientProperties() == null) { impl.setClientProperties(new HashMap()); } if (impl.getExceptionFormats() == null) { impl.setExceptionFormats(new ArrayList()); } if (impl.getKeywords() == null) { impl.setKeywords(new ArrayList()); } if (impl.getMetadata() == null) { impl.setMetadata(new MetadataMap()); } if (impl.getVersions() == null) { impl.setVersions(new ArrayList()); } } return service; }
public Object doUnmarshal( Object result, HierarchicalStreamReader reader, UnmarshallingContext context) { SettingsInfoImpl obj = (SettingsInfoImpl) super.doUnmarshal(result, reader, context); if (obj.getMetadata() == null) { obj.setMetadata(new MetadataMap()); } if (obj.getContact() == null) { obj.setContact(new ContactInfoImpl()); } if (obj.getClientProperties() == null) { obj.setClientProperties(new HashMap<Object, Object>()); } return obj; } }
expect(ws.getId()).andReturn(wsId).anyTimes(); expect(ws.getName()).andReturn(name).anyTimes(); expect(ws.getMetadata()).andReturn(new MetadataMap()).anyTimes(); expect(ns.getName()).andReturn(name).anyTimes(); expect(ns.getPrefix()).andReturn(name).anyTimes(); expect(ns.getMetadata()).andReturn(new MetadataMap()).anyTimes(); expect(ns.getURI()).andReturn(uri).anyTimes();
@Test public void testModifyMetadata() { // set default namespace addNamespace(); addDataStore(); TestListener l = new TestListener(); catalog.addListener(l); FeatureTypeInfo ft = catalog.getFactory().createFeatureType(); ft.setName("ftName"); ft.setDescription("ftDescription"); ft.setStore(ds); assertTrue(l.added.isEmpty()); catalog.add(ft); assertEquals(1, l.added.size()); assertEquals(ft, l.added.get(0).getSource()); ft = catalog.getFeatureTypeByName("ftName"); ft.getMetadata().put("newValue", "abcd"); MetadataMap newMetadata = new MetadataMap(ft.getMetadata()); catalog.save(ft); assertEquals(1, l.modified.size()); assertEquals(ft, l.modified.get(0).getSource()); assertTrue(l.modified.get(0).getPropertyNames().contains("metadata")); assertTrue(l.modified.get(0).getOldValues().contains(new MetadataMap())); assertTrue(l.modified.get(0).getNewValues().contains(newMetadata)); }
public MetadataMap getMetadata() { if (metadata == null) { metadata = new MetadataMap(); } return metadata; }
@Override public ProcessGroupInfo clone() { ProcessGroupInfoImpl clone = new ProcessGroupInfoImpl(); clone.setEnabled(enabled); clone.setFactoryClass(factoryClass); clone.setRoles(roles); if (filteredProcesses != null) { clone.setFilteredProcesses(new ArrayList<ProcessInfo>(filteredProcesses)); } if (metadata != null) { clone.metadata = new MetadataMap(new HashMap<String, Serializable>(metadata)); } return clone; }
@Override protected CSWInfo initialize(CSWInfo service) { // TODO: move this code block to the parent class if (service.getKeywords() == null) { ((CSWInfoImpl) service).setKeywords(new ArrayList()); } if (service.getExceptionFormats() == null) { ((CSWInfoImpl) service).setExceptionFormats(new ArrayList()); } if (service.getMetadata() == null) { ((CSWInfoImpl) service).setMetadata(new MetadataMap()); } if (service.getClientProperties() == null) { ((CSWInfoImpl) service).setClientProperties(new HashMap()); } if (service.getVersions() == null) { ((CSWInfoImpl) service).setVersions(new ArrayList()); } if (service.getVersions().isEmpty()) { service.getVersions().add(new Version("2.0.2")); } return service; } }
@Override protected CSWInfo initialize(CSWInfo service) { // TODO: move this code block to the parent class if (service.getKeywords() == null) { ((CSWInfoImpl) service).setKeywords(new ArrayList()); } if (service.getExceptionFormats() == null) { ((CSWInfoImpl) service).setExceptionFormats(new ArrayList()); } if (service.getMetadata() == null) { ((CSWInfoImpl) service).setMetadata(new MetadataMap()); } if (service.getClientProperties() == null) { ((CSWInfoImpl) service).setClientProperties(new HashMap()); } if (service.getVersions() == null) { ((CSWInfoImpl) service).setVersions(new ArrayList()); } if (service.getVersions().isEmpty()) { service.getVersions().add(new Version("2.0.2")); } return service; }
/** * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { GWCConfig configDefaults = GWCConfig.getOldDefaults(); mockMediator = mock(GWC.class); when(mockMediator.getConfig()).thenReturn(configDefaults); GridSetBroker gridsets = new GridSetBroker(true, true); when(mockMediator.getGridSetBroker()).thenReturn(gridsets); mockLayerInfo = mock(LayerInfo.class); MetadataMap layerMetadata = new MetadataMap(); when(mockLayerInfo.getMetadata()).thenReturn(layerMetadata); mockLayerGroupInfo = mock(LayerGroupInfo.class); MetadataMap groupMetadata = new MetadataMap(); when(mockLayerGroupInfo.getMetadata()).thenReturn(groupMetadata); mockResourceInfo = mock(FeatureTypeInfo.class); mockNamespaceInfo = mock(NamespaceInfo.class); when(mockLayerGroupInfo.getName()).thenReturn(LAYER_GROUP_NAME); when(mockLayerGroupInfo.prefixedName()).thenReturn(LAYER_GROUP_NAME); when(mockResourceInfo.prefixedName()).thenReturn(PREFIXED_RESOURCE_NAME); when(mockResourceInfo.getName()).thenReturn(RESOURCE_NAME); when(mockResourceInfo.getNamespace()).thenReturn(mockNamespaceInfo); when(mockNamespaceInfo.getPrefix()).thenReturn(NAMESPACE_PREFIX); when(mockLayerInfo.getResource()).thenReturn(mockResourceInfo); listener = new CatalogLayerEventListener(mockMediator); }
@Override protected WPSInfo initialize(WPSInfo service) { // TODO: move this code block to the parent class if ( service.getKeywords() == null ) { ((WPSInfoImpl)service).setKeywords( new ArrayList() ); } if ( service.getExceptionFormats() == null ) { ((WPSInfoImpl)service).setExceptionFormats( new ArrayList() ); } if ( service.getMetadata() == null ) { ((WPSInfoImpl)service).setMetadata( new MetadataMap() ); } if ( service.getClientProperties() == null ) { ((WPSInfoImpl)service).setClientProperties( new HashMap() ); } if ( service.getVersions() == null ) { ((WPSInfoImpl)service).setVersions( new ArrayList() ); } if ( service.getVersions().isEmpty() ) { service.getVersions().add( new Version( "1.0.0") ); } if (service.getConnectionTimeout() == 0) { // timeout has not yet been specified. Use default ((WPSInfoImpl)service).setConnectionTimeout(WPSInfoImpl.DEFAULT_CONNECTION_TIMEOUT); } return service; } }
((WPSInfoImpl) service).setMetadata(new MetadataMap()); ((ProcessGroupInfoImpl) pg).setMetadata(new MetadataMap()); ((ProcessInfoImpl) pi).setMetadata(new MetadataMap());