Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.n52.shetland.ogc.sensorML.elements.SmlCapability;
import org.n52.shetland.ogc.sensorML.elements.SmlCharacteristics;
import org.n52.shetland.ogc.sensorML.elements.SmlClassifier;
import org.n52.shetland.ogc.sensorML.elements.SmlEvent;
import org.n52.shetland.ogc.sensorML.elements.SmlIdentifier;
import org.n52.shetland.ogc.sensorML.elements.SmlIdentifierPredicates;
import org.n52.shetland.ogc.swe.SweDataRecord;
Expand All @@ -55,13 +56,12 @@ public abstract class AbstractSensorML extends AbstractFeature implements Phenom
private List<SmlCapabilities> capabilities = new ArrayList<>(0);
private List<SmlContact> contacts = new ArrayList<>(0);
private List<AbstractSmlDocumentation> documentations = new ArrayList<>(0);
// private Map<String, AbstractFeature> featuresOfInterestMap = new
// HashMap<>();
private List<SmlEvent> history = new ArrayList<>(0);
// private Map<String, AbstractFeature> featuresOfInterestMap = new HashMap<>();
// private Set<String> featuresOfInterest = Sets.newLinkedHashSet();
// private Map<String, AbstractPhenomenon> phenomenonMap = new HashMap<>();
// private ReferenceType parentProcedure;
// private Set<AbstractSensorML> childProcedures = new LinkedHashSet<>();
private String history;

/**
* constructor
Expand Down Expand Up @@ -351,11 +351,11 @@ public AbstractSensorML addDocumentation(final AbstractSmlDocumentation document
return this;
}

public String getHistory() {
public List<SmlEvent> getHistory() {
return history;
}

public AbstractSensorML setHistory(final String history) {
public AbstractSensorML setHistory(final List<SmlEvent> history) {
this.history = history;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2015-2020 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.n52.shetland.ogc.sensorML.elements;

import com.google.common.collect.Lists;
import org.n52.shetland.util.CollectionHelper;

import java.util.List;

/**
* Implementation of sml:ClassifierList
*
* @author <a href="mailto:j.speckamp@52north.org">Jan Speckamp</a>
*/
public class SmlClassifierList extends SmlClassifier {

private List<SmlClassifier> classification;

public boolean isSetClassification() {
return !CollectionHelper.nullEmptyOrContainsOnlyNulls(classification);
}

public List<SmlClassifier> getClassification() {
return classification;
}

public void setClassification(List<SmlClassifier> classifiers) {
if (isSetClassification()) {
this.classification.addAll(classifiers);
} else {
this.classification = classifiers;
}
}

public void addClassifier(SmlClassifier classifier) {
if (!isSetClassification()) {
this.classification = Lists.newArrayList();
}
this.classification.add(classifier);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
* Copyright 2015-2020 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.n52.shetland.ogc.sensorML.elements;

import org.n52.shetland.ogc.gml.time.Time;
import org.n52.shetland.ogc.sensorML.SmlContactList;
import org.n52.shetland.ogc.swe.AbstractSWEIdentifiable;

import java.util.List;

/**
* @author <a href="mailto:j.speckamp@52north.org">Jan Speckamp</a>
*/
public class SmlEvent extends AbstractSWEIdentifiable {

private String definition;

// not implemented yet!
//private SmlKeywordList keywords;

private List<SmlIdentifier> identification;

private SmlClassifierList classification;

private SmlContactList contacts;

private SmlDocumentationList documentation;

/**
* As of 12-000r2 the PDF Specification defines property as a single property but schemas.opengis.net defines it
* as an unbounded array. As we are based on autogenerated code from schemas.opengis.net we do not strictly
* follow the specification here
*/
private List<SmlProperty> property;

private Time time;

// not implemented yet!
// private SmlConfiguration configuration;

public boolean isSetDefinition() {
return definition != null && !definition.isEmpty();
}

public String getDefinition() {
return definition;
}

public void setDefinition(String definition) {
this.definition = definition;
}

public List<SmlIdentifier> getIdentification() {
return identification;
}

public void setIdentification(List<SmlIdentifier> identification) {
this.identification = identification;
}

public SmlClassifierList getClassification() {
return classification;
}

public void setClassification(SmlClassifierList classification) {
this.classification = classification;
}

public SmlContactList getContacts() {
return contacts;
}

public void setContacts(SmlContactList contacts) {
this.contacts = contacts;
}

public SmlDocumentationList getDocumentation() {
return documentation;
}

public void setDocumentation(SmlDocumentationList documentation) {
this.documentation = documentation;
}

public boolean hasProperties() {
return property != null && !property.isEmpty();
}

public List<SmlProperty> getProperty() {
return property;
}

public void setProperty(List<SmlProperty> property) {
this.property = property;
}

public boolean isSetTime() {
return time != null;
}

public Time getTime() {
return time;
}

public void setTime(Time time) {
this.time = time;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2015-2020 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.n52.shetland.ogc.sensorML.elements;

import com.google.common.collect.Lists;
import org.n52.shetland.util.CollectionHelper;

import java.util.List;

/**
* Implementation of sml:ClassifierList
*
* @author <a href="mailto:j.speckamp@52north.org">Jan Speckamp</a>
*/
public class SmlIdentifierList extends SmlIdentifier {

private List<SmlIdentifier> identification;

public boolean isSetClassification() {
return !CollectionHelper.nullEmptyOrContainsOnlyNulls(identification);
}

public List<SmlIdentifier> getIdentification() {
return identification;
}

public void setIdentification(List<SmlIdentifier> classifiers) {
if (isSetClassification()) {
this.identification.addAll(classifiers);
} else {
this.identification = classifiers;
}
}

public void addIdentifier(SmlIdentifier classifier) {
if (!isSetClassification()) {
this.identification = Lists.newArrayList();
}
this.identification.add(classifier);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2015-2020 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.n52.shetland.ogc.sensorML.elements;

/**
* Models an sml:property
*
* @author <a href="mailto:j.speckamp@52north.org">Jan Speckamp</a>
*/
public class SmlProperty extends AbstractDataComponentContainer<SmlProperty> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.n52.shetland.ogc.sensorML.v20;

import org.n52.shetland.ogc.gml.ReferenceType;
Expand All @@ -26,11 +27,12 @@
*
* @author <a href="mailto:c.hollmann@52north.org">Carsten Hollmann</a>
* @since 1.0.0
*
*/
public class AbstractPhysicalProcess extends DescribedObject implements HasPosition<AbstractPhysicalProcess> {

private ReferenceType attachedTo;

// TODO: According to SensorML20 7.5.1 this should have cardinality [0..*]
private SpatialFrame localReferenceFrame;
private TemporalFrame localTimeFrame;

Expand All @@ -49,8 +51,7 @@ public ReferenceType getAttachedTo() {
* Set the attachedTo reference. It is automatically added to parentProcedure list. If title is set, the
* title is used, else the href.
*
* @param attachedTo
* the attachedTo to set
* @param attachedTo the attachedTo to set
*/
public void setAttachedTo(ReferenceType attachedTo) {
this.attachedTo = attachedTo;
Expand All @@ -68,8 +69,7 @@ public SpatialFrame getLocalReferenceFrame() {
}

/**
* @param localReferenceFrame
* the localReferenceFrame to set
* @param localReferenceFrame the localReferenceFrame to set
*/
public void setLocalReferenceFrame(SpatialFrame localReferenceFrame) {
this.localReferenceFrame = localReferenceFrame;
Expand All @@ -83,8 +83,7 @@ public TemporalFrame getLocalTimeFrame() {
}

/**
* @param localTimeFrame
* the localTimeFrame to set
* @param localTimeFrame the localTimeFrame to set
*/
public void setLocalTimeFrame(TemporalFrame localTimeFrame) {
this.localTimeFrame = localTimeFrame;
Expand All @@ -99,8 +98,7 @@ public SmlPosition getPosition() {
}

/**
* @param position
* the position to set
* @param position the position to set
*/
@SuppressFBWarnings({ "EI_EXPOSE_REP2" })
public AbstractPhysicalProcess setPosition(SmlPosition position) {
Expand All @@ -116,8 +114,7 @@ public Object getTimePosition() {
}

/**
* @param timePosition
* the timePosition to set
* @param timePosition the timePosition to set
*/
public void setTimePosition(Object timePosition) {
this.timePosition = timePosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*
* @author <a href="mailto:c.hollmann@52north.org">Carsten Hollmann</a>
* @since 1.0.0
*
*/
public class PhysicalComponent extends AbstractPhysicalProcess implements HasProcessMethod {

Expand Down
Loading