Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F46F11043 for ; Mon, 22 Sep 2014 20:45:00 +0000 (UTC) Received: (qmail 32529 invoked by uid 500); 22 Sep 2014 20:45:00 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 32435 invoked by uid 500); 22 Sep 2014 20:45:00 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 32334 invoked by uid 99); 22 Sep 2014 20:44:59 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 20:44:59 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AB9F99D1C82; Mon, 22 Sep 2014 20:44:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Mon, 22 Sep 2014 20:45:02 -0000 Message-Id: <5d8b6e3ca4f6420a818c71a88c8af96d@git.apache.org> In-Reply-To: <12decd9df2b541f7a19448094b3bf03d@git.apache.org> References: <12decd9df2b541f7a19448094b3bf03d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/15] git commit: ACCUMULO-652 removed unused (and now broken) classes ACCUMULO-652 removed unused (and now broken) classes git-svn-id: https://svn.apache.org/repos/asf/accumulo/branches/ACCUMULO-652@1354476 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/80ee809a Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/80ee809a Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/80ee809a Branch: refs/heads/ACCUMULO-652 Commit: 80ee809a8d3e47a4fd20b4059cbd37a9db0b5579 Parents: 3fcd07d Author: Adam Fuchs Authored: Wed Jun 27 12:49:32 2012 +0000 Committer: Adam Fuchs Committed: Wed Jun 27 12:49:32 2012 +0000 ---------------------------------------------------------------------- .../core/security/VisibilityEvaluator.java | 71 -------------------- .../core/security/VisibilityInterpreter.java | 34 ---------- .../security/VisibilityInterpreterFactory.java | 40 ----------- .../core/security/VisibilityParseException.java | 34 ---------- 4 files changed, 179 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/80ee809a/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java b/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java deleted file mode 100644 index 62bb167..0000000 --- a/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java +++ /dev/null @@ -1,71 +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.accumulo.core.security; - -import java.util.Collection; - -import org.apache.accumulo.core.data.ArrayByteSequence; -import org.apache.accumulo.core.security.ColumnVisibility.Node; - -public class VisibilityEvaluator { - private Authorizations auths; - - VisibilityEvaluator(Collection authorizations) { - this.auths = new Authorizations(authorizations); - } - - /** - * The VisibilityEvaluator computes a trie from the given Authorizations, that ColumnVisibility expressions can be evaluated against. - */ - public VisibilityEvaluator(Authorizations authorizations) { - this.auths = authorizations; - } - - public Authorizations getAuthorizations() { - return new Authorizations(auths.getAuthorizations()); - } - - public boolean evaluate(ColumnVisibility visibility) throws VisibilityParseException { - return evaluate(visibility.getExpression(), visibility.getParseTree()); - } - - private final boolean evaluate(final byte[] expression, final Node root) throws VisibilityParseException { - switch (root.type) { - case TERM: - int len = root.getTermEnd() - root.getTermStart(); - return auths.contains(new ArrayByteSequence(expression, root.getTermStart(), len)); - case AND: - if (root.children == null || root.children.size() < 2) - throw new VisibilityParseException("AND has less than 2 children", expression, root.start); - for (Node child : root.children) { - if (!evaluate(expression, child)) - return false; - } - return true; - case OR: - if (root.children == null || root.children.size() < 2) - throw new VisibilityParseException("OR has less than 2 children", expression, root.start); - for (Node child : root.children) { - if (evaluate(expression, child)) - return true; - } - return false; - default: - throw new VisibilityParseException("No such node type", expression, root.start); - } - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/80ee809a/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreter.java b/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreter.java deleted file mode 100644 index 68de07f..0000000 --- a/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreter.java +++ /dev/null @@ -1,34 +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.accumulo.core.security; - -import java.io.Serializable; - -public interface VisibilityInterpreter extends Serializable { - public abstract String getAbbreviatedValue(); - - public abstract String getFullValue(); - - public abstract void merge(ColumnVisibility other, Authorizations authorizations); - - public abstract void merge(VisibilityInterpreter other); - - // Factory type method that can be used from an instance - public abstract VisibilityInterpreter create(); - - public abstract VisibilityInterpreter create(ColumnVisibility visibility, Authorizations authorizations); -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/80ee809a/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreterFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreterFactory.java b/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreterFactory.java deleted file mode 100644 index 994087e..0000000 --- a/core/src/main/java/org/apache/accumulo/core/security/VisibilityInterpreterFactory.java +++ /dev/null @@ -1,40 +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.accumulo.core.security; - - -public class VisibilityInterpreterFactory { - private static VisibilityInterpreter interpreter = null; - - public static VisibilityInterpreter create() { - if (interpreter == null) { - throw new IllegalStateException("ColumnVisibilityInterpreterFactory is not configured: Interpreter is null"); - } - return interpreter.create(); - } - - public static VisibilityInterpreter create(ColumnVisibility cv, Authorizations authorizations) { - if (interpreter == null) { - throw new IllegalStateException("ColumnVisibilityInterpreterFactory is not configured: Interpreter is null"); - } - return interpreter.create(cv, authorizations); - } - - public static void setInterpreter(VisibilityInterpreter interpreter) { - VisibilityInterpreterFactory.interpreter = interpreter; - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/80ee809a/core/src/main/java/org/apache/accumulo/core/security/VisibilityParseException.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/security/VisibilityParseException.java b/core/src/main/java/org/apache/accumulo/core/security/VisibilityParseException.java deleted file mode 100644 index 2f46dc9..0000000 --- a/core/src/main/java/org/apache/accumulo/core/security/VisibilityParseException.java +++ /dev/null @@ -1,34 +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.accumulo.core.security; - -import java.text.ParseException; - -public class VisibilityParseException extends ParseException { - private static final long serialVersionUID = 1L; - private String visibility; - - public VisibilityParseException(String reason, byte[] visibility, int errorOffset) { - super(reason, errorOffset); - this.visibility = new String(visibility); - } - - @Override - public String getMessage() { - return super.getMessage() + " in string '" + visibility + "' at position " + super.getErrorOffset(); - } -}