public FileStaticProperty(FileStaticProperty other) { super(other); this.endpointUrl = other.getEndpointUrl(); this.locationPath = other.getLocationPath(); }
@Override public Protocol getInstance(ProtocolDescription protocolDescription, Parser parser, Format format) { ParameterExtractor extractor = new ParameterExtractor(protocolDescription.getConfig()); long intervalProperty = Long.parseLong(extractor.singleValue("interval")); FileStaticProperty fileStaticProperty = (FileStaticProperty) extractor.getStaticPropertyByName("filePath"); String fileUri = fileStaticProperty.getLocationPath(); return new FileStreamProtocol(parser, format, intervalProperty, fileUri); }
@Override public ProtocolDescription declareModel() { ProtocolDescription pd = new ProtocolDescription(ID,"File","This is the " + "description for the File protocol"); FileStaticProperty fileInput = new FileStaticProperty("filePath", "File", "This property defines the path to the file."); // FreeTextStaticProperty urlProperty = new FreeTextStaticProperty("fileUri", "fileUri", // "This property defines the URL for the http request."); pd.setSourceType("SET"); pd.setIconUrl("file.png"); pd.addConfig(fileInput); pd.setAppId(ID); return pd; }
@Override public Protocol getInstance(ProtocolDescription protocolDescription, Parser parser, Format format) { ParameterExtractor extractor = new ParameterExtractor(protocolDescription.getConfig()); // String fileUri = extractor.singleValue("fileUri"); FileStaticProperty fileStaticProperty = (FileStaticProperty) extractor.getStaticPropertyByName("filePath"); String fileUri = fileStaticProperty.getLocationPath(); return new FileProtocol(parser, format, fileUri); }
@Override public ProtocolDescription declareModel() { ProtocolDescription pd = new ProtocolDescription(ID,"File","This is the " + "description for the File Stream protocol"); // FreeTextStaticProperty urlProperty = new FreeTextStaticProperty("filePath", "File Path", // "This property defines the path to the file."); FileStaticProperty fileInput = new FileStaticProperty("filePath", "File", "This property defines the path to the file."); pd.setSourceType("STREAM"); FreeTextStaticProperty intervalProperty = new FreeTextStaticProperty("interval", "Interval", "This property " + "defines the pull interval in seconds."); pd.setIconUrl("file.png"); pd.addConfig(fileInput); pd.addConfig(intervalProperty); pd.setAppId(ID); return pd; }