migration_id
stringclasses 994
values | ver1_file_path
stringlengths 25
222
⌀ | ver2_file_path
stringlengths 28
222
⌀ | ver1_tree_path
stringlengths 1
111
⌀ | ver2_tree_path
stringlengths 1
105
⌀ | ver1_signature
stringlengths 5
3.53k
⌀ | ver2_signature
stringlengths 5
3.53k
⌀ | method_ver1
stringlengths 8
336k
⌀ | method_ver2
stringlengths 8
171k
⌀ |
---|---|---|---|---|---|---|---|---|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java
|
AbstractObservationDAO
|
AbstractObservationDAO
|
addParameterNameRestriction__(DetachedCriteria detachedCriteria, String name)
|
addParameterNameRestriction__(DetachedCriteria detachedCriteria, String name)
|
protected DetachedCriteria addParameterNameRestriction(DetachedCriteria detachedCriteria, String name) {
detachedCriteria.add(Restrictions.eq(Parameter.NAME, name));
return detachedCriteria;
}
|
protected DetachedCriteria addParameterNameRestriction(DetachedCriteria detachedCriteria, String name) {
detachedCriteria.add(Restrictions.eq(ParameterEntity.NAME, name));
return detachedCriteria;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java
|
AbstractObservationDAO
|
AbstractObservationDAO
|
addParameterValueRestriction__(DetachedCriteria detachedCriteria, Object value)
|
addParameterValueRestriction__(DetachedCriteria detachedCriteria, Object value)
|
protected DetachedCriteria addParameterValueRestriction(DetachedCriteria detachedCriteria, Object value) {
detachedCriteria.add(Restrictions.eq(Parameter.VALUE, value));
return detachedCriteria;
}
|
protected DetachedCriteria addParameterValueRestriction(DetachedCriteria detachedCriteria, Object value) {
detachedCriteria.add(Restrictions.eq(ParameterEntity.VALUE, value));
return detachedCriteria;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java
|
AbstractObservationDAO
|
AbstractObservationDAO
|
getResultTimeFilter__(Criteria c, TimeInstant resultTime, Time phenomenonTime)
|
getResultTimeFilter__(Criteria c, TimeInstant resultTime, Time phenomenonTime)
|
private TemporalFilter getResultTimeFilter(Criteria c, TimeInstant resultTime, Time phenomenonTime) throws CodedException {
String valueReferencep = Sos2Constants.EN_RESULT_TIME;
if (resultTime != null) {
if (resultTime.getValue() != null) {
return new TemporalFilter(TimeOperator.TM_Equals, resultTime, valueReferencep);
} else if (TimeIndeterminateValue.contains(Sos2Constants.EN_PHENOMENON_TIME)
&& phenomenonTime instanceof TimeInstant) {
return new TemporalFilter(TimeOperator.TM_Equals, phenomenonTime, valueReferencep);
} else {
throw new NoApplicableCodeException()
.withMessage("Error while creating result time filter for querying observations!");
}
} else {
if (phenomenonTime instanceof TimeInstant) {
return new TemporalFilter(TimeOperator.TM_Equals, phenomenonTime, valueReferencep);
} else {
throw new NoApplicableCodeException()
.withMessage("Error while creating result time filter for querying observations!");
}
}
}
|
private TemporalFilter getResultTimeFilter(Criteria c, TimeInstant resultTime, Time phenomenonTime)
throws OwsExceptionReport {
String valueReferencep = Sos2Constants.EN_RESULT_TIME;
if (resultTime != null) {
if (resultTime.getValue() != null) {
return new TemporalFilter(TimeOperator.TM_Equals, resultTime, valueReferencep);
} else if (phenomenonTime instanceof TimeInstant) {
return new TemporalFilter(TimeOperator.TM_Equals, phenomenonTime, valueReferencep);
} else {
throw new NoApplicableCodeException().withMessage(ERROR_CREATING_RESULT_TIME_LOG);
}
} else {
if (phenomenonTime instanceof TimeInstant) {
return new TemporalFilter(TimeOperator.TM_Equals, phenomenonTime, valueReferencep);
} else {
throw new NoApplicableCodeException().withMessage(ERROR_CREATING_RESULT_TIME_LOG);
}
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/test/java/org/n52/sos/util/builder/InsertSensorRequestBuilder.java
|
core/api/src/test/java/org/n52/sos/util/builder/InsertSensorRequestBuilder.java
|
InsertSensorRequestBuilder
|
InsertSensorRequestBuilder
|
setProcedure__(SosProcedureDescription procedureDescription)
|
setProcedure__(SosProcedureDescription<?> procedureDescription)
|
public InsertSensorRequestBuilder setProcedure(SosProcedureDescription procedureDescription) {
this.procedureDescription = procedureDescription;
return this;
}
|
public InsertSensorRequestBuilder setProcedure(SosProcedureDescription<?> procedureDescription) {
this.procedureDescription = procedureDescription;
return this;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/test/java/org/n52/sos/util/builder/InsertSensorRequestBuilder.java
|
core/api/src/test/java/org/n52/sos/util/builder/InsertSensorRequestBuilder.java
|
InsertSensorRequestBuilder
|
InsertSensorRequestBuilder
|
build__()
|
build__()
|
public InsertSensorRequest build() {
InsertSensorRequest request = new InsertSensorRequest();
if (procedureDescription != null) {
request.setProcedureDescription(procedureDescription);
if (procedureDescription.isSetOfferings()) {
request.setAssignedOfferings(Lists.newArrayList(procedureDescription.getOfferings()));
}
}
if (CollectionHelper.isNotEmpty(observableProperties)) {
request.setObservableProperty(observableProperties);
}
if (CollectionHelper.isNotEmpty(featureRelationships)) {
request.setRelatedFeature(featureRelationships);
}
SosInsertionMetadata meta = null;
if (CollectionHelper.isNotEmpty(observationTypes)) {
meta = new SosInsertionMetadata();
meta.setObservationTypes(observationTypes);
}
if (CollectionHelper.isNotEmpty(featureOfInterestTypes)) {
if (meta == null) {
meta = new SosInsertionMetadata();
}
meta.setFeatureOfInterestTypes(featureOfInterestTypes);
}
if (meta != null) {
request.setMetadata(meta);
}
return request;
}
|
public InsertSensorRequest build() {
InsertSensorRequest request = new InsertSensorRequest();
if (procedureDescription != null) {
request.setProcedureDescription(procedureDescription);
if (procedureDescription.isSetOfferings()) {
request.setAssignedOfferings(procedureDescription.getOfferings());
}
}
if (CollectionHelper.isNotEmpty(observableProperties)) {
request.setObservableProperty(observableProperties);
}
if (CollectionHelper.isNotEmpty(featureRelationships)) {
request.setRelatedFeature(featureRelationships);
}
SosInsertionMetadata meta = null;
if (CollectionHelper.isNotEmpty(observationTypes)) {
meta = new SosInsertionMetadata();
meta.setObservationTypes(observationTypes);
}
if (CollectionHelper.isNotEmpty(featureOfInterestTypes)) {
if (meta == null) {
meta = new SosInsertionMetadata();
}
meta.setFeatureOfInterestTypes(featureOfInterestTypes);
}
if (meta != null) {
request.setMetadata(meta);
}
return request;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
statistics/src/main/java/org/n52/sos/statistics/sos/models/OmObservationConstellationEsModel.java
|
statistics/src/main/java/org/n52/sos/statistics/sos/models/OmObservationConstellationEsModel.java
|
OmObservationConstellationEsModel
|
OmObservationConstellationEsModel
|
convert__(Collection<OmObservationConstellation> observationConstellation)
|
convert__(Collection<OmObservationConstellation> observationConstellation)
|
public static List<Map<String, Object>> convert(Collection<OmObservationConstellation> observationConstellation) {
if (observationConstellation == null || observationConstellation.isEmpty()) {
return null;
}
return observationConstellation.stream().map(OmObservationConstellationEsModel::convert).collect(Collectors.toList());
}
|
public static List<Map<String, Object>> convert(Collection<OmObservationConstellation> observationConstellation) {
if (observationConstellation == null || observationConstellation.isEmpty()) {
return null;
}
return observationConstellation.stream().map(OmObservationConstellationEsModel::convert)
.collect(Collectors.toList());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
statistics/src/main/java/org/n52/sos/statistics/sos/models/OmObservationConstellationEsModel.java
|
statistics/src/main/java/org/n52/sos/statistics/sos/models/OmObservationConstellationEsModel.java
|
OmObservationConstellationEsModel
|
OmObservationConstellationEsModel
|
getAsMap__()
|
getAsMap__()
|
@Override
protected Map<String, Object> getAsMap() {
if (constellation.getProcedure() != null) {
put(ObjectEsParameterFactory.OMOCONSTELL_PROCEDURE, constellation.getProcedure().getIdentifier());
}
if (constellation.getObservableProperty() != null) {
put(ObjectEsParameterFactory.OMOCONSTELL_OBSERVABLE_PROPERTY, constellation.getObservableProperty().getIdentifier());
}
if (constellation.getFeatureOfInterest() != null) {
put(ObjectEsParameterFactory.OMOCONSTELL_FEATURE_OF_INTEREST, constellation.getFeatureOfInterest().getIdentifier());
}
put(ObjectEsParameterFactory.OMOCONSTELL_OBSERVATION_TYPE, constellation.getObservationType());
return dataMap;
}
|
@Override
protected Map<String, Object> getAsMap() {
if (constellation.getProcedure() != null) {
put(ObjectEsParameterFactory.OMOCONSTELL_PROCEDURE, constellation.getProcedure().getIdentifier());
}
if (constellation.getObservableProperty() != null) {
put(ObjectEsParameterFactory.OMOCONSTELL_OBSERVABLE_PROPERTY,
constellation.getObservableProperty().getIdentifier());
}
if (constellation.getFeatureOfInterest() != null) {
put(ObjectEsParameterFactory.OMOCONSTELL_FEATURE_OF_INTEREST,
constellation.getFeatureOfInterest().getIdentifier());
}
put(ObjectEsParameterFactory.OMOCONSTELL_OBSERVATION_TYPE, constellation.getObservationType());
return dataMap;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setDescriptionTemplate__(final String descriptionTemplate)
|
setDescriptionTemplate__(final String descriptionTemplate)
|
@Setting(DESCRIPTION_TEMPLATE)
public void setDescriptionTemplate(final String descriptionTemplate) {
Validation.notNullOrEmpty(DESCRIPTION_TEMPLATE, descriptionTemplate);
this.descriptionTemplate = descriptionTemplate;
}
|
@Setting(ProcedureDescriptionSettings.DESCRIPTION_TEMPLATE)
public void setDescriptionTemplate(final String descriptionTemplate) {
Validation.notNullOrEmpty(DESCRIPTION_TEMPLATE, descriptionTemplate);
this.descriptionTemplate = descriptionTemplate;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setGenerateClassification__(final boolean generateClassification)
|
setGenerateClassification__(final boolean generateClassification)
|
@Setting(GENERATE_CLASSIFICATION)
public void setGenerateClassification(final boolean generateClassification) {
this.generateClassification = generateClassification;
}
|
@Setting(ProcedureDescriptionSettings.GENERATE_CLASSIFICATION)
public void setGenerateClassification(final boolean generateClassification) {
this.generateClassification = generateClassification;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setClassifierIntendedApplicationValue__(final String classifierIntendedApplicationValue)
|
setClassifierIntendedApplicationValue__(final String classifierIntendedApplicationValue)
|
@Setting(CLASSIFIER_INTENDED_APPLICATION_VALUE)
public void setClassifierIntendedApplicationValue(final String classifierIntendedApplicationValue) {
this.classifierIntendedApplicationValue =
(classifierIntendedApplicationValue == null) ? "" : classifierIntendedApplicationValue;
}
|
@Setting(ProcedureDescriptionSettings.CLASSIFIER_INTENDED_APPLICATION_VALUE)
public void setClassifierIntendedApplicationValue(final String classifierIntendedApplicationValue) {
this.classifierIntendedApplicationValue =
(classifierIntendedApplicationValue == null) ? "" : classifierIntendedApplicationValue;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setClassifierIntendedApplicationDefinition__(final String classifierIntendedApplicationDefinition)
|
setClassifierIntendedApplicationDefinition__(final String classifierIntendedApplicationDefinition)
|
@Setting(CLASSIFIER_INTENDED_APPLICATION_DEFINITION)
public void setClassifierIntendedApplicationDefinition(final String classifierIntendedApplicationDefinition) {
Validation.notNull(CLASSIFIER_INTENDED_APPLICATION_DEFINITION, classifierIntendedApplicationDefinition);
this.classifierIntendedApplicationDefinition = classifierIntendedApplicationDefinition;
}
|
@Setting(ProcedureDescriptionSettings.CLASSIFIER_INTENDED_APPLICATION_DEFINITION)
public void setClassifierIntendedApplicationDefinition(final String classifierIntendedApplicationDefinition) {
Validation.notNull(CLASSIFIER_INTENDED_APPLICATION_DEFINITION, classifierIntendedApplicationDefinition);
this.classifierIntendedApplicationDefinition = classifierIntendedApplicationDefinition;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setClassifierProcedureTypeDefinition__(final String classifierProcedureTypeDefinition)
|
setClassifierProcedureTypeDefinition__(final String classifierProcedureTypeDefinition)
|
@Setting(CLASSIFIER_PROCEDURE_TYPE_DEFINITION)
public void setClassifierProcedureTypeDefinition(final String classifierProcedureTypeDefinition) {
Validation.notNull(CLASSIFIER_PROCEDURE_TYPE_DEFINITION, classifierProcedureTypeDefinition);
this.classifierProcedureTypeDefinition = classifierProcedureTypeDefinition;
}
|
@Setting(ProcedureDescriptionSettings.CLASSIFIER_PROCEDURE_TYPE_DEFINITION)
public void setClassifierProcedureTypeDefinition(final String classifierProcedureTypeDefinition) {
Validation.notNull(CLASSIFIER_PROCEDURE_TYPE_DEFINITION, classifierProcedureTypeDefinition);
this.classifierProcedureTypeDefinition = classifierProcedureTypeDefinition;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setClassifierProcedureTypeValue__(final String classifierProcedureTypeValue)
|
setClassifierProcedureTypeValue__(final String classifierProcedureTypeValue)
|
@Setting(CLASSIFIER_PROCEDURE_TYPE_VALUE)
public void setClassifierProcedureTypeValue(final String classifierProcedureTypeValue) {
this.classifierProcedureTypeValue = (classifierProcedureTypeValue == null) ? "" : classifierProcedureTypeValue;
}
|
@Setting(ProcedureDescriptionSettings.CLASSIFIER_PROCEDURE_TYPE_VALUE)
public void setClassifierProcedureTypeValue(final String classifierProcedureTypeValue) {
this.classifierProcedureTypeValue = (classifierProcedureTypeValue == null) ? "" : classifierProcedureTypeValue;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setUseServiceContactAsProcedureContact__(final boolean useServiceContactAsProcedureContact)
|
setUseServiceContactAsProcedureContact__(final boolean useServiceContactAsProcedureContact)
|
@Setting(USE_SERVICE_CONTACT_AS_PROCEDURE_CONTACT)
public void setUseServiceContactAsProcedureContact(final boolean useServiceContactAsProcedureContact) {
Validation.notNull(USE_SERVICE_CONTACT_AS_PROCEDURE_CONTACT, useServiceContactAsProcedureContact);
this.useServiceContactAsProcedureContact = useServiceContactAsProcedureContact;
}
|
@Setting(ProcedureDescriptionSettings.USE_SERVICE_CONTACT_AS_PROCEDURE_CONTACT)
public void setUseServiceContactAsProcedureContact(final boolean useServiceContactAsProcedureContact) {
Validation.notNull(USE_SERVICE_CONTACT_AS_PROCEDURE_CONTACT, useServiceContactAsProcedureContact);
this.useServiceContactAsProcedureContact = useServiceContactAsProcedureContact;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setIdentifierShortNameDefinition__(final String identifierShortNameDefinition)
|
setIdentifierShortNameDefinition__(final String identifierShortNameDefinition)
|
@Setting(IDENTIFIER_SHORT_NAME_DEFINITION)
public void setIdentifierShortNameDefinition(final String identifierShortNameDefinition) {
Validation.notNullOrEmpty(IDENTIFIER_SHORT_NAME_DEFINITION, identifierShortNameDefinition);
this.identifierShortNameDefinition = identifierShortNameDefinition;
}
|
@Setting(ProcedureDescriptionSettings.IDENTIFIER_SHORT_NAME_DEFINITION)
public void setIdentifierShortNameDefinition(final String identifierShortNameDefinition) {
Validation.notNullOrEmpty(IDENTIFIER_SHORT_NAME_DEFINITION, identifierShortNameDefinition);
this.identifierShortNameDefinition = identifierShortNameDefinition;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setIdentifierLongNameDefinition__(final String identifierLongNameDefinition)
|
setIdentifierLongNameDefinition__(final String identifierLongNameDefinition)
|
@Setting(IDENTIFIER_LONG_NAME_DEFINITION)
public void setIdentifierLongNameDefinition(final String identifierLongNameDefinition) {
Validation.notNullOrEmpty(IDENTIFIER_LONG_NAME_DEFINITION, identifierLongNameDefinition);
this.identifierLongNameDefinition = identifierLongNameDefinition;
}
|
@Setting(ProcedureDescriptionSettings.IDENTIFIER_LONG_NAME_DEFINITION)
public void setIdentifierLongNameDefinition(final String identifierLongNameDefinition) {
Validation.notNullOrEmpty(IDENTIFIER_LONG_NAME_DEFINITION, identifierLongNameDefinition);
this.identifierLongNameDefinition = identifierLongNameDefinition;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setLatitudeUom__(final String latLongUom)
|
setLatitudeUom__(final String latLongUom)
|
@Setting(LAT_LONG_UOM)
public void setLatitudeUom(final String latLongUom) {
this.latLongUom = latLongUom;
}
|
@Setting(ProcedureDescriptionSettings.LAT_LONG_UOM)
public void setLatitudeUom(final String latLongUom) {
this.latLongUom = latLongUom;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setAltitudeUom__(final String altitudeUom)
|
setAltitudeUom__(final String altitudeUom)
|
@Setting(ALTITUDE_UOM)
public void setAltitudeUom(final String altitudeUom) {
this.altitudeUom = altitudeUom;
}
|
@Setting(ProcedureDescriptionSettings.ALTITUDE_UOM)
public void setAltitudeUom(final String altitudeUom) {
this.altitudeUom = altitudeUom;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setProcessMethodRulesDefinitionDescriptionTemplate__(
final String processMethodRulesDefinitionDescriptionTemplate)
|
setProcessMethodRulesDefinitionDescriptionTemplate__(
final String processMethodRulesDefinitionDescriptionTemplate)
|
@Setting(PROCESS_METHOD_RULES_DEFINITION_DESCRIPTION_TEMPLATE)
public void setProcessMethodRulesDefinitionDescriptionTemplate(
final String processMethodRulesDefinitionDescriptionTemplate) {
Validation.notNullOrEmpty(PROCESS_METHOD_RULES_DEFINITION_DESCRIPTION_TEMPLATE,
processMethodRulesDefinitionDescriptionTemplate);
this.processMethodRulesDefinitionDescriptionTemplate = processMethodRulesDefinitionDescriptionTemplate;
}
|
@Setting(ProcedureDescriptionSettings.PROCESS_METHOD_RULES_DEFINITION_DESCRIPTION_TEMPLATE)
public void setProcessMethodRulesDefinitionDescriptionTemplate(
final String processMethodRulesDefinitionDescriptionTemplate) {
Validation.notNullOrEmpty(PROCESS_METHOD_RULES_DEFINITION_DESCRIPTION_TEMPLATE,
processMethodRulesDefinitionDescriptionTemplate);
this.processMethodRulesDefinitionDescriptionTemplate = processMethodRulesDefinitionDescriptionTemplate;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setEnrichWithOfferings__(final boolean enrichWithOfferings)
|
setEnrichWithOfferings__(final boolean enrichWithOfferings)
|
@Setting(ENRICH_WITH_OFFERINGS)
public void setEnrichWithOfferings(final boolean enrichWithOfferings) {
Validation.notNull(ENRICH_WITH_OFFERINGS, enrichWithOfferings);
this.enrichWithOfferings = enrichWithOfferings;
}
|
@Setting(ProcedureDescriptionSettings.ENRICH_WITH_OFFERINGS)
public void setEnrichWithOfferings(final boolean enrichWithOfferings) {
Validation.notNull(ENRICH_WITH_OFFERINGS, enrichWithOfferings);
this.enrichWithOfferings = enrichWithOfferings;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setEnrichWithFeatures__(final boolean enrichWithFeatures)
|
setEnrichWithFeatures__(final boolean enrichWithFeatures)
|
@Setting(ENRICH_WITH_FEATURES)
public void setEnrichWithFeatures(final boolean enrichWithFeatures) {
Validation.notNull(ENRICH_WITH_FEATURES, enrichWithFeatures);
this.enrichWithFeatures = enrichWithFeatures;
}
|
@Setting(ProcedureDescriptionSettings.ENRICH_WITH_FEATURES)
public void setEnrichWithFeatures(final boolean enrichWithFeatures) {
Validation.notNull(ENRICH_WITH_FEATURES, enrichWithFeatures);
this.enrichWithFeatures = enrichWithFeatures;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
core/api/src/main/java/org/n52/sos/service/ProcedureDescriptionSettings.java
|
ProcedureDescriptionSettings
|
ProcedureDescriptionSettings
|
setEnrichWithDiscoveryInformation__(final boolean enrichWithDiscoveryInformation)
|
setEnrichWithDiscoveryInformation__(final boolean enrichWithDiscoveryInformation)
|
@Setting(ENRICH_WITH_DISCOVERY_INFORMATION)
public void setEnrichWithDiscoveryInformation(final boolean enrichWithDiscoveryInformation) {
Validation.notNull(ENRICH_WITH_DISCOVERY_INFORMATION, enrichWithDiscoveryInformation);
this.enrichWithDiscoveryInformation = enrichWithDiscoveryInformation;
}
|
@Setting(ProcedureDescriptionSettings.ENRICH_WITH_DISCOVERY_INFORMATION)
public void setEnrichWithDiscoveryInformation(final boolean enrichWithDiscoveryInformation) {
Validation.notNull(ENRICH_WITH_DISCOVERY_INFORMATION, enrichWithDiscoveryInformation);
this.enrichWithDiscoveryInformation = enrichWithDiscoveryInformation;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/exception/ows/concrete/ErrorWhileSavingResponseToOutputStreamException.java
|
core/api/src/main/java/org/n52/sos/exception/ows/concrete/ErrorWhileSavingResponseToOutputStreamException.java
|
ErrorWhileSavingResponseToOutputStreamException
|
ErrorWhileSavingResponseToOutputStreamException
|
ErrorWhileSavingResponseToOutputStreamException__(final IOException ioe)
|
ErrorWhileSavingResponseToOutputStreamException__(final IOException ioe)
|
public ErrorWhileSavingResponseToOutputStreamException(final IOException ioe) {
withMessage("Error occurs while saving response to output stream!").causedBy(ioe);
setStatus(INTERNAL_SERVER_ERROR);
}
|
public ErrorWhileSavingResponseToOutputStreamException(final IOException ioe) {
withMessage("Error occurs while saving response to output stream!").causedBy(ioe);
setStatus(HTTPStatus.INTERNAL_SERVER_ERROR);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/GetResultTemplateDAO.java
|
hibernate/handler/src/main/java/org/n52/sos/ds/hibernate/GetResultTemplateHandler.java
|
GetResultTemplateDAO
|
GetResultTemplateHandler
|
GetResultTemplateDAO__()
|
GetResultTemplateHandler__()
|
public GetResultTemplateDAO() {
super(SosConstants.SOS);
}
|
public GetResultTemplateHandler() {
super(SosConstants.SOS);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/GetResultTemplateDAO.java
|
hibernate/handler/src/main/java/org/n52/sos/ds/hibernate/GetResultTemplateHandler.java
|
GetResultTemplateDAO
|
GetResultTemplateHandler
|
getResultTemplate__(GetResultTemplateRequest request)
|
getResultTemplate__(GetResultTemplateRequest request)
|
@Override
public GetResultTemplateResponse getResultTemplate(GetResultTemplateRequest request) throws OwsExceptionReport {
Session session = null;
try {
session = sessionHolder.getSession();
ResultTemplate resultTemplate =
new ResultTemplateDAO().getResultTemplateObject(request.getOffering(),
request.getObservedProperty(), session);
if (resultTemplate != null) {
GetResultTemplateResponse response = new GetResultTemplateResponse();
response.setService(request.getService());
response.setVersion(request.getVersion());
response.setResultEncoding(ResultHandlingHelper.createSosResultEncoding(resultTemplate
.getResultEncoding()));
response.setResultStructure(ResultHandlingHelper.createSosResultStructure(resultTemplate
.getResultStructure()));
return response;
}
throw new NoSweCommonEncodingForOfferingObservablePropertyCombination(request.getOffering(),
request.getObservedProperty());
} catch (HibernateException he) {
throw new NoApplicableCodeException().causedBy(he).withMessage(
"Error while querying data result template data!");
} finally {
sessionHolder.returnSession(session);
}
}
|
@Override
public GetResultTemplateResponse getResultTemplate(GetResultTemplateRequest request) throws OwsExceptionReport {
Session session = null;
try {
session = sessionHolder.getSession();
ResultTemplateEntity resultTemplate = daoFactory.getResultTemplateDAO()
.getResultTemplateObject(request.getOffering(), request.getObservedProperty(), session);
if (resultTemplate != null) {
GetResultTemplateResponse response = new GetResultTemplateResponse();
response.setService(request.getService());
response.setVersion(request.getVersion());
response.setResultEncoding(createSosResultEncoding(resultTemplate.getEncoding()));
response.setResultStructure(createSosResultStructure(resultTemplate.getStructure()));
return response;
}
throw new NoSweCommonEncodingForOfferingObservablePropertyCombination(request.getOffering(),
request.getObservedProperty());
} catch (HibernateException he) {
throw new NoApplicableCodeException().causedBy(he)
.withMessage("Error while querying data result template data!");
} finally {
sessionHolder.returnSession(session);
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/enrich/BoundingBoxEnrichment.java
|
handler/src/main/java/org/n52/sos/ds/procedure/enrich/BoundingBoxEnrichment.java
|
BoundingBoxEnrichment
|
BoundingBoxEnrichment
|
enrich__(final AbstractSensorML description)
|
enrich__(final AbstractSensorML description)
|
@Override
public void enrich(final AbstractSensorML description) throws OwsExceptionReport {
final Optional<SmlCapabilities> existingCapabilities =
description.findCapabilities(BBOX_PREDICATE);
final Optional<SmlCapabilities> newCapabilities =
createCapabilities(existingCapabilities);
if (newCapabilities.isPresent()) {
if (existingCapabilities.isPresent()) {
description.getCapabilities().remove(existingCapabilities.get());
}
description.addCapabilities(newCapabilities.get());
}
}
|
@Override
public void enrich(final AbstractSensorML description)
throws OwsExceptionReport {
final Optional<SmlCapabilities> existingCapabilities = description.findCapabilities(BBOX_PREDICATE);
final Optional<SmlCapabilities> newCapabilities = createCapabilities(existingCapabilities);
if (newCapabilities.isPresent()) {
if (existingCapabilities.isPresent()) {
description.getCapabilities().remove(existingCapabilities.get());
}
description.addCapabilities(newCapabilities.get());
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/enrich/BoundingBoxEnrichment.java
|
handler/src/main/java/org/n52/sos/ds/procedure/enrich/BoundingBoxEnrichment.java
|
BoundingBoxEnrichment
|
BoundingBoxEnrichment
|
createCapabilities__(final Optional<SmlCapabilities> existing)
|
createCapabilities__(final Optional<SmlCapabilities> existing)
|
private Optional<SmlCapabilities> createCapabilities(final Optional<SmlCapabilities> existing) throws OwsExceptionReport {
final SosEnvelope sosEnv = createEnvelopeForOfferings();
if (existing.isPresent()) {
final DataRecord dataRecord = existing.get().getDataRecord();
final int i = dataRecord.getFieldIndexByIdentifier(SensorMLConstants.ELEMENT_NAME_OBSERVED_BBOX);
if (i >= 0) {
final SweAbstractDataComponent e = dataRecord.getFields().get(i).getElement();
if (e instanceof SweEnvelope) {
sosEnv.expandToInclude(((SweEnvelope) e).toSosEnvelope());
}
}
}
return createCapabilities(sosEnv);
}
|
private Optional<SmlCapabilities> createCapabilities(final Optional<SmlCapabilities> existing)
throws OwsExceptionReport {
final ReferencedEnvelope sosEnv = createEnvelopeForOfferings();
if (existing.isPresent()) {
final DataRecord dataRecord = existing.get().getDataRecord();
final int i = dataRecord.getFieldIndexByIdentifier(SensorMLConstants.ELEMENT_NAME_OBSERVED_BBOX);
if (i >= 0) {
final SweAbstractDataComponent e = dataRecord.getFields().get(i).getElement();
if (e instanceof SweEnvelope) {
sosEnv.expandToInclude(((SweEnvelope) e).toReferencedEnvelope());
}
}
}
return createCapabilities(sosEnv);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/enrich/BoundingBoxEnrichment.java
|
handler/src/main/java/org/n52/sos/ds/procedure/enrich/BoundingBoxEnrichment.java
|
BoundingBoxEnrichment
|
BoundingBoxEnrichment
|
createEnvelopeForOfferings__()
|
createEnvelopeForOfferings__()
|
protected SosEnvelope createEnvelopeForOfferings() throws CodedException {
final SosEnvelope mergedEnvelope = new SosEnvelope();
for (final SosOffering offering : getSosOfferings()) {
mergedEnvelope.expandToInclude(getEnvelope(offering));
}
return mergedEnvelope.setSrid(GeometryHandler.getInstance().getStorageEPSG());
}
|
public ReferencedEnvelope createEnvelopeForOfferings()
throws CodedException {
final ReferencedEnvelope mergedEnvelope = new ReferencedEnvelope();
for (final SosOffering offering : getSosOfferings()) {
mergedEnvelope.expandToInclude(getEnvelope(offering));
}
return mergedEnvelope.setSrid(getProcedureCreationContext().getGeometryHandler().getStorageEPSG());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/enrich/BoundingBoxEnrichment.java
|
handler/src/main/java/org/n52/sos/ds/procedure/enrich/BoundingBoxEnrichment.java
|
BoundingBoxEnrichment
|
BoundingBoxEnrichment
|
getEnvelope__(final SosOffering offering)
|
getEnvelope__(final SosOffering offering)
|
private SosEnvelope getEnvelope(final SosOffering offering) {
return getCache().getEnvelopeForOffering(offering.getIdentifier());
}
|
private ReferencedEnvelope getEnvelope(final SosOffering offering) {
return getCache().getEnvelopeForOffering(offering.getIdentifier());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/enrich/BoundingBoxEnrichment.java
|
handler/src/main/java/org/n52/sos/ds/procedure/enrich/BoundingBoxEnrichment.java
|
BoundingBoxEnrichment
|
BoundingBoxEnrichment
|
createCapabilities__(final SosEnvelope bbox)
|
createCapabilities__(final ReferencedEnvelope bbox)
|
private Optional<SmlCapabilities> createCapabilities(final SosEnvelope bbox) {
if (bbox.isSetEnvelope()) {
// add merged bbox to capabilities as swe:envelope
final SweEnvelope envelope = new SweEnvelope(bbox, procedureSettings().getLatLongUom());
envelope.setDefinition(SensorMLConstants.OBSERVED_BBOX_DEFINITION_URN);
final SweField field = new SweField(SensorMLConstants.ELEMENT_NAME_OBSERVED_BBOX, envelope);
return Optional.of(new SmlCapabilities()
.setName(SensorMLConstants.ELEMENT_NAME_OBSERVED_BBOX)
.setDataRecord(new SweDataRecord().addField(field)));
} else {
return Optional.absent();
}
}
|
private Optional<SmlCapabilities> createCapabilities(final ReferencedEnvelope bbox) throws CodedException {
if (bbox.isSetEnvelope()) {
// add merged bbox to capabilities as swe:envelope
final SweEnvelope envelope = new SweEnvelope(bbox, procedureSettings().getLatLongUom(),
getProcedureCreationContext().getGeometryHandler().isNorthingFirstEpsgCode(bbox.getSrid()));
envelope.setDefinition(SensorMLConstants.OBSERVED_BBOX_DEFINITION_URN);
final SweField field = new SweField(SensorMLConstants.ELEMENT_NAME_OBSERVED_BBOX, envelope);
return Optional.of(new SmlCapabilities().setName(SensorMLConstants.ELEMENT_NAME_OBSERVED_BBOX)
.setDataRecord(new SweDataRecord().addField(field)));
} else {
return Optional.empty();
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
SosDescribeSensorOperatorV20
|
SosDescribeSensorOperatorV20
|
SosDescribeSensorOperatorV20__()
|
SosDescribeSensorOperatorV20__()
|
public SosDescribeSensorOperatorV20() {
super(OPERATION_NAME, DescribeSensorRequest.class);
}
|
public SosDescribeSensorOperatorV20() {
super(OPERATION_NAME, DescribeSensorRequest.class);
postProcessor = new PostProcessor();
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
SosDescribeSensorOperatorV20
|
SosDescribeSensorOperatorV20
|
getConformanceClasses__(String service, String version)
|
getConformanceClasses__(String service, String version)
|
@Override
public Set<String> getConformanceClasses(String service, String version) {
if(SosConstants.SOS.equals(service) && Sos2Constants.SERVICEVERSION.equals(version)) {
return Collections.unmodifiableSet(CONFORMANCE_CLASSES);
}
return Collections.emptySet();
}
|
@Override
public Set<String> getConformanceClasses(String service, String version) {
if (SosConstants.SOS.equals(service) && Sos2Constants.SERVICEVERSION.equals(version)) {
return Collections.unmodifiableSet(CONFORMANCE_CLASSES);
}
return Collections.emptySet();
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
SosDescribeSensorOperatorV20
|
SosDescribeSensorOperatorV20
|
receive__(DescribeSensorRequest request)
|
receive__(DescribeSensorRequest request)
|
@Override
public DescribeSensorResponse receive(DescribeSensorRequest request) throws OwsExceptionReport {
return getDao().getSensorDescription(request);
// TODO check if sensor description position/location/observedArea should be transformed (CRS support)
}
|
@Override
public DescribeSensorResponse receive(DescribeSensorRequest request) throws OwsExceptionReport {
return getOperationHandler().getSensorDescription(request);
// TODO check if sensor description position/location/observedArea
// should be transformed (CRS support)
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
SosDescribeSensorOperatorV20
|
SosDescribeSensorOperatorV20
|
checkParameters__(DescribeSensorRequest sosRequest)
|
checkParameters__(DescribeSensorRequest sosRequest)
|
@Override
protected void checkParameters(DescribeSensorRequest sosRequest) throws OwsExceptionReport {
CompositeOwsException exceptions = new CompositeOwsException();
try {
checkServiceParameter(sosRequest.getService());
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
try {
checkSingleVersionParameter(sosRequest);
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
try {
checkProcedureID(sosRequest.getProcedure(), SosConstants.DescribeSensorParams.procedure.name());
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
try {
checkProcedureDescriptionFromat(sosRequest.getProcedureDescriptionFormat(), sosRequest);
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
// if (sosRequest.isSetValidTime()) {
// exceptions.add(new
// OptionNotSupportedException().at(Sos2Constants.DescribeSensorParams.validTime)
// .withMessage("The requested parameter is not supported by this server!"));
// }
checkExtensions(sosRequest, exceptions);
exceptions.throwIfNotEmpty();
}
|
@Override
protected void checkParameters(DescribeSensorRequest sosRequest) throws OwsExceptionReport {
CompositeOwsException exceptions = new CompositeOwsException();
try {
checkServiceParameter(sosRequest.getService());
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
try {
checkSingleVersionParameter(sosRequest);
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
try {
checkProcedure(sosRequest.getProcedure(), SosConstants.DescribeSensorParams.procedure.name());
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
try {
checkProcedureDescriptionFromat(sosRequest.getProcedureDescriptionFormat(), sosRequest);
} catch (OwsExceptionReport owse) {
exceptions.add(owse);
}
// if (sosRequest.isSetValidTime()) {
// exceptions.add(new
// OptionNotSupportedException().at(Sos2Constants.DescribeSensorParams.validTime)
// .withMessage("The requested parameter is not supported by this
// server!"));
// }
checkExtensions(sosRequest, exceptions);
exceptions.throwIfNotEmpty();
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
operations/core-v20/src/main/java/org/n52/sos/request/operator/SosDescribeSensorOperatorV20.java
|
SosDescribeSensorOperatorV20
|
SosDescribeSensorOperatorV20
|
checkProcedureDescriptionFromat__(String procedureDescriptionFormat, DescribeSensorRequest sosRequest)
|
checkProcedureDescriptionFromat__(String procedureDescriptionFormat, DescribeSensorRequest sosRequest)
|
private void checkProcedureDescriptionFromat(String procedureDescriptionFormat, DescribeSensorRequest sosRequest) throws MissingParameterValueException, OwsExceptionReport {
if (!checkOnlyRequestableProcedureDescriptionFromats(sosRequest.getProcedureDescriptionFormat(), Sos2Constants.DescribeSensorParams.procedureDescriptionFormat)) {
SosHelper.checkProcedureDescriptionFormat(sosRequest.getProcedureDescriptionFormat(),
sosRequest.getService(), sosRequest.getVersion());
}
}
|
private void checkProcedureDescriptionFromat(String procedureDescriptionFormat, DescribeSensorRequest sosRequest)
throws MissingParameterValueException, OwsExceptionReport {
if (!checkOnlyRequestableProcedureDescriptionFromats(sosRequest.getProcedureDescriptionFormat(),
Sos2Constants.DescribeSensorParams.procedureDescriptionFormat, false)) {
checkProcedureDescriptionFormat(sosRequest.getProcedureDescriptionFormat(), sosRequest.getService(),
sosRequest.getVersion());
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
GetObservationKvpDecoderv100Test
|
GetObservationKvpDecoderv100Test
|
setUp__()
|
setUp__()
|
@Before
public void setUp() {
this.decoder = new GetObservationKvpDecoderv100();
}
|
@Before
public void setUp() {
this.decoder = new GetObservationKvpDecoderv100();
this.decoder.setSrsUrlNamePrefix(OGCConstants.URN_DEF_CRS_EPSG);
this.decoder.setSrsUrnNamePrefix(OGCConstants.URL_DEF_CRS_EPSG);
this.decoder.setStorageEPSG(EPSG_WGS84);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
GetObservationKvpDecoderv100Test
|
GetObservationKvpDecoderv100Test
|
basic__()
|
basic__()
|
@Test
public void basic() throws OwsExceptionReport {
GetObservationRequest req =
decoder.decode(createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE,
OBSERVED_PROPERTY, RESPONSE_FORMAT));
assertThat(req, is(notNullValue()));
assertThat(req.getOperationName(), is(SosConstants.Operations.GetObservation.name()));
assertThat(req.getService(), is(SosConstants.SOS));
assertThat(req.getVersion(), is(Sos1Constants.SERVICEVERSION));
assertThat(req.getOfferings().size(), is(1));
assertThat(req.getOfferings().get(0), is(OFFERING));
assertThat(req.getProcedures().size(), is(1));
assertThat(req.getProcedures().get(0), is(PROCEDURE));
assertThat(req.getObservedProperties().size(), is(1));
assertThat(req.getObservedProperties().get(0), is(OBSERVED_PROPERTY));
assertThat(MediaType.parse(req.getResponseFormat()), is(MediaType.parse(RESPONSE_FORMAT)));
}
|
@Test
public void basic() throws DecodingException {
GetObservationRequest req =
decoder.decode(createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE,
OBSERVED_PROPERTY, RESPONSE_FORMAT));
Assert.assertThat(req, CoreMatchers.is(CoreMatchers.notNullValue()));
Assert.assertThat(req.getOperationName(), CoreMatchers.is(SosConstants.Operations.GetObservation.name()));
Assert.assertThat(req.getService(), CoreMatchers.is(SosConstants.SOS));
Assert.assertThat(req.getVersion(), CoreMatchers.is(Sos1Constants.SERVICEVERSION));
Assert.assertThat(req.getOfferings().size(), CoreMatchers.is(1));
Assert.assertThat(req.getOfferings().get(0), CoreMatchers.is(OFFERING));
Assert.assertThat(req.getProcedures().size(), CoreMatchers.is(1));
Assert.assertThat(req.getProcedures().get(0), CoreMatchers.is(PROCEDURE));
Assert.assertThat(req.getObservedProperties().size(), CoreMatchers.is(1));
Assert.assertThat(req.getObservedProperties().get(0), CoreMatchers.is(OBSERVED_PROPERTY));
Assert.assertThat(MediaType.parse(req.getResponseFormat()), CoreMatchers.is(MediaType.parse(RESPONSE_FORMAT)));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
GetObservationKvpDecoderv100Test
|
GetObservationKvpDecoderv100Test
|
eventTime__()
|
eventTime__()
|
@Test
public void eventTime() throws OwsExceptionReport {
Map<String, String> map =
createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE, OBSERVED_PROPERTY,
RESPONSE_FORMAT);
map.put(Sos1Constants.GetObservationParams.eventTime.name(), EVENT_TIME);
GetObservationRequest req = decoder.decode(map);
assertThat(req.getTemporalFilters().size(), is(1));
TemporalFilter temporalFilter = req.getTemporalFilters().get(0);
assertThat(temporalFilter.getTime(), instanceOf(TimePeriod.class));
TimePeriod timePeriod = (TimePeriod) temporalFilter.getTime();
assertThat(timePeriod.getStart().getMillis(), is(new DateTime(START_TIME).getMillis()));
assertThat(timePeriod.getEnd().getMillis(), is(new DateTime(END_TIME).plusMillis(999).getMillis()));
assertThat(timePeriod.getStartIndet(), nullValue());
assertThat(timePeriod.getEndIndet(), nullValue());
}
|
@Test
public void eventTime() throws DecodingException {
Map<String, String> map =
createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE, OBSERVED_PROPERTY,
RESPONSE_FORMAT);
map.put(Sos1Constants.GetObservationParams.eventTime.name(), EVENT_TIME);
GetObservationRequest req = decoder.decode(map);
Assert.assertThat(req.getTemporalFilters().size(), CoreMatchers.is(1));
TemporalFilter temporalFilter = req.getTemporalFilters().get(0);
Assert.assertThat(temporalFilter.getTime(), CoreMatchers.instanceOf(TimePeriod.class));
TimePeriod timePeriod = (TimePeriod) temporalFilter.getTime();
Assert.assertThat(timePeriod.getStart().getMillis(), CoreMatchers.is(new DateTime(START_TIME).getMillis()));
Assert.assertThat(timePeriod.getEnd().getMillis(),
CoreMatchers.is(new DateTime(END_TIME).plusMillis(999).getMillis()));
Assert.assertThat(timePeriod.getStartIndet(), CoreMatchers.nullValue());
Assert.assertThat(timePeriod.getEndIndet(), CoreMatchers.nullValue());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
GetObservationKvpDecoderv100Test
|
GetObservationKvpDecoderv100Test
|
missingResponse__()
|
missingResponse__()
|
@Test(expected = OwsExceptionReport.class)
public void missingResponse() throws OwsExceptionReport {
decoder.decode(createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE,
OBSERVED_PROPERTY, EMPTY_STRING));
}
|
@Test(expected = DecodingException.class)
public void missingResponse() throws DecodingException {
decoder.decode(createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE,
OBSERVED_PROPERTY, EMPTY_STRING));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
GetObservationKvpDecoderv100Test
|
GetObservationKvpDecoderv100Test
|
additionalParameter__()
|
additionalParameter__()
|
@Test(expected = OwsExceptionReport.class)
public void additionalParameter() throws OwsExceptionReport {
final Map<String, String> map =
createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE, OBSERVED_PROPERTY,
RESPONSE_FORMAT);
map.put(ADDITIONAL_PARAMETER, ADDITIONAL_PARAMETER);
decoder.decode(map);
}
|
@Test(expected = DecodingException.class)
public void additionalParameter() throws DecodingException {
final Map<String, String> map =
createMap(SosConstants.SOS, Sos1Constants.SERVICEVERSION, OFFERING, PROCEDURE, OBSERVED_PROPERTY,
RESPONSE_FORMAT);
map.put(ADDITIONAL_PARAMETER, ADDITIONAL_PARAMETER);
decoder.decode(map);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
coding/kvp/src/test/java/org/n52/sos/decode/kvp/v1/GetObservationKvpDecoderv100Test.java
|
GetObservationKvpDecoderv100Test
|
GetObservationKvpDecoderv100Test
|
createMap__(String service, String version, String offering, String procedure,
String observedProperty, String responseFormat)
|
createMap__(String service, String version, String offering,
String procedure, String observedProperty, String responseFormat)
|
private Map<String, String> createMap(String service, String version, String offering, String procedure,
String observedProperty, String responseFormat) {
Map<String, String> map = new HashMap<String, String>(1);
map.put(RequestParams.service.name(), service);
map.put(RequestParams.request.name(), SosConstants.Operations.DescribeSensor.name());
map.put(RequestParams.version.name(), version);
map.put(SosConstants.GetObservationParams.offering.name(), offering);
map.put(SosConstants.GetObservationParams.procedure.name(), procedure);
map.put(SosConstants.GetObservationParams.observedProperty.name(), observedProperty);
map.put(SosConstants.GetObservationParams.responseFormat.name(), responseFormat);
return map;
}
|
private Map<String, String> createMap(String service, String version, String offering,
String procedure, String observedProperty, String responseFormat) {
Map<String, String> map = new HashMap<>(7);
map.put(RequestParams.service.name(), service);
map.put(RequestParams.request.name(), SosConstants.Operations.GetObservation.name());
map.put(RequestParams.version.name(), version);
map.put(SosConstants.GetObservationParams.offering.name(), offering);
map.put(SosConstants.GetObservationParams.procedure.name(), procedure);
map.put(SosConstants.GetObservationParams.observedProperty.name(), observedProperty);
map.put(SosConstants.GetObservationParams.responseFormat.name(), responseFormat);
return map;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/netcdf/coding/src/main/java/org/n52/sos/encode/NetcdfEncoder.java
|
coding/netcdf/coding/src/main/java/org/n52/sos/encode/NetcdfEncoder.java
|
NetcdfEncoder
|
NetcdfEncoder
|
encodeNetCDFObsToNetcdf__(List<NetCDFObservation> netCDFObsList, Version version)
|
encodeNetCDFObsToNetcdf__(List<NetCDFObservation> netCDFObsList, Version version)
|
protected BinaryAttachmentResponse encodeNetCDFObsToNetcdf(List<NetCDFObservation> netCDFObsList, Version version) throws OwsExceptionReport {
if (CollectionHelper.isEmpty(netCDFObsList)) {
throw new NoApplicableCodeException().withMessage("No feature types to encode");
} else if (netCDFObsList.size() > 1) {
throwTooManyFeatureTypesOrSensorsException(netCDFObsList, netCDFObsList.size(), null);
}
NetCDFObservation netCDFObservation = netCDFObsList.get(0);
if (CollectionHelper.isEmpty(netCDFObservation.getSensorDatasets())) {
throw new NoApplicableCodeException().withMessage("No sensors to encode");
} else if (netCDFObservation.getSensorDatasets().size() > 1) {
throwTooManyFeatureTypesOrSensorsException(netCDFObsList, null, netCDFObservation.getSensorDatasets().size());
}
AbstractSensorDataset sensorDataset = netCDFObservation.getSensorDatasets().get(0);
File tempDir = Files.createTempDir();
String filename = getFilename(sensorDataset);
File netcdfFile = new File(tempDir, filename);
encodeSensorDataToNetcdf(netcdfFile, sensorDataset, version);
BinaryAttachmentResponse response = null;
try {
response = new BinaryAttachmentResponse(Files.toByteArray(netcdfFile), getContentType(),
String.format(filename, makeDateSafe(new DateTime(DateTimeZone.UTC))));
} catch (IOException e) {
throw new NoApplicableCodeException().causedBy(e).withMessage("Couldn't create netCDF file");
} finally {
tempDir.delete();
}
return response;
}
|
protected BinaryAttachmentResponse encodeNetCDFObsToNetcdf(List<NetCDFObservation> netCDFObsList, Version version)
throws EncodingException {
if (CollectionHelper.isEmptyOrNull(netCDFObsList)) {
throw new EncodingException("No feature types to encode");
} else if (netCDFObsList.size() > 1) {
throwTooManyFeatureTypesOrSensorsException(netCDFObsList, netCDFObsList.size(), null);
}
NetCDFObservation netCDFObservation = netCDFObsList.get(0);
if (CollectionHelper.isEmpty(netCDFObservation.getSensorDatasets())) {
throw new EncodingException("No sensors to encode");
} else if (netCDFObservation.getSensorDatasets().size() > 1) {
throwTooManyFeatureTypesOrSensorsException(netCDFObsList, null,
netCDFObservation.getSensorDatasets().size());
}
AbstractSensorDataset sensorDataset = netCDFObservation.getSensorDatasets().get(0);
File tempDir = Files.createTempDir();
String filename = getFilename(sensorDataset);
File netcdfFile = new File(tempDir, filename);
try {
encodeSensorDataToNetcdf(netcdfFile, sensorDataset, version);
return new BinaryAttachmentResponse(Files.toByteArray(netcdfFile), getContentType(),
String.format(filename, makeDateSafe(new DateTime(DateTimeZone.UTC))));
} catch (IOException e) {
throw new EncodingException("Couldn't create netCDF file", e);
} finally {
LOGGER.debug("Temporary file deleted: {}", tempDir.delete());
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
coding/netcdf/coding/src/main/java/org/n52/sos/encode/NetcdfEncoder.java
|
coding/netcdf/coding/src/main/java/org/n52/sos/encode/NetcdfEncoder.java
|
NetcdfEncoder
|
NetcdfEncoder
|
throwTooManyFeatureTypesOrSensorsException__(List<NetCDFObservation> netCDFObsList,
Integer numFeatureTypes, Integer numSensors)
|
throwTooManyFeatureTypesOrSensorsException__(List<NetCDFObservation> netCDFObsList,
Integer numFeatureTypes, Integer numSensors)
|
private void throwTooManyFeatureTypesOrSensorsException(List<NetCDFObservation> netCDFObsList,
Integer numFeatureTypes, Integer numSensors) throws CodedException {
StringBuilder sb = new StringBuilder();
sb.append("This encoder (" + NetcdfConstants.CONTENT_TYPE_NETCDF.toString() + ") can only encode a single feature type");
if (numFeatureTypes != null) {
sb.append(" (found " + numFeatureTypes + ")");
}
sb.append(" and a single sensor");
if (numSensors != null) {
sb.append(" (found " + numSensors + ")");
}
sb.append(". Change your request to only return a single feature type or use the zipped netCDF encoder ("
+ NetcdfConstants.CONTENT_TYPE_NETCDF_ZIP.toString() + ").");
throw new UnsupportedEncoderInputException(this, netCDFObsList).withMessage(sb.toString());
}
|
private void throwTooManyFeatureTypesOrSensorsException(List<NetCDFObservation> netCDFObsList,
Integer numFeatureTypes, Integer numSensors) throws EncodingException {
StringBuilder sb = new StringBuilder();
sb.append("This encoder (").append(NetcdfConstants.CONTENT_TYPE_NETCDF.toString())
.append(") can only encode a single feature type");
if (numFeatureTypes != null) {
sb.append(" (found ").append(numFeatureTypes).append(")");
}
sb.append(" and a single sensor");
if (numSensors != null) {
sb.append(" (").append("found ").append(numSensors).append(")");
}
sb.append(". Change your request to only return a single feature type or use the zipped netCDF encoder (")
.append(NetcdfConstants.CONTENT_TYPE_NETCDF_ZIP.toString()).append(").");
throw new EncodingException(sb.toString());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
AdminExtensionController
|
AdminExtensionController
|
getAll__()
|
getAll__()
|
@ResponseBody
@RequestMapping(value = ControllerConstants.Paths.ADMIN_EXTENSIONS_JSON_ENDPOINT, method = RequestMethod.GET, produces = ControllerConstants.MEDIA_TYPE_APPLICATION_JSON)
public String getAll() throws JSONException, ConnectionProviderException {
ObjectNode node = JSONUtils.nodeFactory().objectNode();
node.set(JSONConstants.EXTENDED_CAPABILITIES_EXTENSION_KEY, getExtendedCapabilitiesExtensions());
node.set(JSONConstants.OFFERING_EXTENSION_EXTENSION_KEY, getOfferingExtensionExtensions());
return JSONUtils.print(node);
}
|
@ResponseBody
@RequestMapping(value = ControllerConstants.Paths.ADMIN_EXTENSIONS_JSON_ENDPOINT,
method = RequestMethod.GET,
produces = ControllerConstants.MEDIA_TYPE_APPLICATION_JSON)
public String getAll() throws JSONException, ConnectionProviderException {
ObjectNode node = Json.nodeFactory().objectNode();
node.set(JSONConstants.EXTENDED_CAPABILITIES_EXTENSION_KEY, getExtendedCapabilitiesExtensions());
node.set(JSONConstants.OFFERING_EXTENSION_EXTENSION_KEY, getOfferingExtensionExtensions());
return Json.print(node);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
AdminExtensionController
|
AdminExtensionController
|
change__(@RequestBody String request)
|
change__(@RequestBody String request)
|
@ResponseBody
@RequestMapping(value = ControllerConstants.Paths.ADMIN_EXTENSIONS_JSON_ENDPOINT, method = RequestMethod.POST, consumes = ControllerConstants.MEDIA_TYPE_APPLICATION_JSON)
public void change(@RequestBody String request) throws JSONException, ConnectionProviderException, IOException {
JsonNode json = JSONUtils.loadString(request);
if (json.has(JSONConstants.EXTENDED_CAPABILITIES_DOMAIN_KEY)) {
ServiceOperatorKey sokt =
new ServiceOperatorKey(json.path(JSONConstants.SERVICE_KEY).asText(),
json.path(JSONConstants.VERSION_KEY).asText());
OwsExtendedCapabilitiesProviderKey oeckt = new OwsExtendedCapabilitiesProviderKey(sokt, json.path(JSONConstants.EXTENDED_CAPABILITIES_DOMAIN_KEY).asText());
if (json.path(JSONConstants.ACTIVE_KEY).asBoolean()) {
for (OwsExtendedCapabilitiesProviderKey key : owsExtendedCapabilitiesProviderRepository.getKeys()) {
if (key.getServiceOperatorKey().equals(sokt)) {
owsExtendedCapabilitiesProviderRepository.deactivate(key);
}
}
}
this.owsExtendedCapabilitiesProviderRepository.setActive(oeckt, json.path(JSONConstants.ACTIVE_KEY).asBoolean());
} else if (json.has(JSONConstants.OFFERING_EXTENSION_DOMAIN_KEY)) {
ServiceOperatorKey sokt =
new ServiceOperatorKey(json.path(JSONConstants.SERVICE_KEY).asText(),
json.path(JSONConstants.VERSION_KEY).asText());
OfferingExtensionKey oekt =
new OfferingExtensionKey(sokt,
json.path(JSONConstants.OFFERING_EXTENSION_DOMAIN_KEY).asText());
this.offeringExtensionRepository.setActive(oekt, json.path(JSONConstants.ACTIVE_KEY).asBoolean());
} else {
throw new JSONException("Invalid JSON");
}
}
|
@ResponseBody
@RequestMapping(value = ControllerConstants.Paths.ADMIN_EXTENSIONS_JSON_ENDPOINT,
method = RequestMethod.POST,
consumes = ControllerConstants.MEDIA_TYPE_APPLICATION_JSON)
public void change(@RequestBody String request) throws JSONException, ConnectionProviderException, IOException {
JsonNode json = Json.loadString(request);
if (json.has(JSONConstants.EXTENDED_CAPABILITIES_DOMAIN_KEY)) {
OwsServiceKey sokt = new OwsServiceKey(json.path(JSONConstants.SERVICE_KEY).asText(),
json.path(JSONConstants.VERSION_KEY).asText());
OwsOperationMetadataExtensionProviderKey oeckt = new OwsOperationMetadataExtensionProviderKey(sokt,
json.path(JSONConstants.EXTENDED_CAPABILITIES_DOMAIN_KEY).asText());
if (json.path(JSONConstants.ACTIVE_KEY).asBoolean()) {
for (OwsOperationMetadataExtensionProviderKey key : owsExtendedCapabilitiesProviderRepository
.getKeys()) {
if (key.getServiceOperatorKey().equals(sokt)) {
owsExtendedCapabilitiesProviderRepository.deactivate(key);
}
}
}
this.owsExtendedCapabilitiesProviderRepository.setActive(oeckt,
json.path(JSONConstants.ACTIVE_KEY).asBoolean());
} else if (json.has(JSONConstants.OFFERING_EXTENSION_DOMAIN_KEY)) {
OwsServiceKey sokt = new OwsServiceKey(json.path(JSONConstants.SERVICE_KEY).asText(),
json.path(JSONConstants.VERSION_KEY).asText());
SosObservationOfferingExtensionKey oekt = new SosObservationOfferingExtensionKey(sokt,
json.path(JSONConstants.OFFERING_EXTENSION_DOMAIN_KEY).asText());
this.offeringExtensionRepository.setActive(oekt, json.path(JSONConstants.ACTIVE_KEY).asBoolean());
} else {
throw new JSONException("Invalid JSON");
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
AdminExtensionController
|
AdminExtensionController
|
getExtendedCapabilitiesExtensions__()
|
getExtendedCapabilitiesExtensions__()
|
protected ArrayNode getExtendedCapabilitiesExtensions() throws ConnectionProviderException, ConfigurationError,
JSONException {
ArrayNode jeces = JSONUtils.nodeFactory().arrayNode();
Map<ServiceOperatorKey, Collection<String>> oes = this.owsExtendedCapabilitiesProviderRepository.getAllDomains();
for (ServiceOperatorKey sokt : oes.keySet()) {
for (String name : oes.get(sokt)) {
OwsExtendedCapabilitiesProviderKey oeckt = new OwsExtendedCapabilitiesProviderKey(sokt, name);
jeces.addObject()
.put(JSONConstants.SERVICE_KEY, oeckt.getService())
.put(JSONConstants.VERSION_KEY, oeckt.getVersion())
.put(JSONConstants.EXTENDED_CAPABILITIES_DOMAIN_KEY, oeckt.getDomain())
.put(JSONConstants.ACTIVE_KEY, this.owsExtendedCapabilitiesProviderRepository.isActive(oeckt));
}
}
return jeces;
}
|
protected ArrayNode getExtendedCapabilitiesExtensions()
throws ConnectionProviderException, ConfigurationError, JSONException {
ArrayNode jeces = Json.nodeFactory().arrayNode();
Map<OwsServiceKey, Collection<String>> oes = this.owsExtendedCapabilitiesProviderRepository.getAllDomains();
for (Entry<OwsServiceKey, Collection<String>> entry : oes.entrySet()) {
for (String name : entry.getValue()) {
OwsOperationMetadataExtensionProviderKey oeckt =
new OwsOperationMetadataExtensionProviderKey(entry.getKey(), name);
jeces.addObject().put(JSONConstants.SERVICE_KEY, oeckt.getService())
.put(JSONConstants.VERSION_KEY, oeckt.getVersion())
.put(JSONConstants.EXTENDED_CAPABILITIES_DOMAIN_KEY, oeckt.getDomain())
.put(JSONConstants.ACTIVE_KEY, this.owsExtendedCapabilitiesProviderRepository.isActive(oeckt));
}
}
return jeces;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/AdminExtensionController.java
|
AdminExtensionController
|
AdminExtensionController
|
getOfferingExtensionExtensions__()
|
getOfferingExtensionExtensions__()
|
protected ArrayNode getOfferingExtensionExtensions() throws JSONException, ConnectionProviderException,
ConfigurationError {
ArrayNode joes = JSONUtils.nodeFactory().arrayNode();
final Map<ServiceOperatorKey, Collection<String>> oes = this.offeringExtensionRepository.getAllDomains();
for (ServiceOperatorKey sokt : oes.keySet()) {
for (String name : oes.get(sokt)) {
OfferingExtensionKey oekt = new OfferingExtensionKey(sokt, name);
joes.addObject()
.put(JSONConstants.SERVICE_KEY, oekt.getService())
.put(JSONConstants.VERSION_KEY, oekt.getVersion())
.put(JSONConstants.OFFERING_EXTENSION_DOMAIN_KEY, oekt.getDomain())
.put(JSONConstants.ACTIVE_KEY, this.offeringExtensionRepository.isActive(oekt));
}
}
return joes;
}
|
protected ArrayNode getOfferingExtensionExtensions()
throws JSONException, ConnectionProviderException, ConfigurationError {
ArrayNode joes = Json.nodeFactory().arrayNode();
final Map<OwsServiceKey, Collection<String>> oes = this.offeringExtensionRepository.getAllDomains();
for (Entry<OwsServiceKey, Collection<String>> entry : oes.entrySet()) {
for (String name : entry.getValue()) {
SosObservationOfferingExtensionKey oekt = new SosObservationOfferingExtensionKey(entry.getKey(), name);
joes.addObject().put(JSONConstants.SERVICE_KEY, oekt.getService())
.put(JSONConstants.VERSION_KEY, oekt.getVersion())
.put(JSONConstants.OFFERING_EXTENSION_DOMAIN_KEY, oekt.getDomain())
.put(JSONConstants.ACTIVE_KEY, this.offeringExtensionRepository.isActive(oekt));
}
}
return joes;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/test/java/org/n52/sos/util/builder/InsertObservationRequestBuilder.java
|
core/api/src/test/java/org/n52/sos/util/builder/InsertObservationRequestBuilder.java
|
InsertObservationRequestBuilder
|
InsertObservationRequestBuilder
|
setProcedureId__(String procedureId)
|
setProcedureId__(String procedureId)
|
public InsertObservationRequestBuilder setProcedureId(String procedureId) {
this.procedureId = procedureId;
return this;
}
|
public InsertObservationRequestBuilder setProcedureId(String procedureId) {
this.procedure = procedureId;
return this;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/test/java/org/n52/sos/util/builder/InsertObservationRequestBuilder.java
|
core/api/src/test/java/org/n52/sos/util/builder/InsertObservationRequestBuilder.java
|
InsertObservationRequestBuilder
|
InsertObservationRequestBuilder
|
build__()
|
build__()
|
public InsertObservationRequest build() {
InsertObservationRequest request = new InsertObservationRequest();
request.setObservation(observations);
request.setOfferings(offerings);
request.setAssignedSensorId(procedureId);
return request;
}
|
public InsertObservationRequest build() throws OwsExceptionReport {
InsertObservationRequest request = new InsertObservationRequest();
request.setObservation(observations);
request.setOfferings(offerings);
request.setAssignedSensorId(procedure);
return request;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
EReportingSamplingPointDAO
|
EReportingSamplingPointDAO
|
getDefaultCriteria__(Session session)
|
getDefaultCriteria__(Session session)
|
public Criteria getDefaultCriteria(Session session) {
return session.createCriteria(EReportingSamplingPoint.class).setResultTransformer(
Criteria.DISTINCT_ROOT_ENTITY);
}
|
public Criteria getDefaultCriteria(Session session) {
return session.createCriteria(EReportingSamplingPointEntity.class).setResultTransformer(
Criteria.DISTINCT_ROOT_ENTITY);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
EReportingSamplingPointDAO
|
EReportingSamplingPointDAO
|
getEReportingSamplingPoint__(long samplingPointId, Session session)
|
getEReportingSamplingPoint__(long samplingPointId, Session session)
|
public EReportingSamplingPoint getEReportingSamplingPoint(long samplingPointId, Session session) {
Criteria c = getDefaultCriteria(session);
c.add(Restrictions.eq(EReportingSamplingPoint.ID, samplingPointId));
LOGGER.debug("QUERY getEReportingSamplingPoint(samplingPointId): {}", HibernateHelper.getSqlString(c));
return (EReportingSamplingPoint) c.uniqueResult();
}
|
public EReportingSamplingPointEntity getEReportingSamplingPoint(long samplingPointId, Session session) {
Criteria c = getDefaultCriteria(session);
c.add(Restrictions.eq(EReportingSamplingPointEntity.PROPERTY_ID, samplingPointId));
LOGGER.debug("QUERY getEReportingSamplingPoint(samplingPointId): {}", HibernateHelper.getSqlString(c));
return (EReportingSamplingPointEntity) c.uniqueResult();
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
EReportingSamplingPointDAO
|
EReportingSamplingPointDAO
|
getEReportingSamplingPoint__(String identifier, Session session)
|
getEReportingSamplingPoint__(String identifier, Session session)
|
public EReportingSamplingPoint getEReportingSamplingPoint(String identifier, Session session) {
Criteria c = getDefaultCriteria(session);
c.add(Restrictions.eq(EReportingSamplingPoint.IDENTIFIER, identifier));
LOGGER.debug("QUERY getEReportingSamplingPoint(identifier): {}", HibernateHelper.getSqlString(c));
return (EReportingSamplingPoint) c.uniqueResult();
}
|
public EReportingSamplingPointEntity getEReportingSamplingPoint(String identifier, Session session) {
Criteria c = getDefaultCriteria(session);
c.add(Restrictions.eq(EReportingSamplingPointEntity.PROPERTY_IDENTIFIER, identifier));
LOGGER.debug("QUERY getEReportingSamplingPoint(identifier): {}", HibernateHelper.getSqlString(c));
return (EReportingSamplingPointEntity) c.uniqueResult();
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ereporting/EReportingSamplingPointDAO.java
|
EReportingSamplingPointDAO
|
EReportingSamplingPointDAO
|
getOrInsert__(AqdSamplingPoint samplingPoint, Session session)
|
getOrInsert__(AqdSamplingPoint samplingPoint, Session session)
|
public EReportingSamplingPoint getOrInsert(AqdSamplingPoint samplingPoint, Session session) {
Criteria c = getDefaultCriteria(session);
c.add(Restrictions.eq(EReportingSamplingPoint.IDENTIFIER, samplingPoint.getIdentifier()));
LOGGER.debug("QUERY getOrIntert(samplingPoint): {}", HibernateHelper.getSqlString(c));
EReportingSamplingPoint eReportingSamplingPoint = (EReportingSamplingPoint) c.uniqueResult();
if (eReportingSamplingPoint == null) {
eReportingSamplingPoint = new EReportingSamplingPoint();
addIdentifierNameDescription(samplingPoint, eReportingSamplingPoint, session);
eReportingSamplingPoint.setAssessmentType(new EReportingAssessmentTypeDAO().getOrInsert(
samplingPoint.getAssessmentType(), session));
session.save(eReportingSamplingPoint);
session.flush();
session.refresh(eReportingSamplingPoint);
}
return eReportingSamplingPoint;
}
|
public EReportingSamplingPointEntity getOrInsert(AqdSamplingPoint samplingPoint, Session session) {
Criteria c = getDefaultCriteria(session);
c.add(Restrictions.eq(EReportingSamplingPointEntity.PROPERTY_IDENTIFIER, samplingPoint.getIdentifier()));
LOGGER.debug("QUERY getOrIntert(samplingPoint): {}", HibernateHelper.getSqlString(c));
EReportingSamplingPointEntity eReportingSamplingPoint = (EReportingSamplingPointEntity) c.uniqueResult();
if (eReportingSamplingPoint == null) {
eReportingSamplingPoint = new EReportingSamplingPointEntity();
addIdentifierNameDescription(samplingPoint, eReportingSamplingPoint, session);
if (samplingPoint.hasAssessmentType()) {
eReportingSamplingPoint.setAssessmentType(new EReportingAssessmentTypeDAO().getOrInsert(
samplingPoint.getAssessmentType(), session));
} else {
eReportingSamplingPoint.setAssessmentType(new EReportingAssessmentTypeDAO().getOrInsert(
AssessmentType.Fixed, session));
}
session.save(eReportingSamplingPoint);
session.flush();
session.refresh(eReportingSamplingPoint);
}
return eReportingSamplingPoint;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator__(Collection<? extends Observation<?>> observations,
AbstractObservationRequest request, LocalizedProducer<OwsServiceProvider> serviceProvider,
Locale language, Session session)
|
ObservationOmObservationCreator__(Collection<? extends DataEntity<?>> observations,
AbstractObservationRequest request, Locale i18n, String pdf, OmObservationCreatorContext creatorContext,
Session session)
|
public ObservationOmObservationCreator(Collection<? extends Observation<?>> observations,
AbstractObservationRequest request, LocalizedProducer<OwsServiceProvider> serviceProvider,
Locale language, Session session) {
super(request, language, serviceProvider, session);
this.request = request;
if (observations == null) {
this.observations = Collections.emptyList();
} else {
this.observations = observations;
}
}
|
public ObservationOmObservationCreator(Collection<? extends DataEntity<?>> observations,
AbstractObservationRequest request, Locale i18n, String pdf, OmObservationCreatorContext creatorContext,
Session session) {
super(request, i18n, pdf, creatorContext, session);
this.request = request;
if (observations == null) {
this.observations = Collections.emptyList();
} else {
this.observations = observations;
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
getObservations__()
|
getObservations__()
|
private Collection<? extends Observation<?>> getObservations() {
return observations;
}
|
private Collection<? extends DataEntity<?>> getObservations() {
return observations;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
getProcedure__(String procedureId)
|
getProcedure__(String procedureId)
|
private SosProcedureDescription getProcedure(String procedureId) {
return procedures.get(procedureId);
}
|
private AbstractFeature getProcedure(String procedureId) {
return procedures.get(procedureId);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
create__()
|
create__()
|
@Override
public List<OmObservation> create() throws OwsExceptionReport, ConverterException {
if (getObservations() == null) {
return Collections.emptyList();
} else if (this.observationCollection == null) {
this.observationCollection = Lists.newLinkedList();
// now iterate over resultset and create Measurement for each row
for (Observation<?> hObservation : getObservations()) {
// // check remaining heap size and throw exception if minimum is
// // reached
// SosHelper.checkFreeMemory();
//
// String procedureId = createProcedure(hObservation);
// String featureId = createFeatureOfInterest(hObservation);
// String phenomenonId = createPhenomenon(hObservation);
// // TODO: add offering ids to response if needed later.
// // String offeringID =
// // hoc.getOffering().getIdentifier();
// // String mimeType = SosConstants.PARAMETER_NOT_SET;
observationCollection.add(createObservation(hObservation));
}
}
return this.observationCollection;
}
|
@Override
public ObservationStream create() throws OwsExceptionReport, ConverterException {
if (getObservations() == null) {
return ObservationStream.empty();
} else if (this.observationCollection == null) {
this.observationCollection = Lists.newLinkedList();
// now iterate over resultset and create Measurement for each row
for (DataEntity<?> hObservation : getObservations()) {
// // check remaining heap size and throw exception if minimum
// is
// // reached
// SosHelper.checkFreeMemory();
//
// String procedureId = createProcedure(hObservation);
// String featureId = createFeatureOfInterest(hObservation);
// String phenomenonId = createPhenomenon(hObservation);
// // TODO: add offering ids to response if needed later.
// // String offeringID =
// // hoc.getOffering().getIdentifier();
// // String mimeType = SosConstants.PARAMETER_NOT_SET;
observationCollection.add(createObservation(hObservation));
}
}
return ObservationStream.of(this.observationCollection);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
createObservation__(Observation<?> hObservation)
|
createObservation__(DataEntity<?> hObservation)
|
protected OmObservation createObservation(Observation<?> hObservation) throws OwsExceptionReport, ConverterException {
LOGGER.trace("Creating Observation...");
SosHelper.checkFreeMemory();
String procedureId = createProcedure(hObservation);
String featureId = createFeatureOfInterest(hObservation);
String phenomenonId = createPhenomenon(hObservation);
final Value<?> value = hObservation.accept(new ObservationValueCreator());
OmObservation sosObservation = null;
if (value != null) {
// TODO delete, set in ObservationValueCreator
// if (hObservation.getUnit() != null) {
// value.setUnit(hObservation.getUnit().getUnit());
// }
checkOrSetObservablePropertyUnit(getObservedProperty(phenomenonId), value.getUnit());
OmObservationConstellation obsConst =
createObservationConstellation(hObservation, procedureId, phenomenonId, featureId);
sosObservation = createNewObservation(obsConst, hObservation, value);
// add SpatialFilteringProfile
if (hObservation.hasSamplingGeometry()) {
sosObservation.addParameter(createSpatialFilteringProfileParameter(hObservation.getSamplingGeometry()));
}
addParameter(sosObservation, hObservation);
checkForAdditionalObservationCreator(hObservation, sosObservation);
// TODO check for ScrollableResult vs
// setFetchSize/setMaxResult
// + setFirstResult
}
getSession().evict(hObservation);
LOGGER.trace("Creating Observation done.");
return sosObservation;
}
|
protected OmObservation createObservation(DataEntity<?> hObservation)
throws OwsExceptionReport, ConverterException {
long start = System.currentTimeMillis();
LOGGER.trace("Creating Observation...");
SosHelper.checkFreeMemory();
String procedureId = createProcedure(hObservation);
String featureId = createFeatureOfInterest(hObservation);
String phenomenonId = createPhenomenon(hObservation);
Set<String> offerings = createOfferingSet(hObservation, procedureId, phenomenonId);
final Value<?> value =
new ObservationValueCreator(getCreatorContext().getDecoderRepository()).visit(hObservation);
OmObservation sosObservation = null;
if (value != null) {
value.setUnit(queryUnit(hObservation.getDataset()));
checkOrSetObservablePropertyUnit(getObservedProperty(phenomenonId), value.getUnit());
OmObservationConstellation obsConst =
createObservationConstellation(hObservation, procedureId, phenomenonId, featureId, offerings);
sosObservation = createNewObservation(obsConst, hObservation, value);
// add SpatialFilteringProfile
if (hObservation.isSetGeometryEntity()) {
sosObservation.addSpatialFilteringProfileParameter(getGeometryHandler()
.switchCoordinateAxisFromToDatasourceIfNeeded(hObservation.getGeometryEntity().getGeometry()));
}
addRelatedObservations(sosObservation, hObservation);
addParameter(sosObservation, hObservation);
checkForAdditionalObservationCreator(hObservation, sosObservation);
// TODO check for ScrollableResult vs
// setFetchSize/setMaxResult
// + setFirstResult
}
getSession().evict(hObservation);
LOGGER.trace("Creating Observation done in {} ms.", System.currentTimeMillis() - start);
return sosObservation;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
createNewObservation__(OmObservationConstellation oc, Observation<?> ho, Value<?> value)
|
createNewObservation__(OmObservationConstellation oc, DataEntity<?> ho, Value<?> value)
|
@SuppressWarnings({ "unchecked", "rawtypes" })
private OmObservation createNewObservation(OmObservationConstellation oc, Observation<?> ho, Value<?> value) {
final OmObservation o = new OmObservation();
o.setObservationID(Long.toString(ho.getObservationId()));
if (ho.isSetIdentifier() && !ho.getIdentifier().startsWith(SosConstants.GENERATED_IDENTIFIER_PREFIX)) {
final CodeWithAuthority identifier = new CodeWithAuthority(ho.getIdentifier());
if (ho.isSetCodespace()) {
identifier.setCodeSpace(ho.getCodespace().getCodespace());
}
o.setIdentifier(identifier);
}
if (ho.isSetDescription()) {
o.setDescription(ho.getDescription());
}
o.setNoDataValue(getActiveProfile().getResponseNoDataPlaceholder());
o.setTokenSeparator(getTokenSeparator());
o.setTupleSeparator(getTupleSeparator());
o.setDecimalSeparator(getDecimalSeparator());
o.setObservationConstellation(oc);
o.setResultTime(new TimeInstant(new DateTime(ho.getResultTime(), DateTimeZone.UTC)));
if (ho.getValidTimeStart() != null || ho.getValidTimeEnd() != null) {
o.setValidTime(new TimePeriod(new DateTime(ho.getValidTimeStart(), DateTimeZone.UTC),
new DateTime(ho.getValidTimeEnd(), DateTimeZone.UTC)));
}
o.setValue(new SingleObservationValue(getPhenomenonTime(ho), value));
return o;
}
|
@SuppressWarnings({ "unchecked", "rawtypes" })
private OmObservation createNewObservation(OmObservationConstellation oc, DataEntity<?> ho, Value<?> value) {
final OmObservation o = new OmObservation();
o.setObservationID(Long.toString(ho.getId()));
if (ho.isSetIdentifier() && !ho.getIdentifier().startsWith(SosConstants.GENERATED_IDENTIFIER_PREFIX)) {
final CodeWithAuthority identifier = new CodeWithAuthority(ho.getIdentifier());
if (ho.isSetIdentifierCodespace()) {
identifier.setCodeSpace(ho.getIdentifierCodespace().getName());
}
o.setIdentifier(identifier);
}
if (ho.isSetDescription()) {
o.setDescription(ho.getDescription());
}
o.setObservationConstellation(oc);
addDefaultValuesToObservation(o);
o.setResultTime(new TimeInstant(new DateTime(ho.getResultTime(), DateTimeZone.UTC)));
if (ho.getValidTimeStart() != null || ho.getValidTimeEnd() != null) {
o.setValidTime(new TimePeriod(new DateTime(ho.getValidTimeStart(), DateTimeZone.UTC),
new DateTime(ho.getValidTimeEnd(), DateTimeZone.UTC)));
}
o.setValue(new SingleObservationValue(getPhenomenonTime(ho), value));
return o;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
createProcedure__(final Observation<?> hObservation)
|
createProcedure__(final DataEntity<?> hObservation)
|
private String createProcedure(final Observation<?> hObservation) throws OwsExceptionReport,
ConverterException {
// TODO sfp full description
LOGGER.trace("Creating Procedure...");
final String procedureId = hObservation.getProcedure().getIdentifier();
if (!procedures.containsKey(procedureId)) {
final SosProcedureDescription procedure = createProcedure(procedureId);
procedures.put(procedureId, procedure);
}
LOGGER.trace("Creating Procedure done.");
return procedureId;
}
|
private String createProcedure(final DataEntity<?> hObservation) throws OwsExceptionReport, ConverterException {
// TODO sfp full description
long start = System.currentTimeMillis();
LOGGER.trace("Creating Procedure...");
final String procedureId = hObservation.getDataset().getProcedure().getIdentifier();
if (!procedures.containsKey(procedureId)) {
final SosProcedureDescription<?> procedure = createProcedure(hObservation.getDataset().getProcedure());
procedures.put(procedureId, procedure);
}
LOGGER.trace("Creating Procedure done in {} ms.", System.currentTimeMillis() - start);
return procedureId;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationOmObservationCreator.java
|
ObservationOmObservationCreator
|
ObservationOmObservationCreator
|
createFeatureOfInterest__(final Observation<?> hObservation)
|
createFeatureOfInterest__(final DataEntity<?> hObservation)
|
private String createFeatureOfInterest(final Observation<?> hObservation) throws OwsExceptionReport {
LOGGER.trace("Creating Feature...");
final String foiID = hObservation.getFeatureOfInterest().getIdentifier();
if (!features.containsKey(foiID)) {
final AbstractFeature featureByID = createFeatureOfInterest(foiID);
features.put(foiID, featureByID);
}
LOGGER.trace("Creating Feature done.");
return foiID;
}
|
private String createFeatureOfInterest(final DataEntity<?> hObservation) throws OwsExceptionReport {
long start = System.currentTimeMillis();
LOGGER.trace("Creating Feature...");
final String foiID = hObservation.getDataset().getFeature().getIdentifier();
if (!features.containsKey(foiID)) {
final AbstractFeature featureByID = createFeatureOfInterest(hObservation.getDataset().getFeature());
features.put(foiID, featureByID);
}
LOGGER.trace("Creating Feature done in {} ms.", System.currentTimeMillis() - start);
return foiID;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/test/java/org/n52/sos/util/builder/InsertResultTemplateResponseBuilder.java
|
core/api/src/test/java/org/n52/sos/util/builder/InsertResultTemplateResponseBuilder.java
|
InsertResultTemplateResponseBuilder
|
InsertResultTemplateResponseBuilder
|
build__()
|
build__()
|
public AbstractServiceResponse build() {
InsertResultTemplateResponse response = new InsertResultTemplateResponse();
response.setAcceptedTemplate(resultTemplateIdentifier);
return response;
}
|
public OwsServiceResponse build() {
InsertResultTemplateResponse response = new InsertResultTemplateResponse();
response.setAcceptedTemplate(resultTemplateIdentifier);
return response;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
AbstractMySQLDatasource
|
AbstractMySQLDatasource
|
checkSchemaCreation__(Map<String, Object> settings)
|
checkSchemaCreation__(Map<String, Object> settings)
|
@Override
public boolean checkSchemaCreation(Map<String, Object> settings) {
Connection conn = null;
Statement stmt = null;
try {
conn = openConnection(settings);
stmt = conn.createStatement();
final String schema
= (String) settings.get(createSchemaDefinition().getKey());
// mysql uses backticks (`) to quote
final String schemaPrefix
= schema == null ? "" : "`" + schema + "`.";
final String testTable = schemaPrefix + "sos_installer_test_table";
final String dropTestTable
= String.format("DROP TABLE IF EXISTS %1$s;", testTable);
final String createTestTable
= String.format("CREATE TABLE %1$s (id integer NOT NULL);", testTable);
stmt.execute(dropTestTable);
stmt.execute(createTestTable);
stmt.execute(dropTestTable);
return true;
} catch (SQLException e) {
return false;
} finally {
close(stmt);
close(conn);
}
}
|
@Override
public boolean checkSchemaCreation(Map<String, Object> settings) {
Connection conn = null;
Statement stmt = null;
try {
conn = openConnection(settings);
stmt = conn.createStatement();
final String schema = (String) settings.get(createSchemaDefinition().getKey());
// mysql uses backticks (`) to quote
final String schemaPrefix = schema == null ? "" : "`" + schema + "`.";
final String testTable = schemaPrefix + "sos_installer_test_table";
final String dropTestTable = String.format("DROP TABLE IF EXISTS %1$s;", testTable);
final String createTestTable = String.format("CREATE TABLE %1$s (id integer NOT NULL);", testTable);
stmt.execute(dropTestTable);
stmt.execute(createTestTable);
stmt.execute(dropTestTable);
return true;
} catch (SQLException e) {
return false;
} finally {
close(stmt);
close(conn);
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
AbstractMySQLDatasource
|
AbstractMySQLDatasource
|
parseURL__(String url)
|
parseURL__(String url)
|
@Override
protected String[] parseURL(String url) {
Matcher matcher = JDBC_URL_PATTERN.matcher(url);
matcher.find();
return new String[] { matcher.group(1), matcher.group(2),
matcher.group(3) };
}
|
@Override
protected String[] parseURL(String url) {
Matcher matcher = JDBC_URL_PATTERN.matcher(url);
matcher.find();
return new String[] { matcher.group(1), matcher.group(2), matcher.group(3) };
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
AbstractMySQLDatasource
|
AbstractMySQLDatasource
|
toURL__(Map<String, Object> settings)
|
toURL__(Map<String, Object> settings)
|
@Override
protected String toURL(Map<String, Object> settings) {
String url
= String.format("jdbc:mysql://%s:%d/%s", settings.get(HOST_KEY), settings.get(PORT_KEY), settings.get(DATABASE_KEY));
return url;
}
|
@Override
protected String toURL(Map<String, Object> settings) {
String url = String.format("jdbc:mysql://%s:%d/%s", settings.get(HOST_KEY), settings.get(PORT_KEY),
settings.get(DATABASE_KEY));
return url;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
AbstractMySQLDatasource
|
AbstractMySQLDatasource
|
openConnection__(Map<String, Object> settings)
|
openConnection__(Map<String, Object> settings)
|
@Override
protected Connection openConnection(Map<String, Object> settings)
throws SQLException {
try {
String jdbc = toURL(settings);
Class.forName(getDriverClass());
String pass
= (String) settings.get(HibernateConstants.CONNECTION_PASSWORD);
String user
= (String) settings.get(HibernateConstants.CONNECTION_USERNAME);
return DriverManager.getConnection(jdbc, user, pass);
} catch (ClassNotFoundException ex) {
throw new SQLException(ex);
}
}
|
@Override
protected Connection openConnection(Map<String, Object> settings) throws SQLException {
try {
String jdbc = toURL(settings);
Class.forName(getDriverClass());
String pass = (String) settings.get(HibernateConstants.CONNECTION_PASSWORD);
String user = (String) settings.get(HibernateConstants.CONNECTION_USERNAME);
precheckDriver(jdbc, user, pass);
return DriverManager.getConnection(jdbc, user, pass);
} catch (ClassNotFoundException ex) {
throw new SQLException(ex);
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
hibernate/datasource/mysql/src/main/java/org/n52/sos/ds/datasource/AbstractMySQLDatasource.java
|
AbstractMySQLDatasource
|
AbstractMySQLDatasource
|
validatePrerequisites__(Connection arg0, DatabaseMetadata arg1,
Map<String, Object> arg2)
|
validatePrerequisites__(Connection arg0, Metadata arg1, Map<String, Object> arg2)
|
@Override
protected void validatePrerequisites(Connection arg0, DatabaseMetadata arg1,
Map<String, Object> arg2) {
}
|
@Override
protected void validatePrerequisites(Connection arg0, Metadata arg1, Map<String, Object> arg2) {
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/test/java/org/n52/sos/ds/hibernate/util/TemporalRestrictionTest.java
|
hibernate/common/src/test/java/org/n52/sos/ds/hibernate/util/TemporalRestrictionTest.java
|
TemporalRestrictionTest
|
TemporalRestrictionTest
|
cleanup__()
|
cleanup__()
|
@After
public void cleanup() throws OwsExceptionReport {
Session session = null;
Transaction transaction = null;
try {
session = getSession();
transaction = session.beginTransaction();
ScrollableIterable<Observation<?>> i =
ScrollableIterable.fromCriteria(session.createCriteria(getObservationClass()));
for (Observation<?> o : i) {
session.delete(o);
}
i.close();
session.flush();
transaction.commit();
} catch (HibernateException he) {
if (transaction != null) {
transaction.rollback();
}
throw he;
} finally {
returnSession(session);
}
}
|
@After
public void cleanup() throws OwsExceptionReport {
Session session = null;
Transaction transaction = null;
try {
session = getSession();
transaction = session.beginTransaction();
Criteria criteria = session.createCriteria(getObservationClass());
try (ScrollableIterable<DataEntity<?>> iterable = ScrollableIterable.fromCriteria(criteria)) {
for (DataEntity<?> o : iterable) {
session.delete(o);
}
}
session.flush();
transaction.commit();
} catch (HibernateException he) {
if (transaction != null) {
transaction.rollback();
}
throw he;
} finally {
returnSession(session);
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/test/java/org/n52/sos/ds/hibernate/util/TemporalRestrictionTest.java
|
hibernate/common/src/test/java/org/n52/sos/ds/hibernate/util/TemporalRestrictionTest.java
|
TemporalRestrictionTest
|
TemporalRestrictionTest
|
createScenario__()
|
createScenario__()
|
@Before
public void createScenario() throws OwsExceptionReport {
Session session = getSession();
try {
this.filter = createScenario(session);
} finally {
returnSession(session);
}
}
|
@Before
public void createScenario() throws OwsExceptionReport {
Session session = getSession();
HibernateMetadataCache.init(session);
try {
this.filter = createScenario(session);
} finally {
returnSession(session);
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/test/java/org/n52/sos/ds/hibernate/util/TemporalRestrictionTest.java
|
hibernate/common/src/test/java/org/n52/sos/ds/hibernate/util/TemporalRestrictionTest.java
|
TemporalRestrictionTest
|
TemporalRestrictionTest
|
getBuilder__(Session session)
|
getBuilder__(Session session)
|
protected HibernateObservationBuilder getBuilder(Session session) throws OwsExceptionReport {
return new HibernateObservationBuilder(session);
}
|
protected HibernateObservationBuilder getBuilder(Session session) throws OwsExceptionReport {
I18NDAORepository i18NDAORepository = new I18NDAORepository();
DaoFactory daoFactory = new DaoFactory();
daoFactory.setI18NDAORepository(i18NDAORepository);
return new HibernateObservationBuilder(session, daoFactory);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/exception/ows/concrete/UnsupportedOperatorException.java
|
core/api/src/main/java/org/n52/sos/exception/ows/concrete/UnsupportedOperatorException.java
|
UnsupportedOperatorException
|
UnsupportedOperatorException
|
UnsupportedOperatorException__(SpatialOperator op)
|
UnsupportedOperatorException__(SpatialOperator op)
|
public UnsupportedOperatorException(SpatialOperator op) {
withMessage("The requested operator '%s' is not supported by this server!", op);
}
|
public UnsupportedOperatorException(SpatialOperator op) {
withMessage(MESSAGE_TEMPLATE, op);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/exception/ows/concrete/UnsupportedOperatorException.java
|
core/api/src/main/java/org/n52/sos/exception/ows/concrete/UnsupportedOperatorException.java
|
UnsupportedOperatorException
|
UnsupportedOperatorException
|
UnsupportedOperatorException__(TimeOperator op)
|
UnsupportedOperatorException__(TimeOperator op)
|
public UnsupportedOperatorException(TimeOperator op) {
withMessage("The requested operator '%s' is not supported by this server!", op);
}
|
public UnsupportedOperatorException(TimeOperator op) {
withMessage(MESSAGE_TEMPLATE, op);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/common-controller/src/main/java/org/n52/sos/web/common/ControllerUtils.java
|
spring/common-controller/src/main/java/org/n52/sos/web/common/ControllerUtils.java
|
ControllerUtils
|
ControllerUtils
|
toStringMap__(Map<E, T> enumMap)
|
toStringMap__(Map<E, T> enumMap)
|
public static <E extends Enum<E>, T> Map<String, T> toStringMap(Map<E, T> enumMap) {
Map<String, T> map = new HashMap<>(enumMap.size(), 1f);
for (E e : enumMap.keySet()) {
map.put(e.name(), enumMap.get(e));
}
return map;
}
|
public static <E extends Enum<E>, T> Map<String, T> toStringMap(Map<E, T> enumMap) {
Map<String, T> map = new HashMap<>(enumMap.size(), 1f);
for (Entry<E, T> entry : enumMap.entrySet()) {
map.put(entry.getKey().name(), enumMap.get(entry));
}
return map;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/CodespaceDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/CodespaceDAO.java
|
CodespaceDAO
|
CodespaceDAO
|
getCodespace__(final String codespace, final Session session)
|
getCodespace__(final String codespace, final Session session)
|
public Codespace getCodespace(final String codespace, final Session session) {
Criteria criteria =
session.createCriteria(Codespace.class).add(Restrictions.eq(Codespace.CODESPACE, codespace));
LOGGER.debug("QUERY getCodespace(codespace): {}", HibernateHelper.getSqlString(criteria));
return (Codespace) criteria.uniqueResult();
}
|
public CodespaceEntity getCodespace(final String codespace, final Session session) {
Criteria criteria = session.createCriteria(CodespaceEntity.class)
.add(Restrictions.eq(CodespaceEntity.PROPERTY_NAME, codespace));
LOGGER.debug("QUERY getCodespace(codespace): {}", HibernateHelper.getSqlString(criteria));
return (CodespaceEntity) criteria.uniqueResult();
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/CodespaceDAO.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/CodespaceDAO.java
|
CodespaceDAO
|
CodespaceDAO
|
getOrInsertCodespace__(final String codespace, final Session session)
|
getOrInsertCodespace__(final String codespace, final Session session)
|
public Codespace getOrInsertCodespace(final String codespace, final Session session) {
Codespace result = getCodespace(codespace, session);
if (result == null) {
result = new Codespace();
result.setCodespace(codespace);
session.save(result);
session.flush();
session.refresh(result);
}
return result;
}
|
public CodespaceEntity getOrInsertCodespace(final String codespace, final Session session) {
CodespaceEntity result = getCodespace(codespace, session);
if (result == null) {
result = new CodespaceEntity();
result.setName(codespace);
session.save(result);
session.flush();
session.refresh(result);
}
return result;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/test/java/org/n52/sos/util/builder/InsertResultTemplateRequestBuilder.java
|
core/api/src/test/java/org/n52/sos/util/builder/InsertResultTemplateRequestBuilder.java
|
InsertResultTemplateRequestBuilder
|
InsertResultTemplateRequestBuilder
|
build__()
|
build__()
|
public InsertResultTemplateRequest build() {
InsertResultTemplateRequest request = new InsertResultTemplateRequest();
if (offering != null && !offering.isEmpty()) {
request.setObservationTemplate(anObservationConstellation().addOffering(offering).build());
}
return request;
}
|
public InsertResultTemplateRequest build() {
InsertResultTemplateRequest request = new InsertResultTemplateRequest();
if (offering != null && !offering.isEmpty()) {
request.setObservationTemplate(
ObservationConstellationBuilder.anObservationConstellation().addOffering(offering).build());
}
return request;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
statistics/src/test/java/org/n52/sos/statistics/sos/handlers/requests/GetCabailitiesRequestHandlerTest.java
|
statistics/src/test/java/org/n52/sos/statistics/sos/handlers/requests/GetCabailitiesRequestHandlerTest.java
|
GetCabailitiesRequestHandlerTest
|
GetCabailitiesRequestHandlerTest
|
testAllFields__()
|
testAllFields__()
|
@SuppressWarnings("unchecked")
@Test
public void testAllFields() {
GetCapabilitiesRequest request = new GetCapabilitiesRequest("SOS");
request.setAcceptVersions(Arrays.asList("ver1","ver2"));
request.setAcceptFormats(Arrays.asList("for1","for2"));
request.setSections(Arrays.asList("a","b","c"));
request.setUpdateSequence("update-norbi");
Map<String, Object> map = handler.resolveAsMap(request);
Assert.assertEquals("update-norbi", map.get(SosDataMapping.GC_UPDATE_SEQUENCE.getName()));
Assert.assertThat((Collection<String>) map.get(SosDataMapping.GC_VERSIONS_FIELD.getName()), CoreMatchers.hasItems("ver1","ver2"));
Assert.assertThat((Collection<String>) map.get(SosDataMapping.GC_FORMATS_FIELD.getName()), CoreMatchers.hasItems("for1","for2"));
Assert.assertThat((Collection<String>) map.get(SosDataMapping.GC_SECTIONS.getName()), CoreMatchers.hasItems("a","b","c"));
}
|
@SuppressWarnings("unchecked")
@Test
public void testAllFields() {
GetCapabilitiesRequest request = new GetCapabilitiesRequest("SOS");
request.setAcceptVersions(Arrays.asList(VER_1, VER_2));
request.setAcceptFormats(Arrays.asList(FOR_1, FOR_2));
request.setSections(Arrays.asList("a", "b", "c"));
request.setUpdateSequence(UPDATE_SEQ);
Map<String, Object> map = handler.resolveAsMap(request);
Assert.assertEquals(UPDATE_SEQ, map.get(SosDataMapping.GC_UPDATE_SEQUENCE.getName()));
Assert.assertThat((Collection<String>) map.get(SosDataMapping.GC_VERSIONS_FIELD.getName()),
CoreMatchers.hasItems(VER_1, VER_2));
Assert.assertThat((Collection<String>) map.get(SosDataMapping.GC_FORMATS_FIELD.getName()),
CoreMatchers.hasItems(FOR_1, FOR_2));
Assert.assertThat((Collection<String>) map.get(SosDataMapping.GC_SECTIONS.getName()),
CoreMatchers.hasItems("a", "b", "c"));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
OfferingExtensionAjaxEndpoint
|
OfferingExtensionAjaxEndpoint
|
toJson__(final Collection<OfferingExtension> extensionsForOffering)
|
toJson__(final Collection<SosObservationOfferingExtension> extensionsForOffering)
|
private ObjectNode toJson(final Collection<OfferingExtension> extensionsForOffering) {
ObjectNode jsonOffering = JSONUtils.nodeFactory().objectNode();
if (extensionsForOffering != null) {
for (final OfferingExtension e : extensionsForOffering) {
jsonOffering.set(e.getIdentifier(), toJson(e));
}
}
return jsonOffering;
}
|
private ObjectNode toJson(final Collection<SosObservationOfferingExtension> extensionsForOffering) {
ObjectNode jsonOffering = Json.nodeFactory().objectNode();
if (extensionsForOffering != null) {
for (final SosObservationOfferingExtension e : extensionsForOffering) {
jsonOffering.set(e.getIdentifier(), toJson(e));
}
}
return jsonOffering;
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
OfferingExtensionAjaxEndpoint
|
OfferingExtensionAjaxEndpoint
|
getOfferingExtensions__()
|
getOfferingExtensions__()
|
@ResponseBody
@ResponseStatus(HttpStatus.OK)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public String getOfferingExtensions() throws OwsExceptionReport {
final Map<String, List<OfferingExtension>> offeringExtensions = getCapabilitiesExtensionService().getOfferingExtensions();
final List<String> offerings = Lists.newArrayList(getCache().getOfferings());
Collections.sort(offerings);
ObjectNode response = JSONUtils.nodeFactory().objectNode();
for (final String offering : offerings) {
response.set(offering, toJson(offeringExtensions.get(offering)));
}
return response.toString();
}
|
@ResponseBody
@ResponseStatus(HttpStatus.OK)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public String getOfferingExtensions() throws OwsExceptionReport {
final Map<String, List<SosObservationOfferingExtension>> offeringExtensions =
getCapabilitiesExtensionService().getOfferingExtensions();
final List<String> offerings = Lists.newArrayList(getCache().getOfferings());
Collections.sort(offerings);
ObjectNode response = Json.nodeFactory().objectNode();
for (final String offering : offerings) {
response.set(offering, toJson(offeringExtensions.get(offering)));
}
return response.toString();
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
OfferingExtensionAjaxEndpoint
|
OfferingExtensionAjaxEndpoint
|
checkOffering__(final String offering)
|
checkOffering__(final String offering)
|
private void checkOffering(final String offering) throws NoSuchOfferingException {
LOGGER.trace("checkOffering('{}')",offering);
LOGGER.trace("Offerings im Cache: {}",Arrays.toString(getCache().getOfferings().toArray()));
if (!getCache().getOfferings().contains(offering)) {
throw new NoSuchOfferingException(offering);
}
}
|
private void checkOffering(final String offering) throws NoSuchOfferingException {
LOGGER.trace("checkOffering('{}')", offering);
LOGGER.trace("Offerings im Cache: {}", Arrays.toString(getCache().getOfferings().toArray()));
if (!getCache().getOfferings().contains(offering)) {
throw new NoSuchOfferingException(offering);
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
OfferingExtensionAjaxEndpoint
|
OfferingExtensionAjaxEndpoint
|
saveOfferingExtension__(@RequestBody final String extensionJson)
|
saveOfferingExtension__(@RequestBody final String extensionJson)
|
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value="/save", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public void saveOfferingExtension(@RequestBody final String extensionJson)
throws XmlException, NoSuchOfferingException, OwsExceptionReport, IOException {
JsonNode request = JSONUtils.loadString(extensionJson);
final String offeringId = request.path(OFFERING).asText();
final String extensionId = request.path(IDENTIFIER).asText();
final String extensionContent = request.path(EXTENSION_PROPERTY).asText();
checkOffering(offeringId);
XmlObject.Factory.parse(extensionContent);
getCapabilitiesExtensionService().saveOfferingExtension(offeringId, extensionId, extensionContent);
}
|
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value = "/save", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public void saveOfferingExtension(@RequestBody final String extensionJson)
throws XmlException, NoSuchOfferingException, OwsExceptionReport, IOException {
JsonNode request = Json.loadString(extensionJson);
final String offeringId = request.path(OFFERING).asText();
final String extensionId = request.path(IDENTIFIER).asText();
final String extensionContent = request.path(EXTENSION_PROPERTY).asText();
checkOffering(offeringId);
XmlObject.Factory.parse(extensionContent);
getCapabilitiesExtensionService().saveOfferingExtension(offeringId, extensionId, extensionContent);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
OfferingExtensionAjaxEndpoint
|
OfferingExtensionAjaxEndpoint
|
setOfferingExtensionSettings__(
@RequestBody final String settings)
|
setOfferingExtensionSettings__(@RequestBody final String settings)
|
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value="/edit", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public void setOfferingExtensionSettings(
@RequestBody final String settings) throws NoSuchExtensionException, NoSuchOfferingException,
OwsExceptionReport, IOException {
JsonNode request = JSONUtils.loadString(settings);
final String offeringId = request.path(OFFERING).asText();
final String extensionId = request.path(IDENTIFIER).asText();
if (request.has(DISABLED_PROPERTY)) {
getCapabilitiesExtensionService().disableOfferingExtension(offeringId, extensionId, request.path(DISABLED_PROPERTY).asBoolean());
}
}
|
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value = "/edit", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public void setOfferingExtensionSettings(@RequestBody final String settings)
throws NoSuchExtensionException, NoSuchOfferingException, OwsExceptionReport, IOException {
JsonNode request = Json.loadString(settings);
final String offeringId = request.path(OFFERING).asText();
final String extensionId = request.path(IDENTIFIER).asText();
if (request.has(DISABLED_PROPERTY)) {
getCapabilitiesExtensionService().disableOfferingExtension(offeringId, extensionId,
request.path(DISABLED_PROPERTY).asBoolean());
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
spring/admin-controller/src/main/java/org/n52/sos/web/admin/caps/OfferingExtensionAjaxEndpoint.java
|
OfferingExtensionAjaxEndpoint
|
OfferingExtensionAjaxEndpoint
|
deleteOfferingExtension__(
@RequestBody final String requestJson)
|
deleteOfferingExtension__(@RequestBody final String requestJson)
|
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value="/delete", method = RequestMethod.DELETE, consumes = MediaType.APPLICATION_JSON_VALUE)
public void deleteOfferingExtension(
@RequestBody final String requestJson) throws NoSuchExtensionException, NoSuchOfferingException,
OwsExceptionReport, IOException {
JsonNode request = JSONUtils.loadString(requestJson);
final String offeringId = request.path(OFFERING).asText();
final String extensionId = request.path(IDENTIFIER).asText();
getCapabilitiesExtensionService().deleteOfferingExtension(offeringId, extensionId);
}
|
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value = "/delete", method = RequestMethod.DELETE, consumes = MediaType.APPLICATION_JSON_VALUE)
public void deleteOfferingExtension(@RequestBody final String requestJson)
throws NoSuchExtensionException, NoSuchOfferingException, OwsExceptionReport, IOException {
JsonNode request = Json.loadString(requestJson);
final String offeringId = request.path(OFFERING).asText();
final String extensionId = request.path(IDENTIFIER).asText();
getCapabilitiesExtensionService().deleteOfferingExtension(offeringId, extensionId);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/NoopTransformerAdapter.java
|
hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/NoopTransformerAdapter.java
|
NoopTransformerAdapter
|
NoopTransformerAdapter
|
NoopTransformerAdapter__()
|
NoopTransformerAdapter__()
|
private NoopTransformerAdapter() {}
|
private NoopTransformerAdapter() {
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
initInstance__()
|
initInstance__()
|
@Before
public void initInstance() {
instance = new InMemoryCacheImpl();
}
|
@Before
public void initInstance() {
// overwrite these methods as these are doing getInstance()-calls
instance = new InMemoryCacheImpl() {
private static final long serialVersionUID = -2571450058666530166L;
@Override
public Set<String> getFeatureOfInterestTypes() {
return Collections.emptySet();
}
@Override
public Set<String> getObservationTypes() {
return Collections.emptySet();
}
};
SupportedTypeRepository supportedTypeRepository = new SupportedTypeRepository();
supportedTypeRepository.init(new DecoderRepository(), new EncoderRepository());
instance.setSupportedTypeRepository(supportedTypeRepository);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
defaultConstructorReturnsObject__()
|
defaultConstructorReturnsObject__()
|
@Test
public void defaultConstructorReturnsObject() {
initInstance();
assertNotNull("instance is null", instance);
assertTrue("right class", instance instanceof InMemoryCacheImpl);
}
|
@Test
public void defaultConstructorReturnsObject() {
initInstance();
Assert.assertNotNull("instance is null", instance);
Assert.assertTrue("right class", instance instanceof InMemoryCacheImpl);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
equalsWithNewInstances__()
|
equalsWithNewInstances__()
|
@Test
public void equalsWithNewInstances() {
InMemoryCacheImpl anotherInstance = new InMemoryCacheImpl();
assertEquals("equals failed", instance, anotherInstance);
}
|
@Test
public void equalsWithNewInstances() {
Assert.assertEquals("equals failed", new InMemoryCacheImpl(), new InMemoryCacheImpl());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
equalsWithSelf__()
|
equalsWithSelf__()
|
@Test
public void equalsWithSelf() {
assertEquals("I am not equal with me", instance, instance);
}
|
@Test
public void equalsWithSelf() {
Assert.assertEquals("I am not equal with me", instance, instance);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
equalsWithNull__()
|
equalsWithNull__()
|
@Test
public void equalsWithNull() {
assertNotEquals("equal with null", instance, null);
}
|
@Test
public void equalsWithNull() {
Assert.assertNotEquals("equal with null", instance, null);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
equalWithOtherClass__()
|
equalWithOtherClass__()
|
@Test
public void equalWithOtherClass() {
assertNotEquals("equal with Object", instance, new Object());
}
|
@Test
public void equalWithOtherClass() {
Assert.assertNotEquals("equal with Object", instance, new Object());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
should_return_different_hashCodes_for_different_instances__()
|
should_return_different_hashCodes_for_different_instances__()
|
@Test
public void should_return_different_hashCodes_for_different_instances() {
InMemoryCacheImpl cache = new InMemoryCacheImpl();
cache.setProcedures(Collections.singleton("p_1"));
assertNotEquals("hashCode() of different caches are equal", cache.hashCode(), new InMemoryCacheImpl());
}
|
@Test
public void should_return_different_hashCodes_for_different_instances() {
InMemoryCacheImpl cache = new InMemoryCacheImpl();
cache.setProcedures(Collections.singleton("p_1"));
Assert.assertNotEquals("hashCode() of different caches are equal", cache.hashCode(), new InMemoryCacheImpl());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
should_return_empty_global_envelope_when_setEnvelope_is_called_with_null_parameter__()
|
should_return_empty_global_envelope_when_setEnvelope_is_called_with_null_parameter__()
|
@Test
public void should_return_empty_global_envelope_when_setEnvelope_is_called_with_null_parameter() {
instance.setGlobalEnvelope(null);
final SosEnvelope emptySosEnvelope = new SosEnvelope(null, instance.getDefaultEPSGCode());
assertThat(instance.getGlobalEnvelope(), not(nullValue()));
assertThat(instance.getGlobalEnvelope(), is(emptySosEnvelope));
}
|
@Test
public void should_return_empty_global_envelope_when_setEnvelope_is_called_with_null_parameter() {
instance.setGlobalEnvelope(null);
final ReferencedEnvelope emptyReferencedEnvelope = new ReferencedEnvelope(null, instance.getDefaultEPSGCode());
Assert.assertThat(instance.getGlobalEnvelope(), IsNot.not(IsNull.nullValue()));
Assert.assertThat(instance.getGlobalEnvelope(), Is.is(emptyReferencedEnvelope));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
should_serialize_to_json__()
|
should_serialize_to_json__()
|
@Test
public void should_serialize_to_json() throws JsonProcessingException {
String json = new ObjectMapper().writeValueAsString(instance);
assertNotNull(json);
assertFalse(json.isEmpty());
}
|
@Test
public void should_serialize_to_json() throws JsonProcessingException {
String json = new ObjectMapper().writeValueAsString(instance);
Assert.assertNotNull(json);
Assert.assertFalse(json.isEmpty());
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
should_return_true_if_min_resulttime_for_offering_is_available__()
|
should_return_true_if_min_resulttime_for_offering_is_available__()
|
@Test
public void should_return_true_if_min_resulttime_for_offering_is_available() {
final InMemoryCacheImpl cache = new InMemoryCacheImpl();
cache.setMinResultTimeForOffering(OFFERING_IDENTIFIER, new DateTime(52l));
assertThat(cache.hasMinResultTimeForOffering(OFFERING_IDENTIFIER), is(TRUE));
}
|
@Test
public void should_return_true_if_min_resulttime_for_offering_is_available() {
final InMemoryCacheImpl cache = new InMemoryCacheImpl();
cache.setMinResultTimeForOffering(OFFERING_IDENTIFIER, new DateTime(52L));
Assert.assertThat(cache.hasMinResultTimeForOffering(OFFERING_IDENTIFIER), Is.is(Boolean.TRUE));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
should_return_false_if_min_resulttime_for_offering_is_null__()
|
should_return_false_if_min_resulttime_for_offering_is_null__()
|
@Test
public void should_return_false_if_min_resulttime_for_offering_is_null() {
final InMemoryCacheImpl readCache = new InMemoryCacheImpl();
assertThat(readCache.hasMinResultTimeForOffering(OFFERING_IDENTIFIER), is(FALSE));
final InMemoryCacheImpl cache = new InMemoryCacheImpl();
cache.setMinResultTimeForOffering(OFFERING_IDENTIFIER, null);
assertThat(cache.hasMinResultTimeForOffering(OFFERING_IDENTIFIER), is(FALSE));
}
|
@Test
public void should_return_false_if_min_resulttime_for_offering_is_null() {
final InMemoryCacheImpl readCache = new InMemoryCacheImpl();
Assert.assertThat(readCache.hasMinResultTimeForOffering(OFFERING_IDENTIFIER), Is.is(Boolean.FALSE));
final InMemoryCacheImpl cache = new InMemoryCacheImpl();
cache.setMinResultTimeForOffering(OFFERING_IDENTIFIER, null);
Assert.assertThat(cache.hasMinResultTimeForOffering(OFFERING_IDENTIFIER), Is.is(Boolean.FALSE));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
should_return_false_if_relatedFeature_has_no_children__()
|
should_return_false_if_relatedFeature_has_no_children__()
|
@Test
public void should_return_false_if_relatedFeature_has_no_children() {
final InMemoryCacheImpl readCache = new InMemoryCacheImpl();
final String relatedFeature = "test-feature";
((SosWritableContentCache) readCache).addRelatedFeatureForOffering("test-offering", relatedFeature);
assertThat(readCache.isRelatedFeatureSampled(null), is(FALSE));
assertThat(readCache.isRelatedFeatureSampled(""), is(FALSE));
assertThat(readCache.isRelatedFeatureSampled(relatedFeature), is(FALSE));
}
|
@Test
public void should_return_false_if_relatedFeature_has_no_children() {
final InMemoryCacheImpl readCache = new InMemoryCacheImpl();
final String relatedFeature = FEATURE_IDENTIFIER;
((SosWritableContentCache) readCache).addRelatedFeatureForOffering(OFFERING_IDENTIFIER, relatedFeature);
Assert.assertThat(readCache.isRelatedFeatureSampled(null), Is.is(Boolean.FALSE));
Assert.assertThat(readCache.isRelatedFeatureSampled(""), Is.is(Boolean.FALSE));
Assert.assertThat(readCache.isRelatedFeatureSampled(relatedFeature), Is.is(Boolean.FALSE));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
core/cache/src/test/java/org/n52/sos/cache/InMemoryCacheImplTest.java
|
InMemoryCacheImplTest
|
InMemoryCacheImplTest
|
should_return_true_if_relatedFeature_has_one_or_more_children__()
|
should_return_true_if_relatedFeature_has_one_or_more_children__()
|
@Test
public void should_return_true_if_relatedFeature_has_one_or_more_children() {
final InMemoryCacheImpl readCache = new InMemoryCacheImpl();
final String relatedFeature = "test-feature";
final String relatedFeature2 = "test-feature-2";
final String offering = "test-offering";
((SosWritableContentCache) readCache).addRelatedFeatureForOffering(offering, relatedFeature);
((SosWritableContentCache) readCache).addRelatedFeatureForOffering(offering, relatedFeature2);
((SosWritableContentCache) readCache).addParentFeature(relatedFeature2, relatedFeature);
assertThat(readCache.isRelatedFeatureSampled(relatedFeature), is(TRUE));
}
|
@Test
public void should_return_true_if_relatedFeature_has_one_or_more_children() {
final InMemoryCacheImpl readCache = new InMemoryCacheImpl();
final String relatedFeature = FEATURE_IDENTIFIER;
final String relatedFeature2 = "test-feature-2";
final String offering = OFFERING_IDENTIFIER;
((SosWritableContentCache) readCache).addRelatedFeatureForOffering(offering, relatedFeature);
((SosWritableContentCache) readCache).addRelatedFeatureForOffering(offering, relatedFeature2);
((SosWritableContentCache) readCache).addParentFeature(relatedFeature2, relatedFeature);
Assert.assertThat(readCache.isRelatedFeatureSampled(relatedFeature), Is.is(Boolean.TRUE));
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
extensions/aqd/ereporting/src/main/java/org/n52/sos/web/admin/AdminEReportingHeaderController.java
|
operations/aqd-v10/src/main/java/org/n52/sos/web/admin/AdminEReportingHeaderController.java
|
AdminEReportingHeaderController
|
AdminEReportingHeaderController
|
getJSON__()
|
getJSON__()
|
@ResponseBody
@RequestMapping(method = RequestMethod.GET,
produces = "application/json")
public String getJSON() throws OwsExceptionReport {
ObjectNode node = JSONUtils.nodeFactory().objectNode();
ReportObligationRepository reportObligationRepository = ReportObligationRepository.getInstance();
CodingRepository codingRepository = CodingRepository.getInstance();
Encoder<JsonNode, ReportObligation> reportObligationEncoder = codingRepository.getEncoder(new JSONEncoderKey(ReportObligation.class));
Encoder<JsonNode, RelatedParty> relatedPartyEncoder = codingRepository.getEncoder(new JSONEncoderKey(RelatedParty.class));
node.set(AQDJSONConstants.REPORTING_AUTHORITY, relatedPartyEncoder.encode(reportObligationRepository.getReportingAuthority()));
ArrayNode ros = node.putArray(AQDJSONConstants.REPORT_OBLIGATIONS);
for (ReportObligationType reportObligationType : ReportObligationType.values()) {
ReportObligation reportObligation = reportObligationRepository.getReportObligation(reportObligationType);
ros.addObject().put(AQDJSONConstants.ID, reportObligationType.name())
.put(AQDJSONConstants.NAME, reportObligationType.getTitle())
.put(AQDJSONConstants.DESCRIPTION, reportObligationType.getDescription())
.set(AQDJSONConstants.VALUE, reportObligationEncoder.encode(reportObligation));
}
return JSONUtils.print(node);
}
|
@ResponseBody
@RequestMapping(method = RequestMethod.GET, produces = "application/json")
public String getJSON() throws OwsExceptionReport, EncodingException {
ObjectNode node = Json.nodeFactory().objectNode();
Encoder<JsonNode, ReportObligation> reportObligationEncoder =
encoderRepository.getEncoder(new JSONEncoderKey(ReportObligation.class));
Encoder<JsonNode, RelatedParty> relatedPartyEncoder =
encoderRepository.getEncoder(new JSONEncoderKey(RelatedParty.class));
node.set(AQDJSONConstants.REPORTING_AUTHORITY,
relatedPartyEncoder.encode(reportObligationRepository.getReportingAuthority()));
ArrayNode ros = node.putArray(AQDJSONConstants.REPORT_OBLIGATIONS);
for (ReportObligationType reportObligationType : ReportObligationType.values()) {
ReportObligation reportObligation = reportObligationRepository.getReportObligation(reportObligationType);
ros.addObject().put(AQDJSONConstants.ID, reportObligationType.name())
.put(AQDJSONConstants.NAME, reportObligationType.getTitle())
.put(AQDJSONConstants.DESCRIPTION, reportObligationType.getDescription())
.set(AQDJSONConstants.VALUE, reportObligationEncoder.encode(reportObligation));
}
return Json.print(node);
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
extensions/aqd/ereporting/src/main/java/org/n52/sos/web/admin/AdminEReportingHeaderController.java
|
operations/aqd-v10/src/main/java/org/n52/sos/web/admin/AdminEReportingHeaderController.java
|
AdminEReportingHeaderController
|
AdminEReportingHeaderController
|
save__(@RequestBody String json)
|
save__(@RequestBody String json)
|
@RequestMapping(method = RequestMethod.POST,
consumes = "application/json")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void save(@RequestBody String json) throws OwsExceptionReport {
LOG.info("Saving {}", json);
ReportObligationRepository reportObligationRepository = ReportObligationRepository.getInstance();
CodingRepository codingRepository = CodingRepository.getInstance();
Decoder<ReportObligation, JsonNode> reportObligationDecoder = codingRepository.getDecoder(new JsonDecoderKey(ReportObligation.class));
Decoder<RelatedParty, JsonNode> relatedPartyDecoder = codingRepository.getDecoder(new JsonDecoderKey(RelatedParty.class));
JsonNode node = JSONUtils.loadString(json);
RelatedParty relatedParty = relatedPartyDecoder.decode(node.path(AQDJSONConstants.REPORTING_AUTHORITY));
reportObligationRepository.saveReportingAuthority(relatedParty);
JsonNode obligations = node.path(AQDJSONConstants.REPORT_OBLIGATIONS);
Iterator<String> it = obligations.fieldNames();
while (it.hasNext()) {
String id = it.next();
ReportObligation reportObligation = reportObligationDecoder.decode(obligations.path(id));
reportObligationRepository.saveReportObligation(ReportObligationType.valueOf(id), reportObligation);
}
}
|
@RequestMapping(method = RequestMethod.POST, consumes = "application/json")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void save(@RequestBody String json) throws OwsExceptionReport, DecodingException {
LOG.info("Saving {}", json);
Decoder<ReportObligation, JsonNode> reportObligationDecoder =
decoderRepository.getDecoder(new JsonDecoderKey(ReportObligation.class));
Decoder<RelatedParty, JsonNode> relatedPartyDecoder =
decoderRepository.getDecoder(new JsonDecoderKey(RelatedParty.class));
JsonNode node = Json.loadString(json);
RelatedParty relatedParty = relatedPartyDecoder.decode(node.path(AQDJSONConstants.REPORTING_AUTHORITY));
reportObligationRepository.saveReportingAuthority(relatedParty);
JsonNode obligations = node.path(AQDJSONConstants.REPORT_OBLIGATIONS);
Iterator<String> it = obligations.fieldNames();
while (it.hasNext()) {
String id = it.next();
ReportObligation reportObligation = reportObligationDecoder.decode(obligations.path(id));
reportObligationRepository.saveReportObligation(ReportObligationType.valueOf(id), reportObligation);
}
}
|
52North_SOS__520cc60fd93dbfb6e48d75f23765d72556ef7fa1__c92d475de8a1b1cf5cb71462302fc510d7a69446
|
core/api/src/main/java/org/n52/sos/ogc/om/values/ComplexValue.java
|
core/api/src/main/java/org/n52/sos/ogc/om/values/SosXmlValue.java
|
ComplexValue
|
SosXmlValue
|
getValue__()
|
getValue__()
|
@Override
public SweAbstractDataRecord getValue() {
return this.value;
}
|
@Override
public XmlObject getValue() {
return this.xml;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.