Class AbstractGitFlowRegistryClient
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.registry.flow.AbstractFlowRegistryClient
org.apache.nifi.registry.flow.git.AbstractGitFlowRegistryClient
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent
,org.apache.nifi.registry.flow.FlowRegistryClient
public abstract class AbstractGitFlowRegistryClient
extends org.apache.nifi.registry.flow.AbstractFlowRegistryClient
Base class for git-based flow registry clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBoolean
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
static final org.apache.nifi.components.PropertyDescriptor
private Pattern
(package private) static final String
private FlowSnapshotSerializer
private List
<org.apache.nifi.components.PropertyDescriptor> (package private) static final String
(package private) static final String
static final org.apache.nifi.components.PropertyDescriptor
static final org.apache.nifi.components.PropertyDescriptor
private GitRepositoryClient
(package private) static final String
(package private) static final String
Fields inherited from interface org.apache.nifi.registry.flow.FlowRegistryClient
DEFAULT_BRANCH_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.nifi.registry.flow.FlowRegistryBucket
createFlowRegistryBucket
(GitRepositoryClient repositoryClient, String name) protected FlowSnapshotSerializer
protected abstract List
<org.apache.nifi.components.PropertyDescriptor> Create the property descriptors for this client.protected abstract GitRepositoryClient
createRepositoryClient
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) Creates the repository client based on the current configuration context.private org.apache.nifi.registry.flow.RegisteredFlowSnapshotMetadata
createSnapshotMetadata
(GitCommit commit, org.apache.nifi.registry.flow.FlowLocation flowLocation) protected Collection
<org.apache.nifi.components.ValidationResult> customValidate
(org.apache.nifi.components.ValidationContext validationContext) org.apache.nifi.registry.flow.RegisteredFlow
deregisterFlow
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) generateFlowId
(String flowName) Set
<org.apache.nifi.registry.flow.FlowRegistryBranch> getBranches
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) org.apache.nifi.registry.flow.FlowRegistryBucket
getBucket
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.BucketLocation bucketLocation) Set
<org.apache.nifi.registry.flow.FlowRegistryBucket> getBuckets
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, String branch) org.apache.nifi.registry.flow.FlowRegistryBranch
getDefaultBranch
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) org.apache.nifi.registry.flow.RegisteredFlow
getFlow
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) org.apache.nifi.registry.flow.RegisteredFlowSnapshot
getFlowContents
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowVersionLocation flowVersionLocation) Set
<org.apache.nifi.registry.flow.RegisteredFlow> getFlows
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.BucketLocation bucketLocation) Set
<org.apache.nifi.registry.flow.RegisteredFlowSnapshotMetadata> getFlowVersions
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) getLatestVersion
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) protected GitRepositoryClient
getRepositoryClient
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) private org.apache.nifi.registry.flow.RegisteredFlowSnapshot
getSnapshot
(InputStream inputStream) private org.apache.nifi.registry.flow.RegisteredFlowSnapshot
getSnapshot
(GitRepositoryClient repositoryClient, String filePath, String branch) private String
getSnapshotFilePath
(org.apache.nifi.registry.flow.FlowLocation flowLocation) protected abstract String
getStorageLocation
(GitRepositoryClient repositoryClient) Provide the storage location for this client.protected List
<org.apache.nifi.components.PropertyDescriptor> void
initialize
(org.apache.nifi.registry.flow.FlowRegistryClientInitializationContext context) private void
initializeDefaultBucket
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) protected void
boolean
isBranchingSupported
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) private org.apache.nifi.registry.flow.RegisteredFlow
mapToRegisteredFlow
(org.apache.nifi.registry.flow.BucketLocation bucketLocation, String filename) void
onPropertyModified
(org.apache.nifi.components.PropertyDescriptor descriptor, String oldValue, String newValue) private void
populateFlowAndSnapshotMetadata
(org.apache.nifi.registry.flow.RegisteredFlowSnapshot flowSnapshot, org.apache.nifi.registry.flow.FlowLocation flowLocation) org.apache.nifi.registry.flow.RegisteredFlow
registerFlow
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.RegisteredFlow flow) org.apache.nifi.registry.flow.RegisteredFlowSnapshot
registerFlowSnapshot
(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.RegisteredFlowSnapshot flowSnapshot, org.apache.nifi.registry.flow.RegisterAction action) private <T extends org.apache.nifi.flow.VersionedComponent>
voidreplaceGroupId
(Collection<T> components, String newGroupIdentifier) private void
replaceGroupId
(org.apache.nifi.flow.ConnectableComponent connectableComponent, String originalGroupId, String newGroupId) private String
replaceGroupId
(org.apache.nifi.flow.VersionedProcessGroup group, String newGroupId) private org.apache.nifi.flow.Position
replacePosition
(org.apache.nifi.flow.VersionedProcessGroup group, org.apache.nifi.flow.Position newPosition) private void
updateBucketReferences
(GitRepositoryClient repositoryClient, org.apache.nifi.registry.flow.RegisteredFlowSnapshot flowSnapshot, String bucketId) private void
verifyReadPermissions
(GitRepositoryClient repositoryClient) private void
verifyWritePermissions
(GitRepositoryClient repositoryClient) Methods inherited from class org.apache.nifi.registry.flow.AbstractFlowRegistryClient
getIdentifier, getLogger, getSystemSslContext
Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, validate
Methods inherited from interface org.apache.nifi.registry.flow.FlowRegistryClient
isStorageLocationApplicable
-
Field Details
-
REPOSITORY_BRANCH
public static final org.apache.nifi.components.PropertyDescriptor REPOSITORY_BRANCH -
REPOSITORY_PATH
public static final org.apache.nifi.components.PropertyDescriptor REPOSITORY_PATH -
DIRECTORY_FILTER_EXCLUDE
public static final org.apache.nifi.components.PropertyDescriptor DIRECTORY_FILTER_EXCLUDE -
DEFAULT_BUCKET_NAME
- See Also:
-
DEFAULT_BUCKET_KEEP_FILE_PATH
- See Also:
-
DEFAULT_BUCKET_KEEP_FILE_CONTENT
- See Also:
-
DEFAULT_BUCKET_KEEP_FILE_MESSAGE
- See Also:
-
REGISTER_FLOW_MESSAGE_PREFIX
- See Also:
-
REGISTER_FLOW_MESSAGE_FORMAT
- See Also:
-
DEREGISTER_FLOW_MESSAGE_FORMAT
- See Also:
-
DEFAULT_FLOW_SNAPSHOT_MESSAGE_FORMAT
- See Also:
-
SNAPSHOT_FILE_EXTENSION
- See Also:
-
SNAPSHOT_FILE_PATH_FORMAT
- See Also:
-
FLOW_CONTENTS_GROUP_ID
- See Also:
-
flowSnapshotSerializer
-
repositoryClient
-
directoryExclusionPattern
-
clientInitialized
-
propertyDescriptors
-
-
Constructor Details
-
AbstractGitFlowRegistryClient
public AbstractGitFlowRegistryClient()
-
-
Method Details
-
initialize
public void initialize(org.apache.nifi.registry.flow.FlowRegistryClientInitializationContext context) - Specified by:
initialize
in interfaceorg.apache.nifi.registry.flow.FlowRegistryClient
- Overrides:
initialize
in classorg.apache.nifi.registry.flow.AbstractFlowRegistryClient
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptors
in classorg.apache.nifi.components.AbstractConfigurableComponent
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) - Overrides:
customValidate
in classorg.apache.nifi.components.AbstractConfigurableComponent
-
onPropertyModified
public void onPropertyModified(org.apache.nifi.components.PropertyDescriptor descriptor, String oldValue, String newValue) - Specified by:
onPropertyModified
in interfaceorg.apache.nifi.components.ConfigurableComponent
- Overrides:
onPropertyModified
in classorg.apache.nifi.components.AbstractConfigurableComponent
-
isBranchingSupported
public boolean isBranchingSupported(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) -
getBranches
public Set<org.apache.nifi.registry.flow.FlowRegistryBranch> getBranches(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
getDefaultBranch
public org.apache.nifi.registry.flow.FlowRegistryBranch getDefaultBranch(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) -
getBuckets
public Set<org.apache.nifi.registry.flow.FlowRegistryBucket> getBuckets(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, String branch) throws IOException, org.apache.nifi.registry.flow.FlowRegistryException - Throws:
IOException
org.apache.nifi.registry.flow.FlowRegistryException
-
getBucket
public org.apache.nifi.registry.flow.FlowRegistryBucket getBucket(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.BucketLocation bucketLocation) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
registerFlow
public org.apache.nifi.registry.flow.RegisteredFlow registerFlow(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.RegisteredFlow flow) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
deregisterFlow
public org.apache.nifi.registry.flow.RegisteredFlow deregisterFlow(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
getFlow
public org.apache.nifi.registry.flow.RegisteredFlow getFlow(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
getFlows
public Set<org.apache.nifi.registry.flow.RegisteredFlow> getFlows(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.BucketLocation bucketLocation) throws IOException, org.apache.nifi.registry.flow.FlowRegistryException - Throws:
IOException
org.apache.nifi.registry.flow.FlowRegistryException
-
getFlowContents
public org.apache.nifi.registry.flow.RegisteredFlowSnapshot getFlowContents(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowVersionLocation flowVersionLocation) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
registerFlowSnapshot
public org.apache.nifi.registry.flow.RegisteredFlowSnapshot registerFlowSnapshot(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.RegisteredFlowSnapshot flowSnapshot, org.apache.nifi.registry.flow.RegisterAction action) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
getFlowVersions
public Set<org.apache.nifi.registry.flow.RegisteredFlowSnapshotMetadata> getFlowVersions(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
getLatestVersion
public Optional<String> getLatestVersion(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context, org.apache.nifi.registry.flow.FlowLocation flowLocation) throws org.apache.nifi.registry.flow.FlowRegistryException, IOException - Throws:
org.apache.nifi.registry.flow.FlowRegistryException
IOException
-
generateFlowId
-
createFlowRegistryBucket
private org.apache.nifi.registry.flow.FlowRegistryBucket createFlowRegistryBucket(GitRepositoryClient repositoryClient, String name) -
createSnapshotMetadata
private org.apache.nifi.registry.flow.RegisteredFlowSnapshotMetadata createSnapshotMetadata(GitCommit commit, org.apache.nifi.registry.flow.FlowLocation flowLocation) throws IOException - Throws:
IOException
-
mapToRegisteredFlow
private org.apache.nifi.registry.flow.RegisteredFlow mapToRegisteredFlow(org.apache.nifi.registry.flow.BucketLocation bucketLocation, String filename) -
getSnapshotFilePath
-
getSnapshot
private org.apache.nifi.registry.flow.RegisteredFlowSnapshot getSnapshot(GitRepositoryClient repositoryClient, String filePath, String branch) throws IOException, org.apache.nifi.registry.flow.FlowRegistryException - Throws:
IOException
org.apache.nifi.registry.flow.FlowRegistryException
-
getSnapshot
private org.apache.nifi.registry.flow.RegisteredFlowSnapshot getSnapshot(InputStream inputStream) throws IOException - Throws:
IOException
-
replacePosition
private org.apache.nifi.flow.Position replacePosition(org.apache.nifi.flow.VersionedProcessGroup group, org.apache.nifi.flow.Position newPosition) -
replaceGroupId
-
replaceGroupId
private <T extends org.apache.nifi.flow.VersionedComponent> void replaceGroupId(Collection<T> components, String newGroupIdentifier) -
replaceGroupId
-
updateBucketReferences
private void updateBucketReferences(GitRepositoryClient repositoryClient, org.apache.nifi.registry.flow.RegisteredFlowSnapshot flowSnapshot, String bucketId) -
populateFlowAndSnapshotMetadata
private void populateFlowAndSnapshotMetadata(org.apache.nifi.registry.flow.RegisteredFlowSnapshot flowSnapshot, org.apache.nifi.registry.flow.FlowLocation flowLocation) -
verifyWritePermissions
private void verifyWritePermissions(GitRepositoryClient repositoryClient) throws org.apache.nifi.registry.flow.AuthorizationException - Throws:
org.apache.nifi.registry.flow.AuthorizationException
-
verifyReadPermissions
private void verifyReadPermissions(GitRepositoryClient repositoryClient) throws org.apache.nifi.registry.flow.AuthorizationException - Throws:
org.apache.nifi.registry.flow.AuthorizationException
-
getRepositoryClient
protected GitRepositoryClient getRepositoryClient(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) throws IOException, org.apache.nifi.registry.flow.FlowRegistryException - Throws:
IOException
org.apache.nifi.registry.flow.FlowRegistryException
-
invalidateClient
protected void invalidateClient() -
initializeDefaultBucket
private void initializeDefaultBucket(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) throws IOException, org.apache.nifi.registry.flow.FlowRegistryException - Throws:
IOException
org.apache.nifi.registry.flow.FlowRegistryException
-
createPropertyDescriptors
Create the property descriptors for this client.- Returns:
- the list of property descriptors
-
getStorageLocation
Provide the storage location for this client.- Parameters:
repositoryClient
- the repository client- Returns:
- the storage location value
-
createRepositoryClient
protected abstract GitRepositoryClient createRepositoryClient(org.apache.nifi.registry.flow.FlowRegistryClientConfigurationContext context) throws IOException, org.apache.nifi.registry.flow.FlowRegistryException Creates the repository client based on the current configuration context.- Parameters:
context
- the configuration context- Returns:
- the repository client
- Throws:
IOException
- if an I/O error occurs creating the clientorg.apache.nifi.registry.flow.FlowRegistryException
- if a non-I/O error occurs creating the client
-
createFlowSnapshotSerializer
-