@Override protected boolean isListingResetNecessary(final PropertyDescriptor property) { return DIRECTORY.equals(property) || RECURSE.equals(property) || FILE_FILTER.equals(property) || PATH_FILTER.equals(property) || MIN_AGE.equals(property) || MAX_AGE.equals(property) || MIN_SIZE.equals(property) || MAX_SIZE.equals(property) || IGNORE_HIDDEN_FILES.equals(property); }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.equals(TABLE_NAME)) { lastResult = null; } }
@Override protected boolean isListingResetNecessary(final PropertyDescriptor property) { // re-list if configuration changed, but not when security keys are rolled (not included in the condition) return PROP_PREFIX.equals(property) || AzureStorageUtils.ACCOUNT_NAME.equals(property) || AzureStorageUtils.CONTAINER.equals(property) || AzureStorageUtils.PROP_SAS_TOKEN.equals(property); }
/** * Locates the actual property descriptor for the given spec property descriptor. * * @param propertyDescriptors descriptors * @param specDescriptor example descriptor * @return property */ private PropertyDescriptor locatePropertyDescriptor(Set<PropertyDescriptor> propertyDescriptors, PropertyDescriptor specDescriptor) { for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyDescriptor.equals(specDescriptor)) { return propertyDescriptor; } } return specDescriptor; }
/** * Locates the actual property descriptor for the given spec property descriptor. * * @param propertyDescriptors properties * @param specDescriptor example property * @return property */ private PropertyDescriptor locatePropertyDescriptor(Set<PropertyDescriptor> propertyDescriptors, PropertyDescriptor specDescriptor) { for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyDescriptor.equals(specDescriptor)) { return propertyDescriptor; } } return specDescriptor; }
/** * Locates the actual property descriptor for the given spec property descriptor. * * @param propertyDescriptors properties * @param specDescriptor example property * @return property */ private PropertyDescriptor locatePropertyDescriptor(Set<PropertyDescriptor> propertyDescriptors, PropertyDescriptor specDescriptor) { for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyDescriptor.equals(specDescriptor)) { return propertyDescriptor; } } return specDescriptor; }
@Override public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { if (PUT_VALUE_TO_ATTRIBUTE.equals(descriptor)) { putToAttribute = !isEmpty(newValue); } }
@Override public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { if (descriptor.equals(ARRAY_JSON_PATH_EXPRESSION)) { if (!StringUtils.equals(oldValue, newValue)) { if (oldValue != null) { // clear the cached item JSON_PATH_REF.set(null); } } } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.equals(PUT_OUTPUT_IN_ATTRIBUTE)) { if (newValue != null) { relationships.set(ATTRIBUTE_RELATIONSHIP_SET); } else { relationships.set(OUTPUT_STREAM_RELATIONSHIP_SET); } } }
@Override public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { // if we are changing the protocol, the events that we may have queued up are no longer valid, as they // were received using a different protocol and may be from a completely different source if (PROTOCOL.equals(descriptor)) { if (syslogEvents != null) { syslogEvents.clear(); } if (errorEvents != null) { errorEvents.clear(); } } }
@Override public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { if ( ((oldValue != null && !oldValue.equals(newValue))) && (descriptor.equals(QUERY) || descriptor.equals(TIME_FIELD_STRATEGY) || descriptor.equals(TIME_RANGE_STRATEGY) || descriptor.equals(EARLIEST_TIME) || descriptor.equals(LATEST_TIME) || descriptor.equals(HOSTNAME)) ) { getLogger().debug("A property that require resetting state was modified - {} oldValue {} newValue {}", new Object[] {descriptor.getDisplayName(), oldValue, newValue}); resetState = true; } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (isConfigurationRestored() && FILENAME.equals(descriptor)) { states = new HashMap<String, TailFileObject>(); } }
@Override public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { if (RECORD_READER.equals(descriptor)) { isRecordReaderSet = !StringUtils.isEmpty(newValue); } else if (RECORD_WRITER.equals(descriptor)) { isRecordWriterSet = !StringUtils.isEmpty(newValue); } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (isConfigurationRestored() && (descriptor.equals(DIRECTORY) || descriptor.equals(FILE_FILTER))) { this.resetState = true; } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (descriptor.equals(STORE_STATE)) { if (DO_NOT_STORE_STATE.equals(newValue)){ stateful = false; relationships = statelessRelationshipSet; } else { stateful = true; relationships = statefulRelationshipSet; } } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (ROUTING_STRATEGY.equals(descriptor)) { if (ROUTE_TO_MATCHED_UNMATCHED.getValue().equalsIgnoreCase(newValue)) { final Set<Relationship> matchedUnmatchedRels = new HashSet<>(); matchedUnmatchedRels.add(REL_MATCHED); matchedUnmatchedRels.add(REL_UNMATCHED); matchedUnmatchedRels.add(REL_FAILURE); this.relationships = matchedUnmatchedRels; this.routeToMatchedUnmatched = true; } else { final Set<Relationship> successRels = new HashSet<>(); successRels.add(REL_SUCCESS); successRels.add(REL_FAILURE); this.relationships = successRels; this.routeToMatchedUnmatched = false; } } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (ROUTING_QUERY_INFO_STRATEGY.equals(descriptor)) { final Set<Relationship> relationshipSet = new HashSet<>(); relationshipSet.add(REL_SUCCESS); relationshipSet.add(REL_FAILURE); relationshipSet.add(REL_RETRY); if (ALWAYS.getValue().equalsIgnoreCase(newValue) || NO_HITS.getValue().equalsIgnoreCase(newValue)) { relationshipSet.add(REL_QUERY_INFO); } this.queryInfoRouteStrategy = QueryInfoRouteStrategy.valueOf(newValue); this.relationships = relationshipSet; } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.equals(DICTIONARY)) { fileWatcherRef.set(new SynchronousFileWatcher(Paths.get(newValue), new LastModifiedMonitor(), 60000L)); } }
private PropertyDescriptor getPropertyDescriptor(final PropertyDescriptor specDescriptor) { PropertyDescriptor descriptor = null; //check if property supported final List<PropertyDescriptor> supportedDescriptors = getSupportedPropertyDescriptors(); if (supportedDescriptors != null) { for (final PropertyDescriptor desc : supportedDescriptors) { //find actual descriptor if (specDescriptor.equals(desc)) { return desc; } } } descriptor = getSupportedDynamicPropertyDescriptor(specDescriptor.getName()); if (descriptor != null && !descriptor.isDynamic()) { descriptor = new PropertyDescriptor.Builder().fromPropertyDescriptor(descriptor).dynamic(true).build(); } if (descriptor == null) { descriptor = new PropertyDescriptor.Builder().fromPropertyDescriptor(specDescriptor).addValidator(Validator.INVALID).dynamic(true).build(); } return descriptor; }