Revision: a266470298ce
Author: Sergey Vetyutnev <[email protected]>
Date: Wed Dec 5 04:31:03 2012
Log: Adding Provider and UserAbortEvents + some bugs fixing
http://code.google.com/p/jain-slee/source/detail?r=a266470298ce&repo=ss7
Added:
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/DialogEvent.java
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/ProviderAbortEvent.java
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/UserAbortEvent.java
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/DialogEventImpl.java
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/ProviderAbortEventImpl.java
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/UserAbortEventImpl.java
Modified:
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/InvokeEvent.java
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/TCAPEvent.java
/resources/tcap/events/src/main/resources/META-INF/event-jar.xml
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/TCAPResourceAdaptor.java
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/TCAPDialogWrapper.java
/resources/tcap/ratype/src/main/resources/META-INF/resource-adaptor-type-jar.xml
=======================================
--- /dev/null
+++
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/DialogEvent.java
Wed Dec 5 04:31:03 2012
@@ -0,0 +1,33 @@
+/*
+ * TeleStax, Open Source Cloud Communications Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.slee.resource.tcap.events;
+
+import
org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.DialogIndication;
+
+/**
+ * @author sergey vetyutnev
+ *
+ */
+public interface DialogEvent extends DialogIndication, TCAPEvent {
+
+}
=======================================
--- /dev/null
+++
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/ProviderAbortEvent.java
Wed Dec 5 04:31:03 2012
@@ -0,0 +1,31 @@
+/*
+ * TeleStax, Open Source Cloud Communications Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.slee.resource.tcap.events;
+
+/**
+ * @author sergey vetyutnev
+ *
+ */
+public interface ProviderAbortEvent extends
org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.TCPAbortIndication,
DialogEvent {
+
+}
=======================================
--- /dev/null
+++
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/UserAbortEvent.java
Wed Dec 5 04:31:03 2012
@@ -0,0 +1,27 @@
+/*
+ * TeleStax, Open Source Cloud Communications Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.slee.resource.tcap.events;
+
+public interface UserAbortEvent extends
org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.TCUserAbortIndication,
DialogEvent {
+
+}
=======================================
--- /dev/null
+++
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/DialogEventImpl.java
Wed Dec 5 04:31:03 2012
@@ -0,0 +1,78 @@
+/*
+ * TeleStax, Open Source Cloud Communications Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.slee.resource.tcap.wrappers;
+
+import org.mobicents.protocols.ss7.tcap.api.tc.dialog.Dialog;
+import
org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.DialogIndication;
+import org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.EventType;
+import org.mobicents.protocols.ss7.tcap.asn.comp.Component;
+import org.mobicents.slee.resource.tcap.events.DialogEvent;
+
+/**
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public class DialogEventImpl<T extends DialogIndication> implements
DialogEvent {
+
+ private final TCAPDialogWrapper dialogWrapper;
+ protected final T wrappedComponent;
+
+ /**
+ * @param wrappedDialog
+ */
+ public DialogEventImpl(TCAPDialogWrapper wrappedDialog, T
wrappedComponent) {
+ super();
+ this.dialogWrapper = wrappedDialog;
+ this.wrappedComponent = wrappedComponent;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.mobicents.slee.resource.tcap.events.ComponentEvent#getDialog()
+ */
+ @Override
+ public Dialog getDialog() {
+ return this.dialogWrapper;
+ }
+
+ @Override
+ public Component[] getComponents() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EventType getType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Byte getQos() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
=======================================
--- /dev/null
+++
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/ProviderAbortEventImpl.java
Wed Dec 5 04:31:03 2012
@@ -0,0 +1,50 @@
+/*
+ * TeleStax, Open Source Cloud Communications Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.slee.resource.tcap.wrappers;
+
+import
org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.TCPAbortIndication;
+import org.mobicents.protocols.ss7.tcap.asn.comp.PAbortCauseType;
+import org.mobicents.slee.resource.tcap.events.ProviderAbortEvent;
+
+/**
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public class ProviderAbortEventImpl extends
DialogEventImpl<TCPAbortIndication> implements ProviderAbortEvent {
+
+ public ProviderAbortEventImpl(TCAPDialogWrapper wrappedDialog,
TCPAbortIndication wrappedComponent) {
+ super(wrappedDialog, wrappedComponent);
+ }
+
+ @Override
+ public PAbortCauseType getPAbortCause() {
+ return this.wrappedComponent.getPAbortCause();
+ }
+
+ @Override
+ public boolean isLocalProviderOriginated() {
+ return this.wrappedComponent.isLocalProviderOriginated();
+ }
+
+}
=======================================
--- /dev/null
+++
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/UserAbortEventImpl.java
Wed Dec 5 04:31:03 2012
@@ -0,0 +1,73 @@
+/*
+ * TeleStax, Open Source Cloud Communications Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.slee.resource.tcap.wrappers;
+
+import
org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.TCUserAbortIndication;
+import org.mobicents.protocols.ss7.tcap.asn.AbortSource;
+import org.mobicents.protocols.ss7.tcap.asn.ApplicationContextName;
+import org.mobicents.protocols.ss7.tcap.asn.ResultSourceDiagnostic;
+import org.mobicents.protocols.ss7.tcap.asn.UserInformation;
+import org.mobicents.slee.resource.tcap.events.UserAbortEvent;
+
+/**
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public class UserAbortEventImpl extends
DialogEventImpl<TCUserAbortIndication> implements UserAbortEvent {
+
+ public UserAbortEventImpl(TCAPDialogWrapper wrappedDialog,
TCUserAbortIndication wrappedComponent) {
+ super(wrappedDialog, wrappedComponent);
+ }
+
+ @Override
+ public Boolean IsAareApdu() {
+ return this.wrappedComponent.IsAareApdu();
+ }
+
+ @Override
+ public Boolean IsAbrtApdu() {
+ return this.wrappedComponent.IsAbrtApdu();
+ }
+
+ @Override
+ public UserInformation getUserInformation() {
+ return this.wrappedComponent.getUserInformation();
+ }
+
+ @Override
+ public AbortSource getAbortSource() {
+ return this.wrappedComponent.getAbortSource();
+ }
+
+ @Override
+ public ApplicationContextName getApplicationContextName() {
+ return this.wrappedComponent.getApplicationContextName();
+ }
+
+ @Override
+ public ResultSourceDiagnostic getResultSourceDiagnostic() {
+ return this.wrappedComponent.getResultSourceDiagnostic();
+ }
+
+}
=======================================
---
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/InvokeEvent.java
Sat Sep 1 02:07:21 2012
+++
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/InvokeEvent.java
Wed Dec 5 04:31:03 2012
@@ -19,6 +19,7 @@
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
+
package org.mobicents.slee.resource.tcap.events;
=======================================
---
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/TCAPEvent.java
Sat Sep 1 02:07:21 2012
+++
/resources/tcap/events/src/main/java/org/mobicents/slee/resource/tcap/events/TCAPEvent.java
Wed Dec 5 04:31:03 2012
@@ -35,6 +35,7 @@
public static final String EVENT_TYPE_NAME_DIALOG_NOTICE
= "ss7.tcap.DIALOG_NOTICE";
public static final String EVENT_TYPE_NAME_DIALOG_RELEASED
= "ss7.tcap.DIALOG_RELEASED";
public static final String EVENT_TYPE_NAME_DIALOG_TIMEOUT
= "ss7.tcap.DIALOG_TIMEOUT";
+ public static final String EVENT_TYPE_NAME_DIALOG_DELIMITER
= "ss7.tcap.DIALOG_DELIMITER";
public static final String EVENT_TYPE_NAME_COMPONENT_INVOKE_TIMEOUT
= "ss7.tcap.COMPONENT_INVOKE_TIMEOUT";
=======================================
--- /resources/tcap/events/src/main/resources/META-INF/event-jar.xml Wed
Nov 7 03:01:29 2012
+++ /resources/tcap/events/src/main/resources/META-INF/event-jar.xml Wed
Dec 5 04:31:03 2012
@@ -44,14 +44,14 @@
<event-type-name>ss7.tcap.DIALOG_USERABORT</event-type-name>
<event-type-vendor>org.mobicents</event-type-vendor>
<event-type-version>1.0</event-type-version>
-
<event-class-name>org.mobicents.protocols.ss7.tcap.api.tc.dialog.Dialog</event-class-name>
+
<event-class-name>org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.TCUserAbortIndication</event-class-name>
</event-definition>
<event-definition>
<event-type-name>ss7.tcap.DIALOG_PROVIDERABORT</event-type-name>
<event-type-vendor>org.mobicents</event-type-vendor>
<event-type-version>1.0</event-type-version>
-
<event-class-name>org.mobicents.protocols.ss7.tcap.api.tc.dialog.Dialog</event-class-name>
+
<event-class-name>org.mobicents.protocols.ss7.tcap.api.tc.dialog.events.TCPAbortIndication</event-class-name>
</event-definition>
<event-definition>
@@ -75,6 +75,13 @@
<event-class-name>org.mobicents.protocols.ss7.tcap.api.tc.dialog.Dialog</event-class-name>
</event-definition>
+ <event-definition>
+ <event-type-name>ss7.tcap.DIALOG_DELIMITER</event-type-name>
+ <event-type-vendor>org.mobicents</event-type-vendor>
+ <event-type-version>1.0</event-type-version>
+
<event-class-name>org.mobicents.protocols.ss7.tcap.api.tc.dialog.Dialog</event-class-name>
+ </event-definition>
+
<!-- Component Events -->
<event-definition>
<event-type-name>ss7.tcap.COMPONENT_INVOKE</event-type-name>
=======================================
---
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/TCAPResourceAdaptor.java
Sat Sep 1 02:07:21 2012
+++
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/TCAPResourceAdaptor.java
Wed Dec 5 04:31:03 2012
@@ -1,6 +1,6 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and individual contributors
+ * TeleStax, Open Source Cloud Communications Copyright 2012.
+ * and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -66,12 +66,14 @@
import org.mobicents.protocols.ss7.tcap.asn.comp.ReturnResultLast;
import org.mobicents.slee.resource.tcap.events.TCAPEvent;
import org.mobicents.slee.resource.tcap.wrappers.InvokeEventImpl;
+import org.mobicents.slee.resource.tcap.wrappers.ProviderAbortEventImpl;
import org.mobicents.slee.resource.tcap.wrappers.RejectEventImpl;
import org.mobicents.slee.resource.tcap.wrappers.ReturnErrorEventImpl;
import org.mobicents.slee.resource.tcap.wrappers.ReturnResultEventImpl;
import org.mobicents.slee.resource.tcap.wrappers.ReturnResultLastEventImpl;
import org.mobicents.slee.resource.tcap.wrappers.TCAPDialogWrapper;
import org.mobicents.slee.resource.tcap.wrappers.TCAPProviderWrapper;
+import org.mobicents.slee.resource.tcap.wrappers.UserAbortEventImpl;
/**
*
@@ -476,7 +478,9 @@
public void onTCPAbort(TCPAbortIndication tcPAbortIndication) {
Dialog wrappedDialog = tcPAbortIndication.getDialog();
TCAPDialogWrapper tcapDialogWrapper = (TCAPDialogWrapper)
wrappedDialog.getUserObject();
- this.onEvent(TCAPEvent.EVENT_TYPE_NAME_DIALOG_PROVIDERABORT,
tcapDialogWrapper, tcapDialogWrapper);
+ ProviderAbortEventImpl providerAbortEvent = new
ProviderAbortEventImpl(tcapDialogWrapper, tcPAbortIndication);
+ this.onEvent(TCAPEvent.EVENT_TYPE_NAME_DIALOG_PROVIDERABORT,
tcapDialogWrapper, providerAbortEvent);
+// this.onEvent(TCAPEvent.EVENT_TYPE_NAME_DIALOG_PROVIDERABORT,
tcapDialogWrapper, tcapDialogWrapper);
}
/*
@@ -528,7 +532,9 @@
public void onTCUserAbort(TCUserAbortIndication tcUserAbortIndication) {
Dialog wrappedDialog = tcUserAbortIndication.getDialog();
TCAPDialogWrapper tcapDialogWrapper = (TCAPDialogWrapper)
wrappedDialog.getUserObject();
- this.onEvent(TCAPEvent.EVENT_TYPE_NAME_DIALOG_USERABORT,
tcapDialogWrapper, tcapDialogWrapper);
+ UserAbortEventImpl userAbortEvent = new
UserAbortEventImpl(tcapDialogWrapper, tcUserAbortIndication);
+ this.onEvent(TCAPEvent.EVENT_TYPE_NAME_DIALOG_USERABORT,
tcapDialogWrapper, userAbortEvent);
+// this.onEvent(TCAPEvent.EVENT_TYPE_NAME_DIALOG_USERABORT,
tcapDialogWrapper, tcapDialogWrapper);
}
/*
@@ -610,5 +616,8 @@
}
}
}
+
+ // sending DIALOG_DELIMITER message after delivering all
components
+ this.onEvent(TCAPEvent.EVENT_TYPE_NAME_DIALOG_DELIMITER, dialogWrapper,
dialogWrapper);
}
}
=======================================
---
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/TCAPDialogWrapper.java
Wed Dec 5 00:37:21 2012
+++
/resources/tcap/ra/src/main/java/org/mobicents/slee/resource/tcap/wrappers/TCAPDialogWrapper.java
Wed Dec 5 04:31:03 2012
@@ -176,8 +176,7 @@
*/
@Override
public TRPseudoState getState() {
- // TODO Auto-generated method stub
- return null;
+ return this.wrappedDialog.getState();
}
/*
=======================================
---
/resources/tcap/ratype/src/main/resources/META-INF/resource-adaptor-type-jar.xml
Wed Nov 7 03:01:29 2012
+++
/resources/tcap/ratype/src/main/resources/META-INF/resource-adaptor-type-jar.xml
Wed Dec 5 04:31:03 2012
@@ -94,6 +94,12 @@
<event-type-vendor>org.mobicents</event-type-vendor>
<event-type-version>1.0</event-type-version>
</event-type-ref>
+
+ <event-type-ref>
+
<event-type-name>ss7.tcap.DIALOG_DELIMITER</event-type-name>
+ <event-type-vendor>org.mobicents</event-type-vendor>
+ <event-type-version>1.0</event-type-version>
+ </event-type-ref>
<!-- Component Events -->
<event-type-ref>