Return-Path: Delivered-To: apmail-incubator-amber-commits-archive@minotaur.apache.org Received: (qmail 22522 invoked from network); 8 Jul 2010 18:47:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jul 2010 18:47:41 -0000 Received: (qmail 57911 invoked by uid 500); 8 Jul 2010 18:47:41 -0000 Delivered-To: apmail-incubator-amber-commits-archive@incubator.apache.org Received: (qmail 57892 invoked by uid 500); 8 Jul 2010 18:47:41 -0000 Mailing-List: contact amber-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: amber-dev@incubator.apache.org Delivered-To: mailing list amber-commits@incubator.apache.org Received: (qmail 57885 invoked by uid 99); 8 Jul 2010 18:47:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jul 2010 18:47:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jul 2010 18:47:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C04802388A36; Thu, 8 Jul 2010 18:46:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r961875 - in /incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server: ./ Access.java AccessStorage.java StorageException.java TemporaryCredentialsGenerator.java TokenCredentialsGenerator.java Date: Thu, 08 Jul 2010 18:46:13 -0000 To: amber-commits@incubator.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100708184613.C04802388A36@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Thu Jul 8 18:46:13 2010 New Revision: 961875 URL: http://svn.apache.org/viewvc?rev=961875&view=rev Log: started migrating server stuff Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java (with props) incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java (with props) incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java (with props) incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java (with props) incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java (with props) Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java?rev=961875&view=auto ============================================================================== --- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java (added) +++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java Thu Jul 8 18:46:13 2010 @@ -0,0 +1,58 @@ +/* + * 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.amber.server; + +import java.util.Collection; + +/** + * Association of nonce(s) and timestamp. + * + * @version $Id$ + */ +public interface Access extends Comparable { + + /** + * Returns the timestamp access. + * + * @return the timestamp access + */ + long getTimestamp(); + + /** + * Add a nonce to an access. + * + * @param nonce the nonce has o be added. + * @return true, if the nonce has not used yet, false otherwise. + */ + boolean addNonce(String nonce); + + /** + * Checks if the access already contains a nonce. + * + * @param nonce the nonce has to be checked. + * @return true if the nonce is contained, false otherwise. + */ + boolean containsNonce(String nonce); + + /** + * Returns the whole list of nonces associated to the timestamp. + * + * @return the whole list of nonces associated to the timestamp. + */ + Collection getNonces(); + +} Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/Access.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java?rev=961875&view=auto ============================================================================== --- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java (added) +++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java Thu Jul 8 18:46:13 2010 @@ -0,0 +1,54 @@ +/* + * 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.amber.server; + +/** + * Nonce/timestamp storage definition. + * + * @version $Id$ + */ +public interface AccessStorage { + + /** + * Stores a new nonce / timestamp pair associated with a consumer key. + * + * @param clientCredentials the consumer to be associated with the access. + * @param timestamp the timestamp of the request. + * @param nonce the nonce associated with the timestamp. + * @throws StorageException if a backend error occurs. + */ + void add(String clientCredentials, long timestamp, String nonce) throws StorageException; + + /** + * Get the last access (by timestamp) of a consumer. + * + * @param clientCredentials the consumer whose access needs to be read. + * @return the access object. + * @throws StorageException if a backend error occurs. + */ + Access getLastAccess(String clientCredentials) throws StorageException; + + /** + * Remove a consumer access. + * + * @param clientCredentials the consumer key. + * @param timestamp the timestamp. + * @throws StorageException if a backend error occurs. + */ + void remove(String clientCredentials, long timestamp) throws StorageException; + +} Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/AccessStorage.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java?rev=961875&view=auto ============================================================================== --- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java (added) +++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java Thu Jul 8 18:46:13 2010 @@ -0,0 +1,43 @@ +/* + * 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.amber.server; + +/** + * Exception thrown when an error occurs when accessing to the Access Storage. + * + * @version $Id$ + */ +public final class StorageException extends Exception { + + /** + * The default serial version UID; + */ + private static final long serialVersionUID = 1L; + + public StorageException(String message) { + super(message); + } + + public StorageException(Throwable cause) { + super(cause); + } + + public StorageException(String message, Throwable cause) { + super(message, cause); + } + +} Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/StorageException.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java?rev=961875&view=auto ============================================================================== --- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java (added) +++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java Thu Jul 8 18:46:13 2010 @@ -0,0 +1,33 @@ +/* + * 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.amber.server; + +/** + * Temporary credentials generator. + * + * @version $Id$ + */ +public interface TemporaryCredentialsGenerator { + + /** + * Generates a new temporary credentials. + * + * @return a new temporary credentials. + */ + String generate(); + +} Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TemporaryCredentialsGenerator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java?rev=961875&view=auto ============================================================================== --- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java (added) +++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java Thu Jul 8 18:46:13 2010 @@ -0,0 +1,33 @@ +/* + * 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.amber.server; + +/** + * Token credentials generator. + * + * @version $Id$ + */ +public interface TokenCredentialsGenerator { + + /** + * Generates a new token credentials. + * + * @return a new token credentials. + */ + String generate(); + +} Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/TokenCredentialsGenerator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain