summaryrefslogtreecommitdiffstats
path: root/sandbox/sca-cloud-tutorial/cloud-api/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-23 17:55:24 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-23 17:55:24 +0000
commit6fd5a4202a7373bacc018d27020e82fb3bf197f5 (patch)
tree4b7307e6ef25b2a673ce4c32e11b36af1d71b34f /sandbox/sca-cloud-tutorial/cloud-api/src
parent85da664220832533f65cdfe5ac611fe7ee9afad8 (diff)
Straw-man cloud api that abstract different cloud infrastructure services and allow applications to consume these services independently of the cloud environment.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@829147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/sca-cloud-tutorial/cloud-api/src')
-rw-r--r--sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/data/DocumentService.java33
-rw-r--r--sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/User.java30
-rw-r--r--sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/UserService.java38
3 files changed, 101 insertions, 0 deletions
diff --git a/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/data/DocumentService.java b/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/data/DocumentService.java
new file mode 100644
index 0000000000..f496c8f280
--- /dev/null
+++ b/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/data/DocumentService.java
@@ -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.tuscany.sca.cloud.data;
+
+import org.apache.tuscany.sca.data.collection.Collection;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
+
+public interface DocumentService<K, D> extends Collection <K, D>{
+
+ /**
+ * Delete multiple items.
+ *
+ * @param key
+ */
+ void delete(K... keys) throws NotFoundException;
+}
diff --git a/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/User.java b/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/User.java
new file mode 100644
index 0000000000..b218716330
--- /dev/null
+++ b/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/User.java
@@ -0,0 +1,30 @@
+/*
+ * 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.tuscany.sca.cloud.user;
+
+public interface User {
+ public static enum ROLES { UNDEFINED, USER, ADMIN};
+
+ String getUserId();
+
+ String getEmail();
+
+ String getNickname();
+}
diff --git a/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/UserService.java b/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/UserService.java
new file mode 100644
index 0000000000..7696f0d45b
--- /dev/null
+++ b/sandbox/sca-cloud-tutorial/cloud-api/src/main/java/org/apache/tuscany/sca/cloud/user/UserService.java
@@ -0,0 +1,38 @@
+/*
+ * 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.tuscany.sca.cloud.user;
+
+
+public interface UserService {
+
+ public String createLoginURL(String destinationURL, String authDomain);
+
+ public String createLoginURL(String destinationURL);
+
+ public String createLogoutURL(String destinationURL, String authDomain);
+
+ public String createLogoutURL(String destinationURL);
+
+ public User getCurrentUser();
+
+ public boolean isUserAdmin();
+
+ public boolean isUserLoggedIn();
+}