usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [16/50] [abbrv] incubator-usergrid git commit: Classes for new single-queue, multi-event approach in SQS/SNS
Date Thu, 28 May 2015 12:53:21 GMT
Classes for new single-queue, multi-event approach in SQS/SNS


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6d0ebd0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6d0ebd0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6d0ebd0c

Branch: refs/heads/USERGRID-669
Commit: 6d0ebd0cf0c2ec47747e123bc08c110aec1d0e8e
Parents: 53563e8
Author: Jeff West <jwest@apigee.com>
Authored: Tue May 26 09:00:45 2015 -0700
Committer: Jeff West <jwest@apigee.com>
Committed: Tue May 26 09:00:45 2015 -0700

----------------------------------------------------------------------
 .../asyncevents/model/AsyncEvent.java           | 117 +++++++++++++++++++
 .../asyncevents/model/EdgeDeleteEvent.java      |  45 +++++++
 .../asyncevents/model/EdgeIndexEvent.java       |  46 ++++++++
 .../asyncevents/model/EntityDeleteEvent.java    |  36 ++++++
 .../asyncevents/model/EntityIndexEvent.java     |  39 +++++++
 5 files changed, 283 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6d0ebd0c/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/AsyncEvent.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/AsyncEvent.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/AsyncEvent.java
new file mode 100644
index 0000000..f27aea1
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/AsyncEvent.java
@@ -0,0 +1,117 @@
+/*
+ * 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.usergrid.corepersistence.asyncevents.model;
+
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.graph.Edge;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+/**
+ * Created by Jeff West on 5/25/15.
+ */
+public class AsyncEvent {
+
+    protected EventType eventType;
+
+    protected EntityIdScope entityIdScope;
+    protected ApplicationScope applicationScope;
+    protected Id entityId;
+    protected Edge edge;
+
+    /**
+     * required for jackson, do not delete
+     */
+
+    protected AsyncEvent() {
+    }
+
+    public AsyncEvent(final EventType eventType,
+                      final EntityIdScope entityIdScope) {
+
+        this.eventType = eventType;
+        this.entityIdScope = entityIdScope;
+    }
+
+    public AsyncEvent(EventType eventType, ApplicationScope applicationScope, Edge edge)
{
+        this.eventType = eventType;
+        this.applicationScope = applicationScope;
+        this.edge = edge;
+    }
+
+    public AsyncEvent(EventType eventType, ApplicationScope applicationScope, Id entityId,
Edge edge) {
+        this.eventType = eventType;
+        this.applicationScope = applicationScope;
+        this.edge = edge;
+        this.entityId = entityId;
+    }
+
+    public final Id getEntityId() {
+        return entityId;
+    }
+
+    protected void setEntityId(Id entityId) {
+        this.entityId = entityId;
+    }
+
+    public final EventType getEventType() {
+        return eventType;
+    }
+
+    protected void setEventType(EventType eventType) {
+        this.eventType = eventType;
+    }
+
+    public EntityIdScope getEntityIdScope() {
+        return entityIdScope;
+    }
+
+    protected void setEntityIdScope(EntityIdScope entityIdScope) {
+        this.entityIdScope = entityIdScope;
+    }
+
+    public ApplicationScope getApplicationScope() {
+        return applicationScope;
+    }
+
+    protected void setApplicationScope(ApplicationScope applicationScope) {
+        this.applicationScope = applicationScope;
+    }
+
+    public Edge getEdge() {
+        return edge;
+    }
+
+    protected void setEdge(Edge edge) {
+        this.edge = edge;
+    }
+
+    public enum EventType {
+        EDGE_DELETE,
+        EDGE_INDEX,
+        ENTITY_DELETE,
+        ENTITY_INDEX;
+
+
+        public String asString() {
+            return toString();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6d0ebd0c/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeDeleteEvent.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeDeleteEvent.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeDeleteEvent.java
new file mode 100644
index 0000000..ea43ca8
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeDeleteEvent.java
@@ -0,0 +1,45 @@
+/*
+ * 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.usergrid.corepersistence.asyncevents.model;
+
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.graph.Edge;
+
+/**
+ * Created by Jeff West on 5/25/15.
+ */
+public final class EdgeDeleteEvent extends AsyncEvent {
+    public EdgeDeleteEvent() {
+    }
+
+    public EdgeDeleteEvent(ApplicationScope applicationScope, Edge edge) {
+        super(EventType.EDGE_DELETE, applicationScope, edge);
+    }
+
+    @Override
+    public final ApplicationScope getApplicationScope() {
+        return super.getApplicationScope();
+    }
+
+    @Override
+    public final Edge getEdge() {
+        return super.getEdge();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6d0ebd0c/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeIndexEvent.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeIndexEvent.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeIndexEvent.java
new file mode 100644
index 0000000..145a0d4
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EdgeIndexEvent.java
@@ -0,0 +1,46 @@
+/*
+ * 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.usergrid.corepersistence.asyncevents.model;
+
+
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.graph.Edge;
+import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+import java.io.Serializable;
+
+/**
+ * Created by Jeff West on 5/25/15.
+ */
+public final class EdgeIndexEvent
+    extends AsyncEvent
+    implements Serializable {
+
+    /**
+     * Needed by jackson
+     */
+    public EdgeIndexEvent() {
+    }
+
+    public EdgeIndexEvent(ApplicationScope applicationScope, Id entityId, Edge edge) {
+        super(EventType.EDGE_INDEX, applicationScope, entityId, edge);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6d0ebd0c/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityDeleteEvent.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityDeleteEvent.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityDeleteEvent.java
new file mode 100644
index 0000000..186926a
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityDeleteEvent.java
@@ -0,0 +1,36 @@
+/*
+ * 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.usergrid.corepersistence.asyncevents.model;
+
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+/**
+ * Created by Jeff West on 5/25/15.
+ */
+public final class EntityDeleteEvent extends AsyncEvent {
+    public EntityDeleteEvent() {
+    }
+
+    public EntityDeleteEvent(EntityIdScope entityIdScope) {
+        super(EventType.ENTITY_DELETE, entityIdScope);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6d0ebd0c/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityIndexEvent.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityIndexEvent.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityIndexEvent.java
new file mode 100644
index 0000000..7c79766
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/EntityIndexEvent.java
@@ -0,0 +1,39 @@
+/*
+ * 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.usergrid.corepersistence.asyncevents.model;
+
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
+
+/**
+ * Created by Jeff West on 5/25/15.
+ */
+public final class EntityIndexEvent extends AsyncEvent {
+    public EntityIndexEvent() {
+    }
+
+    public EntityIndexEvent(EntityIdScope entityIdScope) {
+        super(EventType.ENTITY_INDEX, entityIdScope);
+    }
+
+    @Override
+    public final EntityIdScope getEntityIdScope() {
+        return super.getEntityIdScope();
+    }
+}


Mime
View raw message