Author: rdonkin
Date: Tue Dec 11 13:41:00 2007
New Revision: 603369
URL: http://svn.apache.org/viewvc?rev=603369&view=rev
Log:
Proposed interface for user meta-data storage.
Added:
james/server/trunk/user-api/src/main/java/org/apache/james/api/
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserMetaDataRespository.java
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserRepositoryException.java
Added:
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserMetaDataRespository.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserMetaDataRespository.java?rev=603369&view=auto
==============================================================================
---
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserMetaDataRespository.java
(added)
+++
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserMetaDataRespository.java
Tue Dec 11 13:41:00 2007
@@ -0,0 +1,51 @@
+/****************************************************************
+ * 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.james.api.user;
+
+import java.io.Serializable;
+
+/**
+ * <p>Contains flexible meta-data related to users.
+ * Values should be serializable to allow easy remote transport
+ * and persistence. Keys are strings.
+ * </p><p>
+ * <strong>Note</strong> conventionally keys should be URIs
+ * and so naturally namespaced. In particular, all keys starting with
+ * <code>http://james.apache.org/</code> are reserved for
+ * use by JAMES.
+ * </p>
+ */
+public interface UserMetaDataRespository {
+
+ /**
+ * Gets the attribute for the given key.
+ * @param key conventionally an URI, not null
+ * @return value, or null if the keyed attribute has
+ * no associated value.
+ */
+ public Serializable getAttribute(String key) throws
UserRepositoryException;
+
+ /**
+ * Sets the attribute keyed to the given value.
+ * @param value <code>Serializable</code> value, possibly null
+ * @param key conventionally an URI, not null
+ */
+ public void setAttribute(Serializable value, String key) throws
UserRepositoryException;
+}
Added:
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserRepositoryException.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserRepositoryException.java?rev=603369&view=auto
==============================================================================
---
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserRepositoryException.java
(added)
+++
james/server/trunk/user-api/src/main/java/org/apache/james/api/user/UserRepositoryException.java
Tue Dec 11 13:41:00 2007
@@ -0,0 +1,44 @@
+/****************************************************************
+ * 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.james.api.user;
+
+/**
+ * Basic user repository exception.
+ */
+public class UserRepositoryException extends Exception {
+
+ private static final long serialVersionUID = 6758478375823762715L;
+
+ public UserRepositoryException() {
+ super();
+ }
+
+ public UserRepositoryException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public UserRepositoryException(String message) {
+ super(message);
+ }
+
+ public UserRepositoryException(Throwable cause) {
+ super(cause);
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]