is-collector/src/org/gcube/informationsystem/collector/impl/porttypes/Sink.java

85 lines
2.1 KiB
Java
Executable File

package org.gcube.informationsystem.collector.impl.porttypes;
import java.util.Calendar;
import org.globus.wsrf.ResourceLifetime;
import org.globus.wsrf.ResourceProperties;
import org.globus.wsrf.ResourceProperty;
import org.globus.wsrf.ResourcePropertySet;
import org.globus.wsrf.impl.ReflectionResourceProperty;
import org.globus.wsrf.impl.SimpleResourcePropertyMetaData;
import org.globus.wsrf.impl.SimpleResourcePropertySet;
import org.gcube.common.core.utils.logging.GCUBELog;
/**
* <em>Sink</em> PortType's implementation class. It's the registration PortType
* for all the Aggregator Sources.
*
* @author Manuele Simi (ISTI-CNR)
*
*/
public class Sink implements ResourceLifetime, ResourceProperties {
// WS-Lifetime Properties
protected Calendar terminationTime, currentTime;
private final GCUBELog logger = new GCUBELog(Sink.class);
private ResourcePropertySet propSet;
/**
* Initializes a new Sink PortType by creating its
* {@link SimpleResourcePropertySet}
*
*/
public Sink() {
this.propSet = new SimpleResourcePropertySet(XMLCollectionAccess.RP_SET);
ResourceProperty prop = null;
try {
// ResourceLifeTime properties
prop = new ReflectionResourceProperty(SimpleResourcePropertyMetaData.TERMINATION_TIME, this);
this.propSet.add(prop);
prop = new ReflectionResourceProperty( SimpleResourcePropertyMetaData.CURRENT_TIME, this);
this.propSet.add(prop);
this.propSet.add(prop);
} catch (Exception e) {
logger.error("An error occurred during the Sink resource creation", e);
}
}
/**
*
* {@inheritDoc}
*/
public Calendar getCurrentTime() {
return Calendar.getInstance();
}
/**
*
* {@inheritDoc}
*/
public Calendar getTerminationTime() {
return this.terminationTime;
}
/**
*
* {@inheritDoc}
*/
public void setTerminationTime(Calendar time) {
this.terminationTime = time;
}
/**
*
* {@inheritDoc}
*/
public ResourcePropertySet getResourcePropertySet() {
return this.propSet;
}
}