You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/10/16 14:42:55 UTC

[isis] 01/08: ISIS-1742: deletes unused supporting classes for old PublishingService: EventMetadata, EventType, PublishedEventStateType, StateMessageMessagetType

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch dev/2.0.0/ISIS-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4440eca1467f043d82415bded145c58e7eabee71
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 16 15:08:30 2017 +0100

    ISIS-1742: deletes unused supporting classes for old PublishingService: EventMetadata, EventType, PublishedEventStateType, StateMessageMessagetType
---
 .../applib/services/publish/EventMetadata.java     | 255 ---------------------
 .../isis/applib/services/publish/EventType.java    |  41 ----
 .../services/publish/PublishedEventStateType.java  |  37 ---
 .../services/publish/StatusMessageMessageType.java |  37 ---
 .../isis/applib/types/MemberIdentifierType.java    |   3 +-
 .../apache/isis/applib/types/TargetActionType.java |   3 +-
 .../apache/isis/applib/types/TargetClassType.java  |   3 +-
 .../jdo/applib/service/JdoColumnLength.java        |  12 +-
 .../services/publish/EventMetadataTest_getId.java  |  64 ------
 todo-deprecation-list.txt                          |  18 +-
 10 files changed, 17 insertions(+), 456 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventMetadata.java b/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventMetadata.java
deleted file mode 100644
index e9d79bc..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventMetadata.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-import java.sql.Timestamp;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-
-/**
- * Standard metadata about an event to be published.
- * 
- * <p>
- * This is a class rather than an interface so that it may be easily extended in the future.
- */
-public class EventMetadata {
-    
-    private final UUID transactionId;
-    private final int sequence;
-    private final String user;
-    private final java.sql.Timestamp javaSqlTimestamp;
-    private final String title;
-    private final EventType eventType;
-    private final String targetClass;
-    private final String targetAction;
-    private final Bookmark target;
-    private final String actionIdentifier;
-    private final List<String> actionParameterNames;
-    private final List<Class<?>> actionParameterTypes;
-    private final Class<?> actionReturnType;
-
-    /**
-     * @deprecated - no longer called by the framework.
-     */
-    @Deprecated
-    public EventMetadata(
-            final UUID transactionId, 
-            final int sequence, 
-            final EventType eventType, 
-            final String user, 
-            final long timestamp, 
-            final String title) {
-        this(transactionId, sequence, eventType, user, new java.sql.Timestamp(timestamp), title, null, null, null, null);
-    }
-
-    /**
-     * @deprecated - no longer called by the framework.
-     */
-    @Deprecated
-    public EventMetadata(
-            final UUID transactionId, 
-            final int sequence, 
-            final EventType eventType, 
-            final String user, 
-            final java.sql.Timestamp javaSqlTimestamp, 
-            final String title, 
-            final String targetClass, 
-            final String targetAction, 
-            final Bookmark target, 
-            final String actionIdentifier) {
-        this(transactionId, sequence, eventType, user, javaSqlTimestamp, title, targetClass, targetAction, target, actionIdentifier, null, null, null );
-    }
-
-    public EventMetadata(
-            final UUID transactionId,
-            final int sequence,
-            final EventType eventType,
-            final String user,
-            final Timestamp javaSqlTimestamp,
-            final String title,
-            final String targetClass,
-            final String targetAction,
-            final Bookmark target,
-            final String actionIdentifier,
-            final List<String> actionParameterNames,
-            final List<Class<?>> actionParameterTypes,
-            final Class<?> actionReturnType) {
-        this.transactionId = transactionId;
-        this.sequence = sequence;
-        this.user = user;
-        this.javaSqlTimestamp = javaSqlTimestamp;
-        this.title = title;
-        this.eventType = eventType;
-        this.targetClass = targetClass;
-        this.targetAction = targetAction;
-        this.target = target;
-        this.actionIdentifier = actionIdentifier;
-        this.actionParameterNames = actionParameterNames;
-        this.actionParameterTypes = actionParameterTypes;
-        this.actionReturnType = actionReturnType;
-    }
-
-    /**
-     * Isis' identifier of the transaction within which this event
-     * originated.
-     * 
-     * <p>
-     * Note that there could be several events all with the same transaction Id, distinguished by {@link #getSequence()}.
-     */
-    public UUID getTransactionId() {
-        return transactionId;
-    }
-
-    /**
-     * The zero-based sequence number within the sequence name.
-     * 
-     * <p>
-     * The combination of [{@link #getTransactionId() transaction Id}, {@link #getSequence() sequence}]
-     * is guaranteed to be unique.
-     */
-    public int getSequence() {
-        return sequence;
-    }
-    
-    /**
-     * Represents the user that was responsible for generating the event.  
-     */
-    public String getUser() {
-        return user;
-    }
-    
-    public Timestamp getJavaSqlTimestamp() {
-        return javaSqlTimestamp;
-    }
-
-    /**
-     * The timestamp, in milliseconds, since an epoch time.
-     * 
-     * @deprecated - use {@link #getJavaSqlTimestamp()}
-     */
-    @Deprecated
-    public long getTimestamp() {
-        return getJavaSqlTimestamp().getTime();
-    }
-    
-    /**
-     * Returns a string in form <tt>transactionId.sequence</tt>.
-     */
-    public String getId() {
-        return getTransactionId() + "." + getSequence();
-    }
-    
-    /**
-     * A title for this event, consisting of the oidStr and (for {@link EventType#ACTION_INVOCATION}) also an
-     * identifier of the action.
-     */
-    public String getTitle() {
-        return title;
-    }
-
-    public static class TitleType {
-
-        private TitleType() {}
-
-        public static class Meta {
-
-            public static final int MAX_LEN = 255;
-
-            private Meta() {}
-
-        }
-
-    }
-
-
-    public EventType getEventType() {
-        return eventType;
-    }
-
-    /**
-     * User-friendly class name.
-     */
-    public String getTargetClass() {
-        return targetClass;
-    }
-    
-    public Bookmark getTarget() {
-        return target;
-    }
-
-    /**
-     * User-friendly action name (populated only for {@link EventType#ACTION_INVOCATION}s).
-     */
-    public String getTargetAction() {
-        return targetAction;
-    }
-    
-    /**
-     * Formal action identifier, corresponding to {@link Identifier#toClassAndNameIdentityString()}).
-     * 
-     * <p>
-     * Populated only for {@link EventType#ACTION_INVOCATION}s.
-     */
-    public String getActionIdentifier() {
-        return actionIdentifier;
-    }
-
-    /**
-     * Parameter names of the invoked action.
-     *
-     * <p>
-     * Populated only for {@link EventType#ACTION_INVOCATION}s.
-     */
-    public List<String> getActionParameterNames() {
-        return actionParameterNames;
-    }
-
-    /**
-     * Parameter types of the invoked action.
-     *
-     * <p>
-     * Populated only for {@link EventType#ACTION_INVOCATION}s.
-     */
-    public List<Class<?>> getActionParameterTypes() {
-        return actionParameterTypes;
-    }
-
-    /**
-     * Return type of the invoked action.
-     *
-     * <p>
-     * Populated only for {@link EventType#ACTION_INVOCATION}s.
-     */
-    public Class<?> getActionReturnType() {
-        return actionReturnType;
-    }
-
-    // //////////////////////////////////////
-
-    
-    @Override
-    public String toString() {
-        return getId();
-    }
-
-}
\ No newline at end of file
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventType.java b/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventType.java
deleted file mode 100644
index 4eab496..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-public enum EventType {
-    ACTION_INVOCATION,
-    OBJECT_CREATED,
-    OBJECT_UPDATED,
-    OBJECT_DELETED;
-
-    public static class Type {
-
-        private Type() {}
-
-        public static class Meta {
-
-            public static final int MAX_LEN = 20;
-
-            private Meta() {}
-
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/publish/PublishedEventStateType.java b/core/applib/src/main/java/org/apache/isis/applib/services/publish/PublishedEventStateType.java
deleted file mode 100644
index 3faa275..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/publish/PublishedEventStateType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-/**
- * @deprecated  - used only by isis addons' publishing module, for state of events being polled.
- */
-@Deprecated
-public class PublishedEventStateType {
-
-    private PublishedEventStateType() {}
-
-    public static class Meta {
-
-        public static final int MAX_LEN = 20;
-
-        private Meta() {}
-
-    }
-
-}
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/publish/StatusMessageMessageType.java b/core/applib/src/main/java/org/apache/isis/applib/services/publish/StatusMessageMessageType.java
deleted file mode 100644
index 7e9be32..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/publish/StatusMessageMessageType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-/**
- * @deprecated  - used only by isis addons' publishmq module, for its StatusMessage entity
- */
-@Deprecated
-public class StatusMessageMessageType {
-
-    private StatusMessageMessageType() {}
-
-    public static class Meta {
-
-        public static final int MAX_LEN = 255;
-
-        private Meta() {}
-
-    }
-
-}
diff --git a/core/applib/src/main/java/org/apache/isis/applib/types/MemberIdentifierType.java b/core/applib/src/main/java/org/apache/isis/applib/types/MemberIdentifierType.java
index 644aeb9..a4e4de2 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/types/MemberIdentifierType.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/types/MemberIdentifierType.java
@@ -21,10 +21,9 @@ import java.util.UUID;
 
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.publish.EventMetadata;
 
 /**
- * As per {@link Command#getMemberIdentifier()}, {@link org.apache.isis.applib.services.audit.AuditerService#audit(UUID, int, String, Bookmark, String, String, String, String, String, Timestamp)} and {@link EventMetadata#getActionIdentifier()}.
+ * As per {@link Command#getMemberIdentifier()} and {@link org.apache.isis.applib.services.audit.AuditerService#audit(UUID, int, String, Bookmark, String, String, String, String, String, Timestamp)}.
  */
 public class MemberIdentifierType {
 
diff --git a/core/applib/src/main/java/org/apache/isis/applib/types/TargetActionType.java b/core/applib/src/main/java/org/apache/isis/applib/types/TargetActionType.java
index 79f6215..a1525ef 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/types/TargetActionType.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/types/TargetActionType.java
@@ -21,10 +21,9 @@ import java.util.UUID;
 
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.publish.EventMetadata;
 
 /**
- * A user-friendly name of an action, as per {@link Command#getTargetAction()}, {@link EventMetadata#getTargetAction()}, {@link org.apache.isis.applib.services.audit.AuditerService#audit(UUID, int, String, Bookmark, String, String, String, String, String, Timestamp)}.
+ * A user-friendly name of an action, as per {@link Command#getTargetAction()}, {@link org.apache.isis.applib.services.audit.AuditerService#audit(UUID, int, String, Bookmark, String, String, String, String, String, Timestamp)}.
  */
 public class TargetActionType {
 
diff --git a/core/applib/src/main/java/org/apache/isis/applib/types/TargetClassType.java b/core/applib/src/main/java/org/apache/isis/applib/types/TargetClassType.java
index 43e5196..914e140 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/types/TargetClassType.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/types/TargetClassType.java
@@ -21,10 +21,9 @@ import java.util.UUID;
 
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.publish.EventMetadata;
 
 /**
- * A user-friendly name of a class, as per {@link Command#getTargetClass()}, {@link EventMetadata#getTargetClass()}, {@link org.apache.isis.applib.services.audit.AuditerService#audit(UUID, int, String, Bookmark, String, String, String, String, String, Timestamp)}.
+ * A user-friendly name of a class, as per {@link Command#getTargetClass()}, {@link org.apache.isis.applib.services.audit.AuditerService#audit(UUID, int, String, Bookmark, String, String, String, String, String, Timestamp)}.
  */
 public class TargetClassType {
 
diff --git a/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java b/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
index 86b540b..22e0680 100644
--- a/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
+++ b/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
@@ -22,12 +22,8 @@ import org.apache.isis.applib.annotation.CommandExecuteIn;
 import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.applib.services.HasTransactionId;
 import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.publish.EventMetadata;
-import org.apache.isis.applib.services.publish.EventType;
 import org.apache.isis.applib.services.audit.AuditEntryPropertyIdType;
 import org.apache.isis.applib.services.audit.AuditEntryPropertyValueType;
-import org.apache.isis.applib.services.publish.PublishedEventStateType;
-import org.apache.isis.applib.services.publish.StatusMessageMessageType;
 import org.apache.isis.applib.types.DescriptionType;
 import org.apache.isis.applib.services.settings.SettingTypes;
 import org.apache.isis.applib.types.MemberIdentifierType;
@@ -154,17 +150,17 @@ public final class JdoColumnLength {
          * @deprecated
          */
         @Deprecated
-        public static final int TITLE = EventMetadata.TitleType.Meta.MAX_LEN;
+        public static final int TITLE = 255;
         /**
          * @deprecated
          */
         @Deprecated
-        public static final int EVENT_TYPE = EventType.Type.Meta.MAX_LEN;
+        public static final int EVENT_TYPE = 20;
         /**
          * @deprecated
          */
         @Deprecated
-        public static final int STATE = PublishedEventStateType.Meta.MAX_LEN;
+        public static final int STATE = 20;
     }
 
     /**
@@ -176,7 +172,7 @@ public final class JdoColumnLength {
          * @deprecated
          */
         @Deprecated
-        public static final int MESSAGE = StatusMessageMessageType.Meta.MAX_LEN;
+        public static final int MESSAGE = 255;
         /**
          * @deprecated
          */
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/publish/EventMetadataTest_getId.java b/core/applib/src/test/java/org/apache/isis/applib/services/publish/EventMetadataTest_getId.java
deleted file mode 100644
index a53e0f8..0000000
--- a/core/applib/src/test/java/org/apache/isis/applib/services/publish/EventMetadataTest_getId.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-import java.util.UUID;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class EventMetadataTest_getId {
-
-    @Test
-    public void test() {
-        UUID transactionId = UUID.fromString("1bd8e5d4-2d67-4395-b5e8-d74acd766766");
-        int sequence = 2;
-        String user = "fred";
-        long timestamp = 1364120978631L;
-        String title = "some title";
-        EventMetadata eventMetadata = new EventMetadata(transactionId, sequence, EventType.ACTION_INVOCATION, user, timestamp, title);
-        
-        assertThat(eventMetadata.getTransactionId(), is(UUID.fromString("1bd8e5d4-2d67-4395-b5e8-d74acd766766")));
-        assertThat(eventMetadata.getSequence(), is(2));
-        assertThat(eventMetadata.getUser(), is("fred"));
-        assertThat(eventMetadata.getTimestamp(), is(1364120978631L));
-        assertThat(eventMetadata.getId(), is("1bd8e5d4-2d67-4395-b5e8-d74acd766766.2"));
-        assertThat(eventMetadata.getTitle(), is("some title"));
-        assertThat(eventMetadata.getEventType(), is(EventType.ACTION_INVOCATION));
-    }
-
-    @Test
-    public void test2() {
-        UUID transactionId = UUID.fromString("1bd8e5d4-2d67-4395-b5e8-d74acd766766");
-        int sequence = 2;
-
-        EventMetadata eventMetadata = new EventMetadata(transactionId, sequence, EventType.ACTION_INVOCATION,
-                null, null, null, null, null, null, null, null, null, null);
-
-        assertThat(eventMetadata.getTransactionId(), is(UUID.fromString("1bd8e5d4-2d67-4395-b5e8-d74acd766766")));
-        assertThat(eventMetadata.getSequence(), is(2));
-
-        assertThat(eventMetadata.getId(), is("1bd8e5d4-2d67-4395-b5e8-d74acd766766.2"));
-    }
-
-
-}
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
index ee73ba2..69b07dc 100644
--- a/todo-deprecation-list.txt
+++ b/todo-deprecation-list.txt
@@ -33,14 +33,6 @@ org.apache.isis.applib.services.memento  (19 usages found)
 org.apache.isis.applib.services.metamodel
     MetaModelService2.java - push down to subtype, retain overloads for now
 
-org.apache.isis.applib.services.publish - remove classes pertaining to original PublishingService (payload factories etc).
-    EventMetadata.java - remove class
-    EventPayload.java - remove class
-    EventPayloadForActionInvocation.java - remove class
-    EventPayloadForObjectChanged.java - remove class
-    PublishedEventStateType.java - remove class
-    PublishingService.java - remove domain service interface
-    StatusMessageMessageType.java - remove class
 
 org.apache.isis.applib.services.settings
     SettingTypes.java - remove, used only by 3rd party code (incode platform settings module)
@@ -447,3 +439,13 @@ org.apache.isis.viewer.restfulobjects.rendering.service.conmap.ContentMappingSer
 org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceForRestfulObjects
     - unused
 
+org.apache.isis.applib.services.publish - remove classes pertaining to original PublishingService (payload factories etc).
+    EventMetadata.java - remove class
+    EventType.java - remove class
+    EventPayload.java - remove class
+    EventPayloadForActionInvocation.java - remove class
+    EventPayloadForObjectChanged.java - remove class
+
+    PublishedEventStateType.java - remove class
+    PublishingService.java - remove domain service interface
+    StatusMessageMessageType.java - remove class

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.