http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/ProvenanceOptionsEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/ProvenanceOptionsEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/ProvenanceOptionsEntity.java deleted file mode 100644 index 01591cb..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/ProvenanceOptionsEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.apache.nifi.web.api.dto.provenance.ProvenanceOptionsDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a ProvenanceOptionsDTO. - */ -@XmlRootElement(name = "provenanceOptionsEntity") -public class ProvenanceOptionsEntity extends Entity { - - private ProvenanceOptionsDTO provenanceOptions; - - /** - * The ProvenanceOptionsDTO that is being serialized. - * - * @return The ProvenanceOptionsDTO object - */ - public ProvenanceOptionsDTO getProvenanceOptions() { - return provenanceOptions; - } - - public void setProvenanceOptions(ProvenanceOptionsDTO provenanceOptions) { - this.provenanceOptions = provenanceOptions; - } - -}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupEntity.java deleted file mode 100644 index 62a84d6..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a RemoteProcessGroupDTO. - */ -@XmlRootElement(name = "remoteProcessGroupEntity") -public class RemoteProcessGroupEntity extends Entity { - - private RemoteProcessGroupDTO remoteProcessGroup; - - /** - * The RemoteProcessGroupDTO that is being serialized. - * - * @return The RemoteProcessGroupDTO object - */ - public RemoteProcessGroupDTO getRemoteProcessGroup() { - return remoteProcessGroup; - } - - public void setRemoteProcessGroup(RemoteProcessGroupDTO remoteProcessGroup) { - this.remoteProcessGroup = remoteProcessGroup; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupPortEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupPortEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupPortEntity.java deleted file mode 100644 index f310b5e..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupPortEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a RemoteProcessGroupPortDTO. - */ -@XmlRootElement(name = "remoteProcessGroupPortEntity") -public class RemoteProcessGroupPortEntity extends Entity { - - private RemoteProcessGroupPortDTO remoteProcessGroupPort; - - /** - * The RemoteProcessGroupPortDTO that is being serialized. - * - * @return The RemoteProcessGroupPortDTO object - */ - public RemoteProcessGroupPortDTO getRemoteProcessGroupPort() { - return remoteProcessGroupPort; - } - - public void setRemoteProcessGroupPort(RemoteProcessGroupPortDTO remoteProcessGroupPort) { - this.remoteProcessGroupPort = remoteProcessGroupPort; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupsEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupsEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupsEntity.java deleted file mode 100644 index a04c789..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/RemoteProcessGroupsEntity.java +++ /dev/null @@ -1,47 +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.web.api.entity; - -import java.util.Set; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a response to the API. This particular entity holds a reference to a list of - * RemoteProcessGroupDTOs. - */ -@XmlRootElement(name = "remoteProcessGroupsEntity") -public class RemoteProcessGroupsEntity extends Entity { - - private Set<RemoteProcessGroupDTO> remoteProcessGroups; - - /** - * The collection of RemoteProcessGroupDTOs that are being serialized. - * - * @return - */ - public Set<RemoteProcessGroupDTO> getRemoteProcessGroups() { - return remoteProcessGroups; - } - - public void setRemoteProcessGroups(Set<RemoteProcessGroupDTO> remoteProcessGroups) { - this.remoteProcessGroups = remoteProcessGroups; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SearchResultsEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SearchResultsEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SearchResultsEntity.java deleted file mode 100644 index 6b9a88b..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SearchResultsEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.search.SearchResultsDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to ProcessorSearchResultDTOs, RemoteProcessGroupSearchResultDTOs, - * and ConnectionSearchResultDTOs. - */ -@XmlRootElement(name = "searchResultsEntity") -public class SearchResultsEntity { - - private SearchResultsDTO searchResultsDTO; - - /** - * The search results. - * - * @return - */ - public SearchResultsDTO getSearchResultsDTO() { - return searchResultsDTO; - } - - public void setSearchResultsDTO(SearchResultsDTO searchResultsDTO) { - this.searchResultsDTO = searchResultsDTO; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SnippetEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SnippetEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SnippetEntity.java deleted file mode 100644 index a9b05a1..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SnippetEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.SnippetDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a SnippetDTO. - */ -@XmlRootElement(name = "snippetEntity") -public class SnippetEntity extends Entity { - - private SnippetDTO snippet; - - /** - * The SnippetDTO that is being serialized. - * - * @return The SnippetDTO object - */ - public SnippetDTO getSnippet() { - return snippet; - } - - public void setSnippet(SnippetDTO snippet) { - this.snippet = snippet; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/StatusHistoryEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/StatusHistoryEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/StatusHistoryEntity.java deleted file mode 100644 index d3c2247..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/StatusHistoryEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.status.StatusHistoryDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a StatusHistoryDTO. - */ -@XmlRootElement(name = "statusHistoryEntity") -public class StatusHistoryEntity extends Entity { - - private StatusHistoryDTO statusHistory; - - /** - * The StatusHistoryDTO that is being serialized. - * - * @return The StatusHistoryDTO object - */ - public StatusHistoryDTO getStatusHistory() { - return statusHistory; - } - - public void setStatusHistory(StatusHistoryDTO statusHistory) { - this.statusHistory = statusHistory; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SystemDiagnosticsEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SystemDiagnosticsEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SystemDiagnosticsEntity.java deleted file mode 100644 index e7baa16..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/SystemDiagnosticsEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.SystemDiagnosticsDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a SystemDiagnosticsDTO. - */ -@XmlRootElement(name = "systemDiagnosticsEntity") -public class SystemDiagnosticsEntity extends Entity { - - private SystemDiagnosticsDTO systemDiagnostics; - - /** - * The SystemDiagnosticsDTO that is being serialized. - * - * @return The SystemDiagnosticsDTO object - */ - public SystemDiagnosticsDTO getSystemDiagnostics() { - return systemDiagnostics; - } - - public void setSystemDiagnostics(SystemDiagnosticsDTO health) { - this.systemDiagnostics = health; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplateEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplateEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplateEntity.java deleted file mode 100644 index 8e9f07a..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplateEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.TemplateDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a TemplateDTO. - */ -@XmlRootElement(name = "templateEntity") -public class TemplateEntity extends Entity { - - private TemplateDTO template; - - /** - * The TemplateDTO that is being serialized. - * - * @return The TemplateDTO object - */ - public TemplateDTO getTemplate() { - return template; - } - - public void setTemplate(TemplateDTO template) { - this.template = template; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplatesEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplatesEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplatesEntity.java deleted file mode 100644 index 3400045..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/TemplatesEntity.java +++ /dev/null @@ -1,63 +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.web.api.entity; - -import java.util.Date; -import java.util.Set; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.apache.nifi.web.api.dto.TemplateDTO; -import org.apache.nifi.web.api.dto.util.TimeAdapter; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a set of TemplateDTOs. - */ -@XmlRootElement(name = "templatesEntity") -public class TemplatesEntity extends Entity { - - private Set<TemplateDTO> templates; - private Date generated; - - /** - * The set of TemplateDTOs that is being serialized. - * - * @return The TemplateDTO object - */ - public Set<TemplateDTO> getTemplates() { - return templates; - } - - public void setTemplates(Set<TemplateDTO> templates) { - this.templates = templates; - } - - /** - * When this content was generated. - * - * @return - */ - @XmlJavaTypeAdapter(TimeAdapter.class) - public Date getGenerated() { - return generated; - } - - public void setGenerated(Date generated) { - this.generated = generated; - } -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserEntity.java deleted file mode 100644 index 963e853..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.UserDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a UserDTO. - */ -@XmlRootElement(name = "userEntity") -public class UserEntity extends Entity { - - private UserDTO user; - - /** - * The UserDTO that is being serialized. - * - * @return The UserDTO object - */ - public UserDTO getUser() { - return user; - } - - public void setUser(UserDTO user) { - this.user = user; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserGroupEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserGroupEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserGroupEntity.java deleted file mode 100644 index a6542c8..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserGroupEntity.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.web.api.entity; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.UserGroupDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a UserGroupDTO. - */ -@XmlRootElement(name = "userGroupEntity") -public class UserGroupEntity extends Entity { - - private UserGroupDTO userGroup; - - /** - * The UserGroupDTO that is being serialized. - * - * @return The UserGroupDTO object - */ - public UserGroupDTO getUserGroup() { - return userGroup; - } - - public void setUserGroup(UserGroupDTO userGroup) { - this.userGroup = userGroup; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserSearchResultsEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserSearchResultsEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserSearchResultsEntity.java deleted file mode 100644 index baffe15..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UserSearchResultsEntity.java +++ /dev/null @@ -1,61 +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.web.api.entity; - -import java.util.List; -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.web.api.dto.search.UserGroupSearchResultDTO; -import org.apache.nifi.web.api.dto.search.UserSearchResultDTO; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to UserSearchResultDTOs and UserGroupSearchResultDTOs. - */ -@XmlRootElement(name = "userSearchResultsEntity") -public class UserSearchResultsEntity { - - private List<UserSearchResultDTO> userResults; - private List<UserGroupSearchResultDTO> userGroupResults; - - /** - * The user search results. - * - * @return - */ - public List<UserSearchResultDTO> getUserResults() { - return userResults; - } - - public void setUserResults(List<UserSearchResultDTO> userResults) { - this.userResults = userResults; - } - - /** - * The user group search results. - * - * @return - */ - public List<UserGroupSearchResultDTO> getUserGroupResults() { - return userGroupResults; - } - - public void setUserGroupResults(List<UserGroupSearchResultDTO> userGroupResults) { - this.userGroupResults = userGroupResults; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UsersEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UsersEntity.java b/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UsersEntity.java deleted file mode 100644 index 2d11d1f..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/entity/UsersEntity.java +++ /dev/null @@ -1,64 +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.web.api.entity; - -import java.util.Collection; -import java.util.Date; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.apache.nifi.web.api.dto.UserDTO; -import org.apache.nifi.web.api.dto.util.TimeAdapter; - -/** - * A serialized representation of this class can be placed in the entity body of - * a request or response to or from the API. This particular entity holds a - * reference to a collection of UserDTO. - */ -@XmlRootElement(name = "usersEntity") -public class UsersEntity extends Entity { - - private Collection<UserDTO> users; - private Date generated; - - /** - * The collection of UserDTOs that are being serialized. - * - * @return The UserDTO object - */ - public Collection<UserDTO> getUsers() { - return users; - } - - public void setUsers(Collection<UserDTO> users) { - this.users = users; - } - - /** - * When this content was generated. - * - * @return - */ - @XmlJavaTypeAdapter(TimeAdapter.class) - public Date getGenerated() { - return generated; - } - - public void setGenerated(Date generated) { - this.generated = generated; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/.gitignore ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/.gitignore b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/.gitignore deleted file mode 100755 index ea8c4bf..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/pom.xml ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/pom.xml b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/pom.xml deleted file mode 100644 index 87ab54d..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.nifi</groupId> - <artifactId>nifi-framework-parent</artifactId> - <version>0.0.1-incubating-SNAPSHOT</version> - </parent> - - <artifactId>cluster-authorization-provider</artifactId> - <name>NiFi Framework Cluster Authority Provider</name> - <dependencies> - <dependency> - <groupId>org.apache.nifi</groupId> - <artifactId>nifi-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.nifi</groupId> - <artifactId>file-authorization-provider</artifactId> - </dependency> - <dependency> - <groupId>org.apache.nifi</groupId> - <artifactId>framework-cluster-protocol</artifactId> - </dependency> - <dependency> - <groupId>org.apache.nifi</groupId> - <artifactId>framework-cluster</artifactId> - </dependency> - <dependency> - <groupId>org.apache.nifi</groupId> - <artifactId>nifi-socket-utils</artifactId> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/ClusterManagerAuthorizationProvider.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/ClusterManagerAuthorizationProvider.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/ClusterManagerAuthorizationProvider.java deleted file mode 100644 index 2b3b38c..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/ClusterManagerAuthorizationProvider.java +++ /dev/null @@ -1,225 +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.cluster.authorization; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Socket; -import org.apache.nifi.authorization.AuthorityProvider; -import org.apache.nifi.authorization.AuthorityProviderConfigurationContext; -import org.apache.nifi.authorization.AuthorityProviderInitializationContext; -import org.apache.nifi.authorization.FileAuthorizationProvider; -import org.apache.nifi.authorization.annotation.AuthorityProviderContext; -import org.apache.nifi.authorization.exception.ProviderCreationException; -import org.apache.nifi.authorization.exception.ProviderDestructionException; -import org.apache.nifi.cluster.authorization.protocol.message.DoesDnExistMessage; -import org.apache.nifi.cluster.authorization.protocol.message.GetAuthoritiesMessage; -import org.apache.nifi.cluster.authorization.protocol.message.GetGroupForUserMessage; -import org.apache.nifi.cluster.authorization.protocol.message.ProtocolMessage; -import static org.apache.nifi.cluster.authorization.protocol.message.ProtocolMessage.MessageType.DOES_DN_EXIST; -import static org.apache.nifi.cluster.authorization.protocol.message.ProtocolMessage.MessageType.GET_AUTHORITIES; -import static org.apache.nifi.cluster.authorization.protocol.message.ProtocolMessage.MessageType.GET_GROUP_FOR_USER; -import org.apache.nifi.cluster.authorization.protocol.message.jaxb.JaxbProtocolUtils; -import org.apache.nifi.cluster.manager.impl.WebClusterManager; -import org.apache.nifi.cluster.protocol.ProtocolContext; -import org.apache.nifi.cluster.protocol.ProtocolMessageMarshaller; -import org.apache.nifi.cluster.protocol.ProtocolMessageUnmarshaller; -import org.apache.nifi.cluster.protocol.jaxb.JaxbProtocolContext; -import org.apache.nifi.io.socket.ServerSocketConfiguration; -import org.apache.nifi.io.socket.SocketListener; -import org.apache.nifi.io.socket.SocketUtils; -import org.apache.nifi.io.socket.multicast.DiscoverableService; -import org.apache.nifi.io.socket.multicast.DiscoverableServiceImpl; -import org.apache.nifi.logging.NiFiLog; -import org.apache.nifi.util.NiFiProperties; -import static org.apache.nifi.util.NiFiProperties.CLUSTER_MANAGER_ADDRESS; -import org.apache.nifi.util.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; - -/** - * Provides authorities for the NCM in clustered environments. Communication - * occurs over TCP/IP sockets. All method calls are deferred to the - * FileAuthorizationProvider. - */ -public class ClusterManagerAuthorizationProvider extends FileAuthorizationProvider implements AuthorityProvider, ApplicationContextAware { - - public static final String AUTHORITY_PROVIDER_SERVIVE_NAME = "cluster-authority-provider"; - - private static final Logger logger = new NiFiLog(LoggerFactory.getLogger(ClusterManagerAuthorizationProvider.class)); - private static final String CLUSTER_MANAGER_AUTHORITY_PROVIDER_PORT = "Authority Provider Port"; - private static final String CLUSTER_MANAGER_AUTHORITY_PROVIDER_THREADS = "Authority Provider Threads"; - private static final int DEFAULT_CLUSTER_MANAGER_AUTHORITY_PROVIDER_THREADS = 10; - - private WebClusterManager clusterManager; - private ProtocolContext<ProtocolMessage> authorityProviderProtocolContext; - private SocketListener socketListener; - private NiFiProperties properties; - private ApplicationContext applicationContext; - - @Override - public void initialize(final AuthorityProviderInitializationContext initializationContext) throws ProviderCreationException { - super.initialize(initializationContext); - } - - @Override - public void onConfigured(final AuthorityProviderConfigurationContext configurationContext) throws ProviderCreationException { - super.onConfigured(configurationContext); - - // get the socket address of the cluster authority provider - final InetSocketAddress clusterAuthorityProviderAddress = getClusterManagerAuthorityProviderAddress(configurationContext); - - // get the cluster manager - clusterManager = applicationContext.getBean("clusterManager", WebClusterManager.class); - - // if using multicast, then the authority provider's service is broadcasted - if (properties.getClusterProtocolUseMulticast()) { - - // create the authority provider service for discovery - final DiscoverableService clusterAuthorityProviderService = new DiscoverableServiceImpl(AUTHORITY_PROVIDER_SERVIVE_NAME, clusterAuthorityProviderAddress); - - // register the authority provider service with the cluster manager - clusterManager.addBroadcastedService(clusterAuthorityProviderService); - } - - // get the number of protocol listening thread - final int numThreads = getClusterManagerAuthorityProviderThreads(configurationContext); - - // the server socket configuration - final ServerSocketConfiguration configuration = applicationContext.getBean("protocolServerSocketConfiguration", ServerSocketConfiguration.class); - - // the authority provider listens for node messages - socketListener = new SocketListener(numThreads, clusterAuthorityProviderAddress.getPort(), configuration) { - @Override - public void dispatchRequest(final Socket socket) { - ClusterManagerAuthorizationProvider.this.dispatchRequest(socket); - } - }; - - // start the socket listener - if (socketListener != null && !socketListener.isRunning()) { - try { - socketListener.start(); - } catch (final IOException ioe) { - throw new ProviderCreationException("Failed to start Cluster Manager Authorization Provider due to: " + ioe, ioe); - } - } - - // initialize the protocol context - authorityProviderProtocolContext = new JaxbProtocolContext<ProtocolMessage>(JaxbProtocolUtils.JAXB_CONTEXT); - } - - @Override - public void preDestruction() throws ProviderDestructionException { - if (socketListener != null && socketListener.isRunning()) { - try { - socketListener.stop(); - } catch (final IOException ioe) { - throw new ProviderDestructionException("Failed to stop Cluster Manager Authorization Provider due to: " + ioe, ioe); - } - } - super.preDestruction(); - } - - private int getClusterManagerAuthorityProviderThreads(final AuthorityProviderConfigurationContext configurationContext) { - try { - return Integer.parseInt(configurationContext.getProperty(CLUSTER_MANAGER_AUTHORITY_PROVIDER_THREADS)); - } catch (NumberFormatException nfe) { - return DEFAULT_CLUSTER_MANAGER_AUTHORITY_PROVIDER_THREADS; - } - } - - private InetSocketAddress getClusterManagerAuthorityProviderAddress(final AuthorityProviderConfigurationContext configurationContext) { - try { - String socketAddress = properties.getProperty(CLUSTER_MANAGER_ADDRESS); - if (StringUtils.isBlank(socketAddress)) { - socketAddress = "localhost"; - } - return InetSocketAddress.createUnresolved(socketAddress, getClusterManagerAuthorityProviderPort(configurationContext)); - } catch (Exception ex) { - throw new RuntimeException("Invalid manager authority provider address/port due to: " + ex, ex); - } - } - - private Integer getClusterManagerAuthorityProviderPort(final AuthorityProviderConfigurationContext configurationContext) { - final String authorityProviderPort = configurationContext.getProperty(CLUSTER_MANAGER_AUTHORITY_PROVIDER_PORT); - if (authorityProviderPort == null || authorityProviderPort.trim().isEmpty()) { - throw new ProviderCreationException("The authority provider port must be specified."); - } - - return Integer.parseInt(authorityProviderPort); - } - - private void dispatchRequest(final Socket socket) { - try { - // unmarshall message - final ProtocolMessageUnmarshaller<ProtocolMessage> unmarshaller = authorityProviderProtocolContext.createUnmarshaller(); - final ProtocolMessage request = unmarshaller.unmarshal(socket.getInputStream()); - final ProtocolMessage response = request; - - try { - switch (request.getType()) { - case DOES_DN_EXIST: { - final DoesDnExistMessage castedMsg = (DoesDnExistMessage) request; - castedMsg.setResponse(doesDnExist(castedMsg.getDn())); - break; - } - case GET_AUTHORITIES: { - final GetAuthoritiesMessage castedMsg = (GetAuthoritiesMessage) request; - castedMsg.setResponse(getAuthorities(castedMsg.getDn())); - break; - } - case GET_GROUP_FOR_USER: { - final GetGroupForUserMessage castedMsg = (GetGroupForUserMessage) request; - castedMsg.setResponse(getGroupForUser(castedMsg.getDn())); - break; - } - default: { - throw new Exception("Unsupported Message Type: " + request.getType()); - } - } - } catch (final Exception ex) { - response.setExceptionClass(ex.getClass().getName()); - response.setExceptionMessage(ex.getMessage()); - } - - final ProtocolMessageMarshaller<ProtocolMessage> marshaller = authorityProviderProtocolContext.createMarshaller(); - marshaller.marshal(response, socket.getOutputStream()); - - } catch (final Exception e) { - logger.warn("Failed processing Socket Authorization Provider protocol message due to " + e, e); - } finally { - SocketUtils.closeQuietly(socket); - } - } - - @Override - @AuthorityProviderContext - public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; - } - - @Override - @AuthorityProviderContext - public void setNiFiProperties(NiFiProperties properties) { - super.setNiFiProperties(properties); - this.properties = properties; - } -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/NodeAuthorizationProvider.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/NodeAuthorizationProvider.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/NodeAuthorizationProvider.java deleted file mode 100644 index 840422f..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/NodeAuthorizationProvider.java +++ /dev/null @@ -1,389 +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.cluster.authorization; - -import org.apache.nifi.cluster.authorization.protocol.message.DoesDnExistMessage; -import org.apache.nifi.cluster.authorization.protocol.message.GetAuthoritiesMessage; -import org.apache.nifi.cluster.authorization.protocol.message.ProtocolMessage; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import org.apache.nifi.authorization.Authority; -import org.apache.nifi.authorization.AuthorityProvider; -import org.apache.nifi.authorization.AuthorityProviderConfigurationContext; -import org.apache.nifi.authorization.AuthorityProviderInitializationContext; -import org.apache.nifi.authorization.DownloadAuthorization; -import org.apache.nifi.authorization.annotation.AuthorityProviderContext; -import org.apache.nifi.authorization.exception.AuthorityAccessException; -import org.apache.nifi.authorization.exception.IdentityAlreadyExistsException; -import org.apache.nifi.authorization.exception.ProviderCreationException; -import org.apache.nifi.authorization.exception.ProviderDestructionException; -import org.apache.nifi.authorization.exception.UnknownIdentityException; -import org.apache.nifi.cluster.authorization.protocol.message.GetGroupForUserMessage; -import org.apache.nifi.cluster.authorization.protocol.message.jaxb.JaxbProtocolUtils; -import org.apache.nifi.io.socket.SocketConfiguration; -import org.apache.nifi.io.socket.SocketUtils; -import org.apache.nifi.io.socket.multicast.DiscoverableService; -import org.apache.nifi.cluster.protocol.ProtocolContext; -import org.apache.nifi.cluster.protocol.ProtocolMessageMarshaller; -import org.apache.nifi.cluster.protocol.ProtocolMessageUnmarshaller; -import org.apache.nifi.cluster.protocol.impl.ClusterServiceDiscovery; -import org.apache.nifi.cluster.protocol.impl.ClusterServiceLocator; -import org.apache.nifi.cluster.protocol.jaxb.JaxbProtocolContext; -import org.apache.nifi.io.socket.multicast.DiscoverableServiceImpl; -import org.apache.nifi.io.socket.multicast.MulticastConfiguration; -import org.apache.nifi.logging.NiFiLog; -import org.apache.nifi.util.NiFiProperties; -import static org.apache.nifi.util.NiFiProperties.CLUSTER_NODE_UNICAST_MANAGER_ADDRESS; -import org.apache.nifi.util.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; - -/** - * Provides authorities for nodes in clustered environments. Communication - * occurs over TCP/IP sockets. All method calls are communicated to the cluster - * manager provider via socket. - */ -public class NodeAuthorizationProvider implements AuthorityProvider, ApplicationContextAware { - - private static final Logger logger = new NiFiLog(LoggerFactory.getLogger(NodeAuthorizationProvider.class)); - private static final String CLUSTER_NODE_MANAGER_AUTHORITY_PROVIDER_PORT = "Cluster Manager Authority Provider Port"; - - private ProtocolContext<ProtocolMessage> authorityProviderProtocolContext; - private SocketConfiguration socketConfiguration; - private ClusterServiceLocator serviceLocator; - private ApplicationContext applicationContext; - private NiFiProperties properties; - - @Override - public void initialize(AuthorityProviderInitializationContext initializationContext) throws ProviderCreationException { - } - - @Override - public void onConfigured(final AuthorityProviderConfigurationContext configurationContext) throws ProviderCreationException { - // TODO clear user cache? - - // if using multicast, then the authority provider's service is broadcasted - if (properties.getClusterProtocolUseMulticast()) { - // create the service discovery - final ClusterServiceDiscovery serviceDiscovery = new ClusterServiceDiscovery( - ClusterManagerAuthorizationProvider.AUTHORITY_PROVIDER_SERVIVE_NAME, - properties.getClusterProtocolMulticastAddress(), - applicationContext.getBean("protocolMulticastConfiguration", MulticastConfiguration.class), - applicationContext.getBean("protocolContext", ProtocolContext.class)); - - // create service location configuration - final ClusterServiceLocator.AttemptsConfig config = new ClusterServiceLocator.AttemptsConfig(); - config.setNumAttempts(3); - config.setTimeBetweenAttempts(1); - config.setTimeBetweenAttempsUnit(TimeUnit.SECONDS); - - serviceLocator = new ClusterServiceLocator(serviceDiscovery); - serviceLocator.setAttemptsConfig(config); - } else { - final InetSocketAddress serviceAddress = getClusterNodeManagerAuthorityProviderAddress(configurationContext); - final DiscoverableService service = new DiscoverableServiceImpl(ClusterManagerAuthorizationProvider.AUTHORITY_PROVIDER_SERVIVE_NAME, serviceAddress); - serviceLocator = new ClusterServiceLocator(service); - } - - try { - // start the service locator - serviceLocator.start(); - } catch (final IOException ioe) { - throw new ProviderCreationException(ioe); - } - - // the socket configuration - socketConfiguration = applicationContext.getBean("protocolSocketConfiguration", SocketConfiguration.class); - - // initialize the protocol context - authorityProviderProtocolContext = new JaxbProtocolContext<ProtocolMessage>(JaxbProtocolUtils.JAXB_CONTEXT); - } - - private InetSocketAddress getClusterNodeManagerAuthorityProviderAddress(final AuthorityProviderConfigurationContext configurationContext) { - try { - String socketAddress = properties.getProperty(CLUSTER_NODE_UNICAST_MANAGER_ADDRESS); - if (StringUtils.isBlank(socketAddress)) { - socketAddress = "localhost"; - } - return InetSocketAddress.createUnresolved(socketAddress, getClusterNodeManagerAuthorityProviderPort(configurationContext)); - } catch (Exception ex) { - throw new ProviderCreationException("Invalid cluster manager authority provider address/port due to: " + ex, ex); - } - } - - private Integer getClusterNodeManagerAuthorityProviderPort(final AuthorityProviderConfigurationContext configurationContext) { - final String nodeAuthorityProviderPort = configurationContext.getProperty(CLUSTER_NODE_MANAGER_AUTHORITY_PROVIDER_PORT); - if (nodeAuthorityProviderPort == null || nodeAuthorityProviderPort.trim().isEmpty()) { - throw new ProviderCreationException("The cluster manager authority provider port must be specified."); - } - - return Integer.parseInt(nodeAuthorityProviderPort); - } - - @Override - public void setAuthorities(String dn, Set<Authority> authorities) throws AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to set user authorities."); - } - - @Override - public void addUser(String dn, String group) throws IdentityAlreadyExistsException, AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to add users."); - } - - @Override - public boolean doesDnExist(String dn) throws AuthorityAccessException { - // create message - final DoesDnExistMessage msg = new DoesDnExistMessage(); - msg.setDn(dn); - - Socket socket = null; - try { - - final InetSocketAddress socketAddress = getServiceAddress(); - if (socketAddress == null) { - throw new AuthorityAccessException("Cluster Authority Provider's address is not known."); - } - - try { - // create a socket - socket = SocketUtils.createSocket(socketAddress, socketConfiguration); - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed to create socket due to: " + ioe, ioe); - } - - try { - // marshal message to output stream - final ProtocolMessageMarshaller marshaller = authorityProviderProtocolContext.createMarshaller(); - marshaller.marshal(msg, socket.getOutputStream()); - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed marshalling '" + msg.getType() + "' protocol message due to: " + ioe, ioe); - } - - try { - - // unmarshall response and return - final ProtocolMessageUnmarshaller<ProtocolMessage> unmarshaller = authorityProviderProtocolContext.createUnmarshaller(); - final DoesDnExistMessage response = (DoesDnExistMessage) unmarshaller.unmarshal(socket.getInputStream()); - - // check if there was an exception - if (response.wasException()) { - throw new AuthorityAccessException(response.getExceptionMessage()); - } - - // return provider's response - return response.getResponse(); - - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed unmarshalling '" + msg.getType() + "' response protocol message due to: " + ioe, ioe); - } - - } finally { - SocketUtils.closeQuietly(socket); - } - } - - @Override - public Set<Authority> getAuthorities(String dn) throws UnknownIdentityException, AuthorityAccessException { - // create message - final GetAuthoritiesMessage msg = new GetAuthoritiesMessage(); - msg.setDn(dn); - - Socket socket = null; - try { - - final InetSocketAddress socketAddress = getServiceAddress(); - if (socketAddress == null) { - throw new AuthorityAccessException("Cluster Authority Provider's address is not known."); - } - - try { - // create a socket - socket = SocketUtils.createSocket(socketAddress, socketConfiguration); - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed to create socket due to: " + ioe, ioe); - } - - try { - // marshal message to output stream - final ProtocolMessageMarshaller marshaller = authorityProviderProtocolContext.createMarshaller(); - marshaller.marshal(msg, socket.getOutputStream()); - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed marshalling '" + msg.getType() + "' protocol message due to: " + ioe, ioe); - } - - try { - - // unmarshall response and return - final ProtocolMessageUnmarshaller<ProtocolMessage> unmarshaller = authorityProviderProtocolContext.createUnmarshaller(); - final GetAuthoritiesMessage response = (GetAuthoritiesMessage) unmarshaller.unmarshal(socket.getInputStream()); - - // check if there was an exception - if (response.wasException()) { - if (isException(UnknownIdentityException.class, response)) { - throw new UnknownIdentityException(response.getExceptionMessage()); - } else { - throw new AuthorityAccessException(response.getExceptionMessage()); - } - } - - // return provider's response - return response.getResponse(); - - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed unmarshalling '" + msg.getType() + "' response protocol message due to: " + ioe, ioe); - } - - } finally { - SocketUtils.closeQuietly(socket); - } - } - - @Override - public Set<String> getUsers(Authority authority) throws AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to get users for a given authority."); - } - - @Override - public void revokeUser(String dn) throws UnknownIdentityException, AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to revoke users."); - } - - @Override - public void setUsersGroup(Set<String> dns, String group) throws UnknownIdentityException, AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to set user groups."); - } - - @Override - public void ungroupUser(String dn) throws UnknownIdentityException, AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to ungroup users."); - } - - @Override - public void ungroup(String group) throws AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to ungroup."); - } - - @Override - public DownloadAuthorization authorizeDownload(List<String> dnChain, Map<String, String> attributes) throws UnknownIdentityException, AuthorityAccessException { - return DownloadAuthorization.approved(); - } - - @Override - public String getGroupForUser(String dn) throws UnknownIdentityException, AuthorityAccessException { - // create message - final GetGroupForUserMessage msg = new GetGroupForUserMessage(); - msg.setDn(dn); - - Socket socket = null; - try { - - final InetSocketAddress socketAddress = getServiceAddress(); - if (socketAddress == null) { - throw new AuthorityAccessException("Cluster Authority Provider's address is not known."); - } - - try { - // create a socket - socket = SocketUtils.createSocket(socketAddress, socketConfiguration); - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed to create socket due to: " + ioe, ioe); - } - - try { - // marshal message to output stream - final ProtocolMessageMarshaller marshaller = authorityProviderProtocolContext.createMarshaller(); - marshaller.marshal(msg, socket.getOutputStream()); - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed marshalling '" + msg.getType() + "' protocol message due to: " + ioe, ioe); - } - - try { - - // unmarshall response and return - final ProtocolMessageUnmarshaller<ProtocolMessage> unmarshaller = authorityProviderProtocolContext.createUnmarshaller(); - final GetGroupForUserMessage response = (GetGroupForUserMessage) unmarshaller.unmarshal(socket.getInputStream()); - - // check if there was an exception - if (response.wasException()) { - if (isException(UnknownIdentityException.class, response)) { - throw new UnknownIdentityException(response.getExceptionMessage()); - } else { - throw new AuthorityAccessException(response.getExceptionMessage()); - } - } - - return response.getResponse(); - } catch (final IOException ioe) { - throw new AuthorityAccessException("Failed unmarshalling '" + msg.getType() + "' response protocol message due to: " + ioe, ioe); - } - - } finally { - SocketUtils.closeQuietly(socket); - } - } - - @Override - public void revokeGroup(String group) throws UnknownIdentityException, AuthorityAccessException { - throw new AuthorityAccessException("Nodes are not allowed to revoke groups."); - } - - @Override - public void preDestruction() throws ProviderDestructionException { - try { - if (serviceLocator != null && serviceLocator.isRunning()) { - serviceLocator.stop(); - } - } catch (final IOException ioe) { - throw new ProviderDestructionException(ioe); - } - } - - @Override - @AuthorityProviderContext - public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; - } - - @AuthorityProviderContext - public void setNiFiProperties(NiFiProperties properties) { - this.properties = properties; - } - - private InetSocketAddress getServiceAddress() { - final DiscoverableService service = serviceLocator.getService(); - if (service != null) { - return service.getServiceAddress(); - } - return null; - } - - private boolean isException(final Class<? extends Exception> exception, final ProtocolMessage protocolMessage) { - if (protocolMessage.wasException()) { - return exception.getName().equals(protocolMessage.getExceptionClass()); - } else { - return false; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/DoesDnExistMessage.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/DoesDnExistMessage.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/DoesDnExistMessage.java deleted file mode 100644 index 38d0dd8..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/DoesDnExistMessage.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.cluster.authorization.protocol.message; - -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.cluster.authorization.protocol.message.ProtocolMessage.MessageType; - -/** - * @author unattributed - */ -@XmlRootElement(name = "doesDnExistMessage") -public class DoesDnExistMessage extends ProtocolMessage { - - private String dn; - - private boolean response; - - public DoesDnExistMessage() { - } - - @Override - public MessageType getType() { - return MessageType.DOES_DN_EXIST; - } - - public String getDn() { - return dn; - } - - public void setDn(String dn) { - this.dn = dn; - } - - public boolean getResponse() { - return response; - } - - public void setResponse(boolean response) { - this.response = response; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetAuthoritiesMessage.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetAuthoritiesMessage.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetAuthoritiesMessage.java deleted file mode 100644 index 347163f..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetAuthoritiesMessage.java +++ /dev/null @@ -1,58 +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.cluster.authorization.protocol.message; - -import java.util.HashSet; -import java.util.Set; -import javax.xml.bind.annotation.XmlRootElement; -import org.apache.nifi.authorization.Authority; - -/** - * @author unattributed - */ -@XmlRootElement(name = "getAuthoritiesMessage") -public class GetAuthoritiesMessage extends ProtocolMessage { - - private String dn; - - private Set<Authority> response = new HashSet<>(); - - public GetAuthoritiesMessage() { - } - - @Override - public MessageType getType() { - return MessageType.GET_AUTHORITIES; - } - - public String getDn() { - return dn; - } - - public void setDn(String dn) { - this.dn = dn; - } - - public Set<Authority> getResponse() { - return response; - } - - public void setResponse(Set<Authority> response) { - this.response = response; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetGroupForUserMessage.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetGroupForUserMessage.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetGroupForUserMessage.java deleted file mode 100644 index 717f244..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/GetGroupForUserMessage.java +++ /dev/null @@ -1,55 +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.cluster.authorization.protocol.message; - -import javax.xml.bind.annotation.XmlRootElement; - -/** - * @author unattributed - */ -@XmlRootElement(name = "getGroupForUserMessage") -public class GetGroupForUserMessage extends ProtocolMessage { - - private String dn; - - private String response; - - public GetGroupForUserMessage() { - } - - @Override - public MessageType getType() { - return MessageType.GET_GROUP_FOR_USER; - } - - public String getDn() { - return dn; - } - - public void setDn(String dn) { - this.dn = dn; - } - - public String getResponse() { - return response; - } - - public void setResponse(String response) { - this.response = response; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/ProtocolMessage.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/ProtocolMessage.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/ProtocolMessage.java deleted file mode 100644 index 102142a..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/ProtocolMessage.java +++ /dev/null @@ -1,57 +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.cluster.authorization.protocol.message; - -/** - * @author unattributed - */ -public abstract class ProtocolMessage { - - private String exceptionClass; - private String exceptionMessage; - - public static enum MessageType { - - DOES_DN_EXIST, - GET_AUTHORITIES, - GET_USERS, - GET_GROUP_FOR_USER - } - - public abstract MessageType getType(); - - public boolean wasException() { - return exceptionClass != null; - } - - public String getExceptionMessage() { - return exceptionMessage; - } - - public void setExceptionMessage(final String exceptionMessage) { - this.exceptionMessage = exceptionMessage; - } - - public String getExceptionClass() { - return exceptionClass; - } - - public void setExceptionClass(String exceptionClass) { - this.exceptionClass = exceptionClass; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/JaxbProtocolUtils.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/JaxbProtocolUtils.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/JaxbProtocolUtils.java deleted file mode 100644 index 97a1bc7..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/JaxbProtocolUtils.java +++ /dev/null @@ -1,42 +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.cluster.authorization.protocol.message.jaxb; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; - -/** - * @author unattributed - */ -public final class JaxbProtocolUtils { - - public static final String JAXB_CONTEXT_PATH = ObjectFactory.class.getPackage().getName(); - - public static final JAXBContext JAXB_CONTEXT = initializeJaxbContext(); - - /** - * Load the JAXBContext version. - */ - private static JAXBContext initializeJaxbContext() { - try { - return JAXBContext.newInstance(JAXB_CONTEXT_PATH); - } catch (JAXBException e) { - throw new RuntimeException("Unable to create JAXBContext."); - } - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/ObjectFactory.java ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/ObjectFactory.java b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/ObjectFactory.java deleted file mode 100644 index 5cde335..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/java/org/apache/nifi/cluster/authorization/protocol/message/jaxb/ObjectFactory.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.cluster.authorization.protocol.message.jaxb; - -import javax.xml.bind.annotation.XmlRegistry; -import org.apache.nifi.cluster.authorization.protocol.message.DoesDnExistMessage; -import org.apache.nifi.cluster.authorization.protocol.message.GetAuthoritiesMessage; -import org.apache.nifi.cluster.authorization.protocol.message.GetGroupForUserMessage; - -/** - * @author unattributed - */ -@XmlRegistry -public class ObjectFactory { - - public ObjectFactory() { - } - - public DoesDnExistMessage createDoesDnExistMessage() { - return new DoesDnExistMessage(); - } - - public GetAuthoritiesMessage createGetAuthoritiesMessage() { - return new GetAuthoritiesMessage(); - } - - public GetGroupForUserMessage createGetGroupForUserMessage() { - return new GetGroupForUserMessage(); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/resources/META-INF/services/org.apache.nifi.authorization.AuthorityProvider ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/resources/META-INF/services/org.apache.nifi.authorization.AuthorityProvider b/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/resources/META-INF/services/org.apache.nifi.authorization.AuthorityProvider deleted file mode 100644 index 56f4c3e..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-authorization-provider/src/main/resources/META-INF/services/org.apache.nifi.authorization.AuthorityProvider +++ /dev/null @@ -1,16 +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. -org.apache.nifi.cluster.authorization.ClusterManagerAuthorizationProvider -org.apache.nifi.cluster.authorization.NodeAuthorizationProvider \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f6d9354b/nifi/nar-bundles/framework-bundle/framework/cluster-protocol/.gitignore ---------------------------------------------------------------------- diff --git a/nifi/nar-bundles/framework-bundle/framework/cluster-protocol/.gitignore b/nifi/nar-bundles/framework-bundle/framework/cluster-protocol/.gitignore deleted file mode 100755 index ea8c4bf..0000000 --- a/nifi/nar-bundles/framework-bundle/framework/cluster-protocol/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target
