@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; WCSInfoImpl other = (WCSInfoImpl) obj; if (gmlPrefixing != other.gmlPrefixing) return false; if (latLon != other.latLon) return false; if (maxInputMemory != other.maxInputMemory) return false; if (maxOutputMemory != other.maxOutputMemory) return false; if (overviewPolicy != other.overviewPolicy) return false; if (srs == null) { if (other.srs != null) return false; } else if (!srs.equals(other.srs)) return false; if (subsamplingEnabled == null) { if (other.subsamplingEnabled != null) return false; } else if (!subsamplingEnabled.equals(other.subsamplingEnabled)) return false; return true; }
public ServiceInfo createService() { return new ServiceInfoImpl(); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (gmlPrefixing ? 1231 : 1237); result = prime * result + (latLon ? 1231 : 1237); result = prime * result + (int) (maxInputMemory ^ (maxInputMemory >>> 32)); result = prime * result + (int) (maxOutputMemory ^ (maxOutputMemory >>> 32)); result = prime * result + ((overviewPolicy == null) ? 0 : overviewPolicy.hashCode()); result = prime * result + ((srs == null) ? 0 : srs.hashCode()); result = prime * result + ((subsamplingEnabled == null) ? 0 : subsamplingEnabled.hashCode()); return result; }
/** * 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 GwcServiceProxy() { serviceInfo = new ServiceInfoImpl(); serviceInfo.setId("gwc"); serviceInfo.setName("gwc"); serviceInfo.setEnabled(true); serviceInfo.setVersions(ImmutableList.of(new Version("1.0.0"))); gwcDispatcher = GeoWebCacheExtensions.bean(GeoWebCacheDispatcher.class); }
@Test public void testAddService() throws Exception { ServiceInfo service = geoServer.getFactory().createService(); service.setName("foo"); geoServer.add(service); ServiceInfo s2 = geoServer.getFactory().createService(); ((ServiceInfoImpl) s2).setId(service.getId()); try { geoServer.add(s2); fail("adding service with duplicate id should throw exception"); } catch (Exception e) { } ServiceInfo s = geoServer.getServiceByName("foo", ServiceInfo.class); assertTrue(s != service); assertEquals(service, s); }
public GwcServiceProxy() { serviceInfo = new ServiceInfoImpl(); serviceInfo.setId("gwc"); serviceInfo.setName("gwc"); serviceInfo.setEnabled(true); serviceInfo.setVersions(ImmutableList.of(new Version("1.0.0"))); gwcDispatcher = GeoWebCacheExtensions.bean(GeoWebCacheDispatcher.class); }
@Test public void testModifyService() throws Exception { ServiceInfo service = geoServer.getFactory().createService(); ((ServiceInfoImpl) service).setId("id"); service.setName("foo"); service.setTitle("bar"); geoServer.add(service); ServiceInfo s1 = geoServer.getServiceByName("foo", ServiceInfo.class); s1.setTitle("changed"); ServiceInfo s2 = geoServer.getServiceByName("foo", ServiceInfo.class); assertEquals("bar", s2.getTitle()); geoServer.save(s1); s2 = geoServer.getServiceByName("foo", ServiceInfo.class); assertEquals("changed", s2.getTitle()); }
ServiceInfo create() { // create it GeoServer gs = GeoServerApplication.get().getGeoServer(); ServiceInfo newService = gs.getFactory().create(serviceClass); // initialize from global service ServiceInfo global = gs.getService(serviceClass); OwsUtils.copy(global, newService, serviceClass); newService.setWorkspace(wsModel.getObject()); // hack, but need id to be null so its considered unattached ((ServiceInfoImpl) newService).setId(null); return newService; } }
public boolean equals(Object obj) { if (!(obj instanceof MyServiceInfo)) { return false; } MyServiceInfo other = (MyServiceInfo) obj; if (foo == null) { if (other.foo != null) { return false; } } else { if (!foo.equals(other.foo)) { return false; } } return super.equals(other); } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (canonicalSchemaLocation ? 1231 : 1237); result = prime * result + (encodeFeatureMember ? 1231 : 1237); result = prime * result + (featureBounding ? 1231 : 1237); result = prime * result + ((gml == null) ? 0 : gml.hashCode()); result = prime * result + (hitsIgnoreMaxFeatures ? 1231 : 1237); result = prime * result + maxFeatures; result = prime * result + ((serviceLevel == null) ? 0 : serviceLevel.hashCode()); result = prime * result + ((srs == null) ? 0 : srs.hashCode()); return result; }
ServiceInfo create() { //create it GeoServer gs = GeoServerApplication.get().getGeoServer(); ServiceInfo newService = gs.getFactory().create(serviceClass); //initialize from global service ServiceInfo global = gs.getService(serviceClass); OwsUtils.copy(global,newService, serviceClass); newService.setWorkspace(wsModel.getObject()); //hack, but need id to be null so its considered unattached ((ServiceInfoImpl)newService).setId(null); return newService; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; WPSInfoImpl other = (WPSInfoImpl) obj;
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((catalogMode == null) ? 0 : catalogMode.hashCode()); result = prime * result + ((connectionTimeout == null) ? 0 : connectionTimeout.hashCode());
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof WFSInfo)) return false; final WFSInfo other = (WFSInfo) obj; if (gml == null) { if (other.getGML() != null) return false; } else if (!gml.equals(other.getGML())) return false; if (maxFeatures != other.getMaxFeatures()) return false; if (featureBounding != other.isFeatureBounding()) return false; if (canonicalSchemaLocation != other.isCanonicalSchemaLocation()) return false; if (serviceLevel == null) { if (other.getServiceLevel() != null) return false; } else if (!serviceLevel.equals(other.getServiceLevel())) return false; if (encodeFeatureMember != other.isEncodeFeatureMember()) return false; if (hitsIgnoreMaxFeatures != other.isHitsIgnoreMaxFeatures()) return false; if (srs == null) { if (other.getSRS() != null) return false; } else if (!srs.equals(other.getSRS())) return false; return true; } }