You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2016/07/14 22:33:15 UTC
[09/10] nifi git commit: NIFI-1896 This closes #650. Refactored
nifi-api into nifi-framework-api and other locations. The nifi-api is
specific to that which is needed for intended extension points.
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/AccessPolicy.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/AccessPolicy.java b/nifi-api/src/main/java/org/apache/nifi/authorization/AccessPolicy.java
deleted file mode 100644
index 93cabb2..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/AccessPolicy.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * Defines a policy for a set of userIdentifiers to perform a set of actions on a given resource.
- */
-public class AccessPolicy {
-
- private final String identifier;
-
- private final String resource;
-
- private final Set<String> users;
-
- private final Set<String> groups;
-
- private final RequestAction action;
-
- private AccessPolicy(final Builder builder) {
- this.identifier = builder.identifier;
- this.resource = builder.resource;
- this.action = builder.action;
- this.users = Collections.unmodifiableSet(new HashSet<>(builder.users));
- this.groups = Collections.unmodifiableSet(new HashSet<>(builder.groups));
-
- if (this.identifier == null || this.identifier.trim().isEmpty()) {
- throw new IllegalArgumentException("Identifier can not be null or empty");
- }
-
- if (this.resource == null) {
- throw new IllegalArgumentException("Resource can not be null");
- }
-
- if (this.action == null) {
- throw new IllegalArgumentException("Action can not be null");
- }
- }
-
- /**
- * @return the identifier for this policy
- */
- public String getIdentifier() {
- return identifier;
- }
-
- /**
- * @return the resource for this policy
- */
- public String getResource() {
- return resource;
- }
-
- /**
- * @return an unmodifiable set of user ids for this policy
- */
- public Set<String> getUsers() {
- return users;
- }
-
- /**
- * @return an unmodifiable set of group ids for this policy
- */
- public Set<String> getGroups() {
- return groups;
- }
-
- /**
- * @return the action for this policy
- */
- public RequestAction getAction() {
- return action;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
-
- final AccessPolicy other = (AccessPolicy) obj;
- return Objects.equals(this.identifier, other.identifier);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(this.identifier);
- }
-
- @Override
- public String toString() {
- return String.format("identifier[%s], resource[%s], users[%s], groups[%s], action[%s]",
- getIdentifier(), getResource(), getUsers(), getGroups(), getAction());
- }
-
- /**
- * Builder for Access Policies.
- */
- public static class Builder {
-
- private String identifier;
- private String resource;
- private RequestAction action;
- private Set<String> users = new HashSet<>();
- private Set<String> groups = new HashSet<>();
- private final boolean fromPolicy;
-
- /**
- * Default constructor for building a new AccessPolicy.
- */
- public Builder() {
- this.fromPolicy = false;
- }
-
- /**
- * Initializes the builder with the state of the provided policy. When using this constructor
- * the identifier field of the builder can not be changed and will result in an IllegalStateException
- * if attempting to do so.
- *
- * @param other the existing access policy to initialize from
- */
- public Builder(final AccessPolicy other) {
- if (other == null) {
- throw new IllegalArgumentException("Can not initialize builder with a null access policy");
- }
-
- this.identifier = other.getIdentifier();
- this.resource = other.getResource();
- this.action = other.getAction();
- this.users.clear();
- this.users.addAll(other.getUsers());
- this.groups.clear();
- this.groups.addAll(other.getGroups());
- this.fromPolicy = true;
- }
-
- /**
- * Sets the identifier of the builder.
- *
- * @param identifier the identifier to set
- * @return the builder
- * @throws IllegalStateException if this method is called when this builder was constructed from an existing Policy
- */
- public Builder identifier(final String identifier) {
- if (fromPolicy) {
- throw new IllegalStateException(
- "Identifier can not be changed when initialized from an existing policy");
- }
-
- this.identifier = identifier;
- return this;
- }
-
- /**
- * Sets the resource of the builder.
- *
- * @param resource the resource to set
- * @return the builder
- */
- public Builder resource(final String resource) {
- this.resource = resource;
- return this;
- }
-
- /**
- * Adds all the users from the provided set to the builder's set of users.
- *
- * @param users the users to add
- * @return the builder
- */
- public Builder addUsers(final Set<String> users) {
- if (users != null) {
- this.users.addAll(users);
- }
- return this;
- }
-
- /**
- * Adds the given user to the builder's set of users.
- *
- * @param user the user to add
- * @return the builder
- */
- public Builder addUser(final String user) {
- if (user != null) {
- this.users.add(user);
- }
- return this;
- }
-
- /**
- * Removes all users in the provided set from the builder's set of users.
- *
- * @param users the users to remove
- * @return the builder
- */
- public Builder removeUsers(final Set<String> users) {
- if (users != null) {
- this.users.removeAll(users);
- }
- return this;
- }
-
- /**
- * Removes the provided user from the builder's set of users.
- *
- * @param user the user to remove
- * @return the builder
- */
- public Builder removeUser(final String user) {
- if (user != null) {
- this.users.remove(user);
- }
- return this;
- }
-
- /**
- * Clears the builder's set of users so that it is non-null and size == 0.
- *
- * @return the builder
- */
- public Builder clearUsers() {
- this.users.clear();
- return this;
- }
-
- /**
- * Adds all the groups from the provided set to the builder's set of groups.
- *
- * @param groups the groups to add
- * @return the builder
- */
- public Builder addGroups(final Set<String> groups) {
- if (groups != null) {
- this.groups.addAll(groups);
- }
- return this;
- }
-
- /**
- * Adds the given group to the builder's set of groups.
- *
- * @param group the group to add
- * @return the builder
- */
- public Builder addGroup(final String group) {
- if (group != null) {
- this.groups.add(group);
- }
- return this;
- }
-
- /**
- * Removes all groups in the provided set from the builder's set of groups.
- *
- * @param groups the groups to remove
- * @return the builder
- */
- public Builder removeGroups(final Set<String> groups) {
- if (groups != null) {
- this.groups.removeAll(groups);
- }
- return this;
- }
-
- /**
- * Removes the provided groups from the builder's set of groups.
- *
- * @param group the group to remove
- * @return the builder
- */
- public Builder removeGroup(final String group) {
- if (group != null) {
- this.groups.remove(group);
- }
- return this;
- }
-
- /**
- * Clears the builder's set of groups so that it is non-null and size == 0.
- *
- * @return the builder
- */
- public Builder clearGroups() {
- this.groups.clear();
- return this;
- }
-
- /**
- * Sets the action for this builder.
- *
- * @param action the action to set
- * @return the builder
- */
- public Builder action(final RequestAction action) {
- this.action = action;
- return this;
- }
-
- /**
- * @return a new AccessPolicy constructed from the state of the builder
- */
- public AccessPolicy build() {
- return new AccessPolicy(this);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationRequest.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationRequest.java b/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationRequest.java
deleted file mode 100644
index da0a276..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationRequest.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Represents an authorization request for a given user/entity performing an action against a resource within some userContext.
- */
-public class AuthorizationRequest {
-
- private final Resource resource;
- private final String identity;
- private final RequestAction action;
- private final boolean isAccessAttempt;
- private final boolean isAnonymous;
- private final Map<String, String> userContext;
- private final Map<String, String> resourceContext;
-
- private AuthorizationRequest(final Builder builder) {
- Objects.requireNonNull(builder.resource, "The resource is required when creating an authorization request");
- Objects.requireNonNull(builder.action, "The action is required when creating an authorization request");
- Objects.requireNonNull(builder.isAccessAttempt, "Whether this request is an access attempt is request");
- Objects.requireNonNull(builder.isAnonymous, "Whether this request is being performed by an anonymous user is required");
-
- this.resource = builder.resource;
- this.identity = builder.identity;
- this.action = builder.action;
- this.isAccessAttempt = builder.isAccessAttempt;
- this.isAnonymous = builder.isAnonymous;
- this.userContext = builder.userContext == null ? null : Collections.unmodifiableMap(builder.userContext);
- this.resourceContext = builder.resourceContext == null ? null : Collections.unmodifiableMap(builder.resourceContext);
- }
-
- /**
- * The Resource being authorized. Not null.
- *
- * @return The resource
- */
- public Resource getResource() {
- return resource;
- }
-
- /**
- * The identity accessing the Resource. May be null if the user could not authenticate.
- *
- * @return The identity
- */
- public String getIdentity() {
- return identity;
- }
-
- /**
- * Whether this is a direct access attempt of the Resource if if it's being checked as part of another response.
- *
- * @return if this is a direct access attempt
- */
- public boolean isAccessAttempt() {
- return isAccessAttempt;
- }
-
- /**
- * Whether the entity accessing is anonymous.
- *
- * @return whether the entity is anonymous
- */
- public boolean isAnonymous() {
- return isAnonymous;
- }
-
- /**
- * The action being taken against the Resource. Not null.
- *
- * @return The action
- */
- public RequestAction getAction() {
- return action;
- }
-
- /**
- * The userContext of the user request to make additional access decisions. May be null.
- *
- * @return The userContext of the user request
- */
- public Map<String, String> getUserContext() {
- return userContext;
- }
-
- /**
- * The event attributes to make additional access decisions for provenance events. May be null.
- *
- * @return The event attributes
- */
- public Map<String, String> getResourceContext() {
- return resourceContext;
- }
-
- /**
- * AuthorizationRequest builder.
- */
- public static final class Builder {
-
- private Resource resource;
- private String identity;
- private Boolean isAnonymous;
- private Boolean isAccessAttempt;
- private RequestAction action;
- private Map<String, String> userContext;
- private Map<String, String> resourceContext;
-
- public Builder resource(final Resource resource) {
- this.resource = resource;
- return this;
- }
-
- public Builder identity(final String identity) {
- this.identity = identity;
- return this;
- }
-
- public Builder anonymous(final Boolean isAnonymous) {
- this.isAnonymous = isAnonymous;
- return this;
- }
-
- public Builder accessAttempt(final Boolean isAccessAttempt) {
- this.isAccessAttempt = isAccessAttempt;
- return this;
- }
-
- public Builder action(final RequestAction action) {
- this.action = action;
- return this;
- }
-
- public Builder userContext(final Map<String, String> userContext) {
- if (userContext != null) {
- this.userContext = new HashMap<>(userContext);
- }
- return this;
- }
-
- public Builder resourceContext(final Map<String, String> resourceContext) {
- if (resourceContext != null) {
- this.resourceContext = new HashMap<>(resourceContext);
- }
- return this;
- }
-
- public AuthorizationRequest build() {
- return new AuthorizationRequest(this);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationResult.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationResult.java b/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationResult.java
deleted file mode 100644
index a3f520c..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizationResult.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-/**
- * Represents a decision whether authorization is granted.
- */
-public class AuthorizationResult {
-
- public enum Result {
- Approved,
- Denied,
- ResourceNotFound
- }
-
- private static final AuthorizationResult APPROVED = new AuthorizationResult(Result.Approved, null);
- private static final AuthorizationResult RESOURCE_NOT_FOUND = new AuthorizationResult(Result.ResourceNotFound, null);
-
- private final Result result;
- private final String explanation;
-
- /**
- * Creates a new AuthorizationResult with the specified result and explanation.
- *
- * @param result of the authorization
- * @param explanation for the authorization attempt
- */
- private AuthorizationResult(Result result, String explanation) {
- if (Result.Denied.equals(result) && explanation == null) {
- throw new IllegalArgumentException("An explanation is required when the authorization request is denied.");
- }
-
- this.result = result;
- this.explanation = explanation;
- }
-
- /**
- * @return Whether or not the request is approved
- */
- public Result getResult() {
- return result;
- }
-
- /**
- * @return If the request is denied, the reason why. Null otherwise
- */
- public String getExplanation() {
- return explanation;
- }
-
- /**
- * @return a new approved AuthorizationResult
- */
- public static AuthorizationResult approved() {
- return APPROVED;
- }
-
- /**
- * Resource not found will indicate that there are no specific authorization rules for this resource.
- * @return a new resource not found AuthorizationResult
- */
- public static AuthorizationResult resourceNotFound() {
- return RESOURCE_NOT_FOUND;
- }
-
- /**
- * Creates a new denied AuthorizationResult with a message indicating 'Access is denied'.
- *
- * @return a new denied AuthorizationResult
- */
- public static AuthorizationResult denied() {
- return denied("Access is denied");
- }
-
- /**
- * Creates a new denied AuthorizationResult with the specified explanation.
- *
- * @param explanation for why it was denied
- * @return a new denied AuthorizationResult with the specified explanation
- * @throws IllegalArgumentException if explanation is null
- */
- public static AuthorizationResult denied(String explanation) {
- return new AuthorizationResult(Result.Denied, explanation);
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/Authorizer.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/Authorizer.java b/nifi-api/src/main/java/org/apache/nifi/authorization/Authorizer.java
deleted file mode 100644
index cb8c7f1..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/Authorizer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-import org.apache.nifi.authorization.exception.AuthorizationAccessException;
-import org.apache.nifi.authorization.exception.AuthorizerCreationException;
-import org.apache.nifi.authorization.exception.AuthorizerDestructionException;
-
-/**
- * Authorizes user requests.
- */
-public interface Authorizer {
-
- /**
- * Determines if the specified user/entity is authorized to access the specified resource within the given context.
- *
- * @param request The authorization request
- * @return the authorization result
- * @throws AuthorizationAccessException if unable to access the policies
- */
- AuthorizationResult authorize(AuthorizationRequest request) throws AuthorizationAccessException;
-
- /**
- * Called immediately after instance creation for implementers to perform additional setup
- *
- * @param initializationContext in which to initialize
- */
- void initialize(AuthorizerInitializationContext initializationContext) throws AuthorizerCreationException;
-
- /**
- * Called to configure the Authorizer.
- *
- * @param configurationContext at the time of configuration
- * @throws AuthorizerCreationException for any issues configuring the provider
- */
- void onConfigured(AuthorizerConfigurationContext configurationContext) throws AuthorizerCreationException;
-
- /**
- * Called immediately before instance destruction for implementers to release resources.
- *
- * @throws AuthorizerDestructionException If pre-destruction fails.
- */
- void preDestruction() throws AuthorizerDestructionException;
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerConfigurationContext.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerConfigurationContext.java b/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerConfigurationContext.java
deleted file mode 100644
index 3721ab4..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerConfigurationContext.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-import org.apache.nifi.components.PropertyValue;
-
-import java.util.Map;
-
-/**
- *
- */
-public interface AuthorizerConfigurationContext {
-
- /**
- * @return identifier for the authorizer
- */
- String getIdentifier();
-
- /**
- * Retrieves all properties the component currently understands regardless
- * of whether a value has been set for them or not. If no value is present
- * then its value is null and thus any registered default for the property
- * descriptor applies.
- *
- * @return Map of all properties
- */
- Map<String, String> getProperties();
-
- /**
- * @param property to lookup the descriptor and value of
- * @return the value the component currently understands for the given
- * PropertyDescriptor. This method does not substitute default
- * PropertyDescriptor values, so the value returned will be null if not set
- */
- PropertyValue getProperty(String property);
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerInitializationContext.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerInitializationContext.java
deleted file mode 100644
index 4b3d77c..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerInitializationContext.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-/**
- * Initialization content for Authorizers.
- */
-public interface AuthorizerInitializationContext {
-
- /**
- * The identifier of the Authorizer.
- *
- * @return The identifier
- */
- public String getIdentifier();
-
- /**
- * The lookup for accessing other configured Authorizers.
- *
- * @return The Authorizer lookup
- */
- public AuthorizerLookup getAuthorizerLookup();
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerLookup.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerLookup.java b/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerLookup.java
deleted file mode 100644
index 9669976..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/AuthorizerLookup.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-/**
- *
- */
-public interface AuthorizerLookup {
-
- /**
- * Looks up the Authorizer with the specified identifier
- *
- * @param identifier The identifier of the Authorizer
- * @return The Authorizer
- */
- Authorizer getAuthorizer(String identifier);
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/Group.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/Group.java b/nifi-api/src/main/java/org/apache/nifi/authorization/Group.java
deleted file mode 100644
index 7db619a..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/Group.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * A group that users can belong to.
- */
-public class Group { // TODO rename to UserGroup
-
- private final String identifier;
-
- private final String name;
-
- private final Set<String> users;
-
- private Group(final Builder builder) {
- this.identifier = builder.identifier;
- this.name = builder.name;
- this.users = Collections.unmodifiableSet(new HashSet<>(builder.users));
-
- if (this.identifier == null || this.identifier.trim().isEmpty()) {
- throw new IllegalArgumentException("Identifier can not be null or empty");
- }
-
- if (this.name == null || this.name.trim().isEmpty()) {
- throw new IllegalArgumentException("Name can not be null or empty");
- }
- }
-
- /**
- * @return the identifier of the group
- */
- public String getIdentifier() {
- return identifier;
- }
-
- /**
- * @return the name of the group
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return an unmodifiable set of user identifiers that belong to this group
- */
- public Set<String> getUsers() {
- return users;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
-
- final Group other = (Group) obj;
- return Objects.equals(this.identifier, other.identifier);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(this.identifier);
- }
-
- @Override
- public String toString() {
- return String.format("identifier[%s], name[%s]", getIdentifier(), getName());
- }
-
-
- /**
- * Builder for creating Groups.
- */
- public static class Builder {
-
- private String identifier;
- private String name;
- private Set<String> users = new HashSet<>();
- private final boolean fromGroup;
-
- public Builder() {
- this.fromGroup = false;
- }
-
- /**
- * Initializes the builder with the state of the provided group. When using this constructor
- * the identifier field of the builder can not be changed and will result in an IllegalStateException
- * if attempting to do so.
- *
- * @param other the existing access policy to initialize from
- */
- public Builder(final Group other) {
- if (other == null) {
- throw new IllegalArgumentException("Provided group can not be null");
- }
-
- this.identifier = other.getIdentifier();
- this.name = other.getName();
- this.users.clear();
- this.users.addAll(other.getUsers());
- this.fromGroup = true;
- }
-
- /**
- * Sets the identifier of the builder.
- *
- * @param identifier the identifier
- * @return the builder
- * @throws IllegalStateException if this method is called when this builder was constructed from an existing Group
- */
- public Builder identifier(final String identifier) {
- if (fromGroup) {
- throw new IllegalStateException(
- "Identifier can not be changed when initialized from an existing group");
- }
-
- this.identifier = identifier;
- return this;
- }
-
- /**
- * Sets the name of the builder.
- *
- * @param name the name
- * @return the builder
- */
- public Builder name(final String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Adds all users from the provided set to the builder's set of users.
- *
- * @param users a set of users to add
- * @return the builder
- */
- public Builder addUsers(final Set<String> users) {
- if (users != null) {
- this.users.addAll(users);
- }
- return this;
- }
-
- /**
- * Adds the given user to the builder's set of users.
- *
- * @param user the user to add
- * @return the builder
- */
- public Builder addUser(final String user) {
- if (user != null) {
- this.users.add(user);
- }
- return this;
- }
-
- /**
- * Removes the given user from the builder's set of users.
- *
- * @param user the user to remove
- * @return the builder
- */
- public Builder removeUser(final String user) {
- if (user != null) {
- this.users.remove(user);
- }
- return this;
- }
-
- /**
- * Removes all users from the provided set from the builder's set of users.
- *
- * @param users the users to remove
- * @return the builder
- */
- public Builder removeUsers(final Set<String> users) {
- if (users != null) {
- this.users.removeAll(users);
- }
- return this;
- }
-
- /**
- * Clears the builder's set of users so that users is non-null with size 0.
- *
- * @return the builder
- */
- public Builder clearUsers() {
- this.users.clear();
- return this;
- }
-
- /**
- * @return a new Group constructed from the state of the builder
- */
- public Group build() {
- return new Group(this);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/RequestAction.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/RequestAction.java b/nifi-api/src/main/java/org/apache/nifi/authorization/RequestAction.java
deleted file mode 100644
index 3e28a67..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/RequestAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-/**
- * Actions a user/entity can take on a resource.
- */
-public enum RequestAction {
- READ("read"),
- WRITE("write");
-
- private String value;
-
- RequestAction(String value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return value.toLowerCase();
- }
-
- public static RequestAction valueOfValue(final String action) {
- if (RequestAction.READ.toString().equals(action)) {
- return RequestAction.READ;
- } else if (RequestAction.WRITE.toString().equals(action)) {
- return RequestAction.WRITE;
- } else {
- throw new IllegalArgumentException("Action must be one of [" + READ.toString() + ", " + WRITE.toString() + "]");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/Resource.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/Resource.java b/nifi-api/src/main/java/org/apache/nifi/authorization/Resource.java
deleted file mode 100644
index 661b326..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/Resource.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-/**
- * Resource in an authorization request.
- */
-public interface Resource {
-
- /**
- * The identifier for this resource.
- *
- * @return identifier for this resource
- */
- String getIdentifier();
-
- /**
- * The name of this resource. May be null.
- *
- * @return name of this resource
- */
- String getName();
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/User.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/User.java b/nifi-api/src/main/java/org/apache/nifi/authorization/User.java
deleted file mode 100644
index 371241b..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/User.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-import java.util.Objects;
-
-/**
- * A user to create authorization policies for.
- */
-public class User {
-
- private final String identifier;
-
- private final String identity;
-
- private User(final Builder builder) {
- this.identifier = builder.identifier;
- this.identity = builder.identity;
-
- if (identifier == null || identifier.trim().isEmpty()) {
- throw new IllegalArgumentException("Identifier can not be null or empty");
- }
-
- if (identity == null || identity.trim().isEmpty()) {
- throw new IllegalArgumentException("Identity can not be null or empty");
- }
-
- }
-
- /**
- * @return the identifier of the user
- */
- public String getIdentifier() {
- return identifier;
- }
-
- /**
- * @return the identity string of the user
- */
- public String getIdentity() {
- return identity;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
-
- final User other = (User) obj;
- return Objects.equals(this.identifier, other.identifier);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(this.identifier);
- }
-
- @Override
- public String toString() {
- return String.format("identifier[%s], identity[%s]", getIdentifier(), getIdentity());
- }
-
- /**
- * Builder for Users.
- */
- public static class Builder {
-
- private String identifier;
- private String identity;
- private final boolean fromUser;
-
- /**
- * Default constructor for building a new User.
- */
- public Builder() {
- this.fromUser = false;
- }
-
- /**
- * Initializes the builder with the state of the provided user. When using this constructor
- * the identifier field of the builder can not be changed and will result in an IllegalStateException
- * if attempting to do so.
- *
- * @param other the existing user to initialize from
- */
- public Builder(final User other) {
- if (other == null) {
- throw new IllegalArgumentException("Provided user can not be null");
- }
-
- this.identifier = other.getIdentifier();
- this.identity = other.getIdentity();
- this.fromUser = true;
- }
-
- /**
- * Sets the identifier of the builder.
- *
- * @param identifier the identifier to set
- * @return the builder
- * @throws IllegalStateException if this method is called when this builder was constructed from an existing User
- */
- public Builder identifier(final String identifier) {
- if (fromUser) {
- throw new IllegalStateException(
- "Identifier can not be changed when initialized from an existing user");
- }
-
- this.identifier = identifier;
- return this;
- }
-
- /**
- * Sets the identity of the builder.
- *
- * @param identity the identity to set
- * @return the builder
- */
- public Builder identity(final String identity) {
- this.identity = identity;
- return this;
- }
-
- /**
- * @return a new User constructed from the state of the builder
- */
- public User build() {
- return new User(this);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/UserContextKeys.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/UserContextKeys.java b/nifi-api/src/main/java/org/apache/nifi/authorization/UserContextKeys.java
deleted file mode 100644
index fca4b74..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/UserContextKeys.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-/**
- * Constants for keys that can be passed in the AuthorizationRequest user context Map.
- */
-public enum UserContextKeys {
-
- CLIENT_ADDRESS;
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/UsersAndAccessPolicies.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/UsersAndAccessPolicies.java b/nifi-api/src/main/java/org/apache/nifi/authorization/UsersAndAccessPolicies.java
deleted file mode 100644
index 552b753..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/UsersAndAccessPolicies.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization;
-
-import java.util.Set;
-
-/**
- * A holder object to provide atomic access to policies for a given resource and users by
- * identity. Implementations must ensure consistent access to the data backing this instance.
- */
-public interface UsersAndAccessPolicies {
-
- /**
- * Retrieves the set of access policies for a given resource and action.
- *
- * @param resourceIdentifier the resource identifier to retrieve policies for
- * @param action the action to retrieve policies for
- * @return the access policy for the given resource and action
- */
- public AccessPolicy getAccessPolicy(final String resourceIdentifier, final RequestAction action);
-
- /**
- * Retrieves a user by an identity string.
- *
- * @param identity the identity of the user to retrieve
- * @return the user with the given identity
- */
- public User getUser(final String identity);
-
- /**
- * Retrieves the groups for a given user identity.
- *
- * @param userIdentity a user identity
- * @return the set of groups for the given user identity
- */
- public Set<Group> getGroups(final String userIdentity);
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/annotation/AuthorizerContext.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/annotation/AuthorizerContext.java b/nifi-api/src/main/java/org/apache/nifi/authorization/annotation/AuthorizerContext.java
deleted file mode 100644
index b0d3f83..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/annotation/AuthorizerContext.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- *
- *
- */
-@Documented
-@Target({ElementType.FIELD, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Inherited
-public @interface AuthorizerContext {
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizationAccessException.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizationAccessException.java b/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizationAccessException.java
deleted file mode 100644
index 8b22d45..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizationAccessException.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization.exception;
-
-/**
- * Represents the case when an authorization decision could not be made because the Authorizer was unable to access the underlying data store.
- */
-public class AuthorizationAccessException extends RuntimeException {
-
- public AuthorizationAccessException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public AuthorizationAccessException(String message) {
- super(message);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerCreationException.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerCreationException.java b/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerCreationException.java
deleted file mode 100644
index 4264202..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerCreationException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization.exception;
-
-/**
- * Represents the exceptional case when an Authorizer fails instantiation.
- *
- */
-public class AuthorizerCreationException extends RuntimeException {
-
- public AuthorizerCreationException() {
- }
-
- public AuthorizerCreationException(String msg) {
- super(msg);
- }
-
- public AuthorizerCreationException(Throwable cause) {
- super(cause);
- }
-
- public AuthorizerCreationException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerDestructionException.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerDestructionException.java b/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerDestructionException.java
deleted file mode 100644
index 852eca1..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/exception/AuthorizerDestructionException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization.exception;
-
-/**
- * Represents the exceptional case when an Authorizer fails destruction.
- *
- */
-public class AuthorizerDestructionException extends RuntimeException {
-
- public AuthorizerDestructionException() {
- }
-
- public AuthorizerDestructionException(String msg) {
- super(msg);
- }
-
- public AuthorizerDestructionException(Throwable cause) {
- super(cause);
- }
-
- public AuthorizerDestructionException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/resource/Authorizable.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/resource/Authorizable.java b/nifi-api/src/main/java/org/apache/nifi/authorization/resource/Authorizable.java
deleted file mode 100644
index 7cb21ae..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/resource/Authorizable.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization.resource;
-
-import org.apache.nifi.authorization.AccessDeniedException;
-import org.apache.nifi.authorization.AuthorizationRequest;
-import org.apache.nifi.authorization.AuthorizationResult;
-import org.apache.nifi.authorization.AuthorizationResult.Result;
-import org.apache.nifi.authorization.Authorizer;
-import org.apache.nifi.authorization.RequestAction;
-import org.apache.nifi.authorization.Resource;
-import org.apache.nifi.authorization.UserContextKeys;
-import org.apache.nifi.authorization.user.NiFiUser;
-
-import java.util.Map;
-import java.util.HashMap;
-
-public interface Authorizable {
-
- /**
- * The parent for this Authorizable. May be null.
- *
- * @return the parent authorizable or null
- */
- Authorizable getParentAuthorizable();
-
- /**
- * The Resource for this Authorizable.
- *
- * @return the parent resource
- */
- Resource getResource();
-
- /**
- * Returns whether the current user is authorized for the specified action on the specified resource. This
- * method does not imply the user is directly attempting to access the specified resource. If the user is
- * attempting a direct access use Authorizable.authorize().
- *
- * @param authorizer authorizer
- * @param action action
- * @return is authorized
- */
- default boolean isAuthorized(Authorizer authorizer, RequestAction action, NiFiUser user) {
- return Result.Approved.equals(checkAuthorization(authorizer, action, user).getResult());
- }
-
- /**
- * Returns the result of an authorization request for the specified user for the specified action on the specified
- * resource. This method does not imply the user is directly attempting to access the specified resource. If the user is
- * attempting a direct access use Authorizable.authorize().
- *
- * @param authorizer authorizer
- * @param action action
- * @param user user
- * @return is authorized
- */
- default AuthorizationResult checkAuthorization(Authorizer authorizer, RequestAction action, NiFiUser user, Map<String, String> resourceContext) {
- final Map<String,String> userContext;
- if (user.getClientAddress() != null && !user.getClientAddress().trim().isEmpty()) {
- userContext = new HashMap<>();
- userContext.put(UserContextKeys.CLIENT_ADDRESS.name(), user.getClientAddress());
- } else {
- userContext = null;
- }
-
- // build the request
- final AuthorizationRequest request = new AuthorizationRequest.Builder()
- .identity(user.getIdentity())
- .anonymous(user.isAnonymous())
- .accessAttempt(false)
- .action(action)
- .resource(getResource())
- .resourceContext(resourceContext)
- .userContext(userContext)
- .build();
-
- // perform the authorization
- final AuthorizationResult result = authorizer.authorize(request);
-
- // verify the results
- if (Result.ResourceNotFound.equals(result.getResult())) {
- final Authorizable parent = getParentAuthorizable();
- if (parent == null) {
- return AuthorizationResult.denied();
- } else {
- return parent.checkAuthorization(authorizer, action, user);
- }
- } else {
- return result;
- }
- }
-
- /**
- * Returns the result of an authorization request for the specified user for the specified action on the specified
- * resource. This method does not imply the user is directly attempting to access the specified resource. If the user is
- * attempting a direct access use Authorizable.authorize().
- *
- * @param authorizer authorizer
- * @param action action
- * @param user user
- * @return is authorized
- */
- default AuthorizationResult checkAuthorization(Authorizer authorizer, RequestAction action, NiFiUser user) {
- return checkAuthorization(authorizer, action, user, null);
- }
-
- /**
- * Authorizes the current user for the specified action on the specified resource. This method does imply the user is
- * directly accessing the specified resource.
- *
- * @param authorizer authorizer
- * @param action action
- * @param user user
- * @param resourceContext resource context
- */
- default void authorize(Authorizer authorizer, RequestAction action, NiFiUser user, Map<String, String> resourceContext) throws AccessDeniedException {
- final Map<String,String> userContext;
- if (user.getClientAddress() != null && !user.getClientAddress().trim().isEmpty()) {
- userContext = new HashMap<>();
- userContext.put(UserContextKeys.CLIENT_ADDRESS.name(), user.getClientAddress());
- } else {
- userContext = null;
- }
-
- final AuthorizationRequest request = new AuthorizationRequest.Builder()
- .identity(user.getIdentity())
- .anonymous(user.isAnonymous())
- .accessAttempt(true)
- .action(action)
- .resource(getResource())
- .resourceContext(resourceContext)
- .userContext(userContext)
- .build();
-
- final AuthorizationResult result = authorizer.authorize(request);
- if (Result.ResourceNotFound.equals(result.getResult())) {
- final Authorizable parent = getParentAuthorizable();
- if (parent == null) {
- throw new AccessDeniedException("Access is denied");
- } else {
- parent.authorize(authorizer, action, user);
- }
- } else if (Result.Denied.equals(result.getResult())) {
- throw new AccessDeniedException(result.getExplanation());
- }
- }
-
- /**
- * Authorizes the current user for the specified action on the specified resource. This method does imply the user is
- * directly accessing the specified resource.
- *
- * @param authorizer authorizer
- * @param action action
- * @param user user
- */
- default void authorize(Authorizer authorizer, RequestAction action, NiFiUser user) throws AccessDeniedException {
- authorize(authorizer, action, user, null);
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/authorization/user/NiFiUser.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/authorization/user/NiFiUser.java b/nifi-api/src/main/java/org/apache/nifi/authorization/user/NiFiUser.java
deleted file mode 100644
index c450bc4..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/authorization/user/NiFiUser.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.authorization.user;
-
-/**
- * A representation of a NiFi user that has logged into the application
- */
-public interface NiFiUser {
-
- /**
- * @return the unique identity of this user
- */
- String getIdentity();
-
- /**
- * @return the next user in the proxied entities chain, or <code>null</code> if no more users exist in the chain.
- */
- NiFiUser getChain();
-
- /**
- * @return <code>true</code> if the user is the unauthenticated Anonymous user
- */
- boolean isAnonymous();
-
- /**
- * @return the address of the client that made the request which created this user
- */
- String getClientAddress();
-
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java b/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java
index 72dcc2a..edaddd7 100644
--- a/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java
+++ b/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java
@@ -36,41 +36,41 @@ public interface PropertyValue {
/**
* @return the raw property value as a string
*/
- public String getValue();
+ String getValue();
/**
* @return an integer representation of the property value, or
* <code>null</code> if not set
* @throws NumberFormatException if not able to parse
*/
- public Integer asInteger();
+ Integer asInteger();
/**
* @return a Long representation of the property value, or <code>null</code>
* if not set
* @throws NumberFormatException if not able to parse
*/
- public Long asLong();
+ Long asLong();
/**
* @return a Boolean representation of the property value, or
* <code>null</code> if not set
*/
- public Boolean asBoolean();
+ Boolean asBoolean();
/**
* @return a Float representation of the property value, or
* <code>null</code> if not set
* @throws NumberFormatException if not able to parse
*/
- public Float asFloat();
+ Float asFloat();
/**
* @return a Double representation of the property value, of
* <code>null</code> if not set
* @throws NumberFormatException if not able to parse
*/
- public Double asDouble();
+ Double asDouble();
/**
* @param timeUnit specifies the TimeUnit to convert the time duration into
@@ -78,7 +78,7 @@ public interface PropertyValue {
* in terms of the specified TimeUnit; if the property is not set, returns
* <code>null</code>
*/
- public Long asTimePeriod(TimeUnit timeUnit);
+ Long asTimePeriod(TimeUnit timeUnit);
/**
*
@@ -87,14 +87,14 @@ public interface PropertyValue {
* in terms of the specified DataUnit; if hte property is not set, returns
* <code>null</code>
*/
- public Double asDataSize(DataUnit dataUnit);
+ Double asDataSize(DataUnit dataUnit);
/**
* @return the ControllerService whose identifier is the raw value of
* <code>this</code>, or <code>null</code> if either the value is not set or
* the value does not identify a ControllerService
*/
- public ControllerService asControllerService();
+ ControllerService asControllerService();
/**
* @param <T> the generic type of the controller service
@@ -110,14 +110,14 @@ public interface PropertyValue {
* <code>serviceType</code> or if <code>serviceType</code> references a
* class that is not an interface
*/
- public <T extends ControllerService> T asControllerService(Class<T> serviceType) throws IllegalArgumentException;
+ <T extends ControllerService> T asControllerService(Class<T> serviceType) throws IllegalArgumentException;
/**
* @return <code>true</code> if the user has configured a value, or if the
* {@link PropertyDescriptor} for the associated property has a default
* value, <code>false</code> otherwise
*/
- public boolean isSet();
+ boolean isSet();
/**
* <p>
@@ -132,7 +132,7 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating
* the Expression against the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions() throws ProcessException;
+ PropertyValue evaluateAttributeExpressions() throws ProcessException;
/**
* <p>
@@ -148,7 +148,7 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating the Expression against
* the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions(Map<String, String> attributes) throws ProcessException;
+ PropertyValue evaluateAttributeExpressions(Map<String, String> attributes) throws ProcessException;
/**
* <p>
@@ -167,7 +167,7 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating the Expression against
* the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions(Map<String, String> attributes, AttributeValueDecorator decorator) throws ProcessException;
+ PropertyValue evaluateAttributeExpressions(Map<String, String> attributes, AttributeValueDecorator decorator) throws ProcessException;
/**
* <p>
@@ -183,7 +183,7 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating
* the Expression against the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions(FlowFile flowFile) throws ProcessException;
+ PropertyValue evaluateAttributeExpressions(FlowFile flowFile) throws ProcessException;
/**
* <p>
@@ -202,7 +202,7 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating
* the Expression against the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions(FlowFile flowFile, Map<String, String> additionalAttributes) throws ProcessException;
+ PropertyValue evaluateAttributeExpressions(FlowFile flowFile, Map<String, String> additionalAttributes) throws ProcessException;
/**
* <p>
@@ -222,7 +222,7 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating
* the Expression against the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions(FlowFile flowFile, Map<String, String> additionalAttributes, AttributeValueDecorator decorator) throws ProcessException;
+ PropertyValue evaluateAttributeExpressions(FlowFile flowFile, Map<String, String> additionalAttributes, AttributeValueDecorator decorator) throws ProcessException;
/**
* <p>
@@ -240,7 +240,7 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating
* the Expression against the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions(AttributeValueDecorator decorator) throws ProcessException;
+ PropertyValue evaluateAttributeExpressions(AttributeValueDecorator decorator) throws ProcessException;
/**
* <p>
@@ -260,5 +260,5 @@ public interface PropertyValue {
* @throws ProcessException if the Expression cannot be compiled or evaluating
* the Expression against the given attributes causes an Exception to be thrown
*/
- public PropertyValue evaluateAttributeExpressions(FlowFile flowFile, AttributeValueDecorator decorator) throws ProcessException;
+ PropertyValue evaluateAttributeExpressions(FlowFile flowFile, AttributeValueDecorator decorator) throws ProcessException;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/components/state/StateProvider.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/components/state/StateProvider.java b/nifi-api/src/main/java/org/apache/nifi/components/state/StateProvider.java
deleted file mode 100644
index e1e4352..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/components/state/StateProvider.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.components.state;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.apache.nifi.components.ConfigurableComponent;
-
-/**
- * <p>
- * Provides a mechanism by which components can store and retrieve state. Depending on the Provider, the state
- * may be stored locally, or it may be stored on a remote resource.
- * </p>
- *
- * <p>
- * Which implementation should be used for local and clustered state is configured in the NiFi properties file.
- * It is therefore possible to provide custom implementations of this interface. Note, however, that this interface
- * is new as of version 0.5.0 of Apache NiFi and may not be considered "stable" as of yet. Therefore, it is subject
- * to change without notice, so providing custom implementations is cautioned against until the API becomes more stable.
- * </p>
- *
- * @since 0.5.0
- */
-public interface StateProvider extends ConfigurableComponent {
-
- /**
- * Initializes the StateProvider so that it is capable of being used. This method will be called
- * once before any of the other methods are called and will not be called again until the {@link #shutdown()}
- * method has been called
- *
- * @param context the initialization context that can be used to prepare the state provider for use
- */
- void initialize(StateProviderInitializationContext context) throws IOException;
-
- /**
- * Shuts down the StateProvider and cleans up any resources held by it. Once this method has returned, the
- * StateProvider may be initialized once again via the {@link #initialize(StateProviderInitializationContext)} method.
- */
- void shutdown();
-
- /**
- * Updates the value of the component's state, setting the new value to the
- * given state
- *
- * @param state the value to change the state to
- * @param componentId the id of the component for which state is being set
- *
- * @throws IOException if unable to communicate with the underlying storage mechanism
- */
- void setState(Map<String, String> state, String componentId) throws IOException;
-
-
- /**
- * Returns the currently configured state for the component. The returned StateMap will never be null.
- * The version of the StateMap will be -1 and the state will contain no key/value pairs if the state has never been set.
- *
- * @param componentId the id of the component for which state is to be retrieved
- * @return the currently configured value for the component's state
- *
- * @throws IOException if unable to communicate with the underlying storage mechanism
- */
- StateMap getState(String componentId) throws IOException;
-
-
- /**
- * Updates the value of the component's state to the new value if and only if the value currently
- * is the same as the given oldValue.
- *
- * @param oldValue the old value to compare against
- * @param newValue the new value to use if and only if the state's value is the same as the given oldValue
- * @param componentId the id of the component for which state is being retrieved
- * @return <code>true</code> if the state was updated to the new value, <code>false</code> if the state's value was not
- * equal to oldValue
- *
- * @throws IOException if unable to communicate with the underlying storage mechanism
- */
- boolean replace(StateMap oldValue, Map<String, String> newValue, String componentId) throws IOException;
-
- /**
- * Removes all values from the component's state that is stored using the given scope
- *
- * @param componentId the id of the component for which state is being cleared
- *
- * @throws IOException if unable to communicate with the underlying storage mechanism
- */
- void clear(String componentId) throws IOException;
-
- /**
- * This method is called whenever a component is removed from the NiFi instance. This allows the State Provider to
- * perform tasks when a component is removed in order to clean up resources that may be associated with that component
- *
- * @param componentId the ID of the component that was added to the NiFi instance
- * @throws IOException if unable to perform the necessary cleanup
- */
- void onComponentRemoved(String componentId) throws IOException;
-
- /**
- * Notifies the state provider that it should begin servicing requests to store and retrieve state
- */
- void enable();
-
- /**
- * Notifies the state provider that it should stop servicing requests to store and retrieve state and instead throw a ProviderDisabledException if any request is made to do so
- */
- void disable();
-
- /**
- * @return <code>true</code> if the provider is enabled, <code>false</code> otherwise.
- */
- boolean isEnabled();
-
- /**
- * Provides a listing of {@link Scope}s supported by the StateProvider
- * @return the {@link Scope}s supported by the configuration
- */
- Scope[] getSupportedScopes();
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/components/state/StateProviderInitializationContext.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/components/state/StateProviderInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/components/state/StateProviderInitializationContext.java
deleted file mode 100644
index aaf5490..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/components/state/StateProviderInitializationContext.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.components.state;
-
-import java.util.Map;
-
-import javax.net.ssl.SSLContext;
-
-import org.apache.nifi.components.PropertyDescriptor;
-import org.apache.nifi.components.PropertyValue;
-
-/**
- * This interface defines an initialization context that is passed to a {@link StateProvider} when it
- * is initialized.
- */
-public interface StateProviderInitializationContext {
- /**
- * @return the identifier if the StateProvider
- */
- String getIdentifier();
-
- /**
- * @return a Map of Property Descriptors to their configured values
- */
- Map<PropertyDescriptor, PropertyValue> getProperties();
-
- /**
- * Returns the configured value for the given property
- *
- * @param property the property to retrieve the value for
- *
- * @return the configured value for the property.
- */
- PropertyValue getProperty(PropertyDescriptor property);
-
- /**
- * @return the SSL Context that should be used to communicate with remote resources,
- * or <code>null</code> if no SSLContext has been configured
- */
- SSLContext getSSLContext();
-}
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/components/state/exception/StateTooLargeException.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/components/state/exception/StateTooLargeException.java b/nifi-api/src/main/java/org/apache/nifi/components/state/exception/StateTooLargeException.java
index 99546ae..5461b40 100644
--- a/nifi-api/src/main/java/org/apache/nifi/components/state/exception/StateTooLargeException.java
+++ b/nifi-api/src/main/java/org/apache/nifi/components/state/exception/StateTooLargeException.java
@@ -17,6 +17,8 @@
package org.apache.nifi.components.state.exception;
+import org.apache.nifi.components.state.StateManager;
+
import java.io.IOException;
/**
http://git-wip-us.apache.org/repos/asf/nifi/blob/d1129706/nifi-api/src/main/java/org/apache/nifi/controller/Snippet.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/controller/Snippet.java b/nifi-api/src/main/java/org/apache/nifi/controller/Snippet.java
deleted file mode 100644
index 702b7cd..0000000
--- a/nifi-api/src/main/java/org/apache/nifi/controller/Snippet.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.nifi.controller;
-
-import org.apache.nifi.web.Revision;
-
-import java.util.Map;
-
-/**
- * A Snippet represents a segment of the flow
- */
-public interface Snippet {
-
- /**
- * @return id of this snippet
- */
- public String getId();
-
- /**
- * @return parent group id of the components in this snippet
- */
- public String getParentGroupId();
-
- /**
- * @return connections in this snippet
- */
- public Map<String, Revision> getConnections();
-
- /**
- * @return funnels in this snippet
- */
- public Map<String, Revision> getFunnels();
-
- /**
- * @return input ports in this snippet
- */
- public Map<String, Revision> getInputPorts();
-
- /**
- * @return output ports in this snippet
- */
- public Map<String, Revision> getOutputPorts();
-
- /**
- * @return labels in this snippet
- */
- public Map<String, Revision> getLabels();
-
- /**
- * @return the identifiers of all ProcessGroups in this Snippet
- */
- public Map<String, Revision> getProcessGroups();
-
- /**
- * @return the identifiers of all Processors in this Snippet
- */
- public Map<String, Revision> getProcessors();
-
- /**
- * @return the identifiers of all RemoteProcessGroups in this Snippet
- */
- public Map<String, Revision> getRemoteProcessGroups();
-
- /**
- * @return Determines if this snippet is empty
- */
- public boolean isEmpty();
-
-}