summaryrefslogtreecommitdiffstats
path: root/sandbox/sca-cloud-tutorial/cloud-api
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
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')
-rw-r--r--sandbox/sca-cloud-tutorial/cloud-api/META-INF/MANIFEST.MF19
-rw-r--r--sandbox/sca-cloud-tutorial/cloud-api/pom.xml53
-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
5 files changed, 173 insertions, 0 deletions
diff --git a/sandbox/sca-cloud-tutorial/cloud-api/META-INF/MANIFEST.MF b/sandbox/sca-cloud-tutorial/cloud-api/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cf5fc0a7ce
--- /dev/null
+++ b/sandbox/sca-cloud-tutorial/cloud-api/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Export-Package: org.apache.tuscany.sca.cloud.user;version="2.0.0",org.
+ apache.tuscany.sca.cloud.data;uses:="org.apache.tuscany.sca.data.coll
+ ection";version="2.0.0"
+Tool: Bnd-0.0.357
+Bundle-Name: Apache Tuscany SCA Cloud API
+Created-By: 1.6.0_15 (Apple Inc.)
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bnd-LastModified: 1256186081729
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Cloud API
+Import-Package: org.apache.tuscany.sca.cloud.data;version="2.0",org.ap
+ ache.tuscany.sca.cloud.user;version="2.0",org.apache.tuscany.sca.data
+ .collection;version="2.0"
+Bundle-SymbolicName: org.apache.tuscany.sca.cloud.api
+Bundle-DocURL: http://www.apache.org/
+
diff --git a/sandbox/sca-cloud-tutorial/cloud-api/pom.xml b/sandbox/sca-cloud-tutorial/cloud-api/pom.xml
new file mode 100644
index 0000000000..6bf4087e6d
--- /dev/null
+++ b/sandbox/sca-cloud-tutorial/cloud-api/pom.xml
@@ -0,0 +1,53 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-cloud-api</artifactId>
+ <name>Apache Tuscany SCA Cloud API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
+
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();
+}