Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/52North/shetland
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/52North/shetland:
  allow empty strings for OwsValue (fixes #3)
  Fixes #4 Wrong OperationName in ExecuteRequest.java
  Get default procedure encoding
  formatting
  Set defualt encodiung namespace
  add check method
  • Loading branch information
autermann committed Jun 1, 2017
2 parents e4a8e2b + 5400028 commit ff4ed5a
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/n52/shetland/ogc/ows/OwsValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Objects;

import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;

/**
* A single value, encoded as a string. This type can be used for one value, for
Expand All @@ -33,7 +32,7 @@ public class OwsValue implements OwsValueRestriction {
private final String value;

public OwsValue(String value) {
this.value = Objects.requireNonNull(Strings.emptyToNull(value));
this.value = Objects.requireNonNull(value);
}

public String getValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public AbstractComponent setLocation(final SmlLocation location) {
public boolean isSetLocation() {
return location != null;
}

@Override
public String getDefaultElementEncoding() {
return SensorMLConstants.NS_SML;
}
}
4 changes: 4 additions & 0 deletions src/main/java/org/n52/shetland/ogc/sensorML/ProcessChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ public boolean isAggragation() {
return true;
}

@Override
public String getDefaultElementEncoding() {
return SensorMLConstants.NS_SML;
}
}
5 changes: 5 additions & 0 deletions src/main/java/org/n52/shetland/ogc/sensorML/ProcessModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ public void setMethod(final ProcessMethod method) {
public boolean isSetMethod() {
return method != null;
}

@Override
public String getDefaultElementEncoding() {
return SensorMLConstants.NS_SML;
}
}
5 changes: 5 additions & 0 deletions src/main/java/org/n52/shetland/ogc/sensorML/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ public boolean isAggragation() {
return true;
}

@Override
public String getDefaultElementEncoding() {
return SensorMLConstants.NS_SML;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.n52.shetland.ogc.gml.ReferenceType;
import org.n52.shetland.ogc.sensorML.AbstractProcess;
import org.n52.shetland.ogc.sensorML.SensorML20Constants;
import org.n52.shetland.ogc.sensorML.SensorMLConstants;

/**
Expand Down Expand Up @@ -110,4 +111,9 @@ public void setTypeOf(ReferenceType typeOf) {
public boolean isSetTypeOf() {
return getTypeOf() != null;
}

@Override
public String getDefaultElementEncoding() {
return SensorML20Constants.NS_SML_20;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.n52.shetland.ogc.om.AbstractPhenomenon;
import org.n52.shetland.ogc.sensorML.AbstractSensorML;

import com.google.common.base.Strings;
import com.google.common.collect.Sets;

/**
Expand Down Expand Up @@ -284,4 +285,17 @@ public SosProcedureDescription<T> setIsAggregation(boolean aggregation) {
this.aggregation = aggregation;
return this;
}

@Override
public String getDefaultElementEncoding() {
if (getProcedureDescription() != null && !Strings.isNullOrEmpty(getProcedureDescription().getDefaultElementEncoding())) {
return getProcedureDescription().getDefaultElementEncoding();
}
return super.getDefaultElementEncoding();
}

@Override
public boolean isSetDefaultElementEncoding() {
return super.isSetDefaultElementEncoding() || (getProcedureDescription() != null && !Strings.isNullOrEmpty(getProcedureDescription().getDefaultElementEncoding()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.util.List;

import org.n52.shetland.ogc.sos.SosConstants;
import org.n52.shetland.ogc.sos.SosConstants;

/**
Expand Down Expand Up @@ -54,6 +53,10 @@ public List<String> getObservationIdentifier() {
return observationIdentifier;
}

public boolean isSetObservationIdentifier() {
return observationIdentifier != null && !observationIdentifier.isEmpty();
}

/**
* Set observation identifier
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,9 @@ public boolean isSetComments() {
public boolean isSetParameters() {
return parameters != null && !parameters.isEmpty();
}

@Override
public String getDefaultElementEncoding() {
return WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ public class ExecuteRequest extends OwsServiceRequest {
private final List<OutputDefinition> outputs = new LinkedList<>();

public ExecuteRequest() {
super(null, null, WPSConstants.Operations.Dismiss.name());
super(null, null, WPSConstants.Operations.Execute.name());
}

public ExecuteRequest(String service, String version) {
super(service, version, WPSConstants.Operations.Dismiss.name());
super(service, version, WPSConstants.Operations.Execute.name());
}

public ExecuteRequest(String service, String version, String operationName) {
Expand Down

0 comments on commit ff4ed5a

Please sign in to comment.