-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sy Protocol Implementation #57
base: master
Are you sure you want to change the base?
Changes from 8 commits
087435f
cf1861b
89614b5
18131d8
b265d07
5da6b3b
67bae63
16f5125
cafeaac
c832b63
6abef3c
c3b5124
207e692
ab0e144
17401cd
4346890
920b07f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* TeleStax, Open Source Cloud Communications | ||
* Copyright 2011-2016, TeleStax Inc. and individual contributors | ||
* by the @authors tag. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation; either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
* This file incorporates work covered by the following copyright and | ||
* permission notice: | ||
* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2007-2011, Red Hat, Inc. 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.jdiameter.api.sy; | ||
|
||
import org.jdiameter.api.IllegalDiameterStateException; | ||
import org.jdiameter.api.InternalException; | ||
import org.jdiameter.api.OverloadException; | ||
import org.jdiameter.api.RouteException; | ||
import org.jdiameter.api.app.AppSession; | ||
import org.jdiameter.api.app.StateMachine; | ||
|
||
import org.jdiameter.api.sy.events.SpendingLimitRequest; | ||
import org.jdiameter.api.sy.events.SpendingTerminationRequest; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class doesn't seem to be present in the commits.. |
||
import org.jdiameter.api.sy.events.SpendingNotificationAnswer; | ||
|
||
/** | ||
* Basic class for Sy Client Interface specific session. | ||
* Listener must be injected from constructor of implementation class. | ||
* | ||
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a> | ||
* @author <a href="mailto:[email protected]"> Alexandre Mendonca </a> | ||
* @author <a href="mailto:[email protected]"> Bartosz Baranowski </a> | ||
*/ | ||
public interface ClientSySession extends AppSession, StateMachine { | ||
|
||
void sendInitialSpendingLimitReportRequest(SpendingLimitRequest request) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if the method name should not follow the event name, ie
WDYT ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right! INITIAL and INTERMEDIATE comes in AVP.SL-Request-Type |
||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void sendIntermediateSpendingLimitReportRequest(SpendingLimitRequest request) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void sendFinalSpendingLimitReportRequest(SpendingTerminationRequest request) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a different event type for the Termination ? Why can't we just use the generic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nop, you're right. I will reuse org.jdiameter.api.auth.events.SessionTermRequest on method sendFinalSpendingLimitRequest(), as this is not a SpendingLimitRequest but a termination session request. |
||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void sendSpendingLimitReportAnswer(SpendingNotificationAnswer answer) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this method be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, my fault. |
||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* TeleStax, Open Source Cloud Communications | ||
* Copyright 2011-2016, TeleStax Inc. and individual contributors | ||
* by the @authors tag. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation; either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
* This file incorporates work covered by the following copyright and | ||
* permission notice: | ||
* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2007-2011, Red Hat, Inc. 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.jdiameter.api.sy; | ||
|
||
import org.jdiameter.api.IllegalDiameterStateException; | ||
import org.jdiameter.api.InternalException; | ||
import org.jdiameter.api.OverloadException; | ||
import org.jdiameter.api.RouteException; | ||
|
||
import org.jdiameter.api.sy.events.SpendingLimitRequest; | ||
import org.jdiameter.api.sy.events.SpendingLimitAnswer; | ||
import org.jdiameter.api.sy.events.SpendingTerminationRequest; | ||
import org.jdiameter.api.sy.events.SpendingTerminationAnswer; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing class. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
import org.jdiameter.api.sy.events.SpendingNotificationAnswer; | ||
|
||
/** | ||
* This interface defines the possible actions for the different states in the client | ||
* Sy Interface state machine. | ||
* | ||
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a> | ||
* @author <a href="mailto:[email protected]"> Alexandre Mendonca </a> | ||
* @author <a href="mailto:[email protected]"> Bartosz Baranowski </a> | ||
*/ | ||
public interface ClientSySessionListener { | ||
|
||
void doInitialSpendingLimitReportAnswer(ClientSySession session, SpendingLimitRequest request, SpendingLimitAnswer answer) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void doIntermediateSpendingLimitReportAnswer(ClientSySession session, SpendingLimitRequest request, SpendingLimitAnswer answer) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void doFinalSpendingLimitReportAnswer(ClientSySession session, SpendingTerminationRequest request, SpendingTerminationAnswer answer) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above, regarding using generic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. noted and fixed as well. |
||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void doSpendingLimitReportRequest(ClientSySession session, SpendingNotificationAnswer answer) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Right ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my fault, should be doSpendingStatusNotificationRequest() |
||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* TeleStax, Open Source Cloud Communications | ||
* Copyright 2011-2016, TeleStax Inc. and individual contributors | ||
* by the @authors tag. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation; either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
* This file incorporates work covered by the following copyright and | ||
* permission notice: | ||
* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2007-2011, Red Hat, Inc. 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.jdiameter.api.sy; | ||
|
||
import org.jdiameter.api.IllegalDiameterStateException; | ||
import org.jdiameter.api.InternalException; | ||
import org.jdiameter.api.OverloadException; | ||
import org.jdiameter.api.RouteException; | ||
import org.jdiameter.api.app.AppSession; | ||
import org.jdiameter.api.app.StateMachine; | ||
|
||
import org.jdiameter.api.sy.events.SpendingLimitAnswer; | ||
import org.jdiameter.api.sy.events.SpendingTerminationRequest; | ||
import org.jdiameter.api.sy.events.SpendingNotificationRequest; | ||
|
||
/** | ||
* Basic class for Sy Server Interface specific session. | ||
* Listener must be injected from constructor of implementation class | ||
* | ||
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a> | ||
* @author <a href="mailto:[email protected]"> Alexandre Mendonca </a> | ||
* @author <a href="mailto:[email protected]"> Bartosz Baranowski </a> | ||
*/ | ||
|
||
public interface ServerSySession extends AppSession, StateMachine { | ||
|
||
void sendInitialSpendingLimitReportAnswer(SpendingLimitAnswer answer) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void sendIntermediateSpendingLimitReportAnswer(SpendingLimitAnswer request) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void sendFinalSpendingLimitReportAnswer(SpendingTerminationRequest request) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void sendSpendingLimitReportRequest(SpendingNotificationRequest request) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments as in Client. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes fixed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* TeleStax, Open Source Cloud Communications | ||
* Copyright 2011-2016, TeleStax Inc. and individual contributors | ||
* by the @authors tag. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation; either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
* This file incorporates work covered by the following copyright and | ||
* permission notice: | ||
* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2007-2011, Red Hat, Inc. 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.jdiameter.api.sy; | ||
|
||
import org.jdiameter.api.IllegalDiameterStateException; | ||
import org.jdiameter.api.InternalException; | ||
import org.jdiameter.api.OverloadException; | ||
import org.jdiameter.api.RouteException; | ||
|
||
import org.jdiameter.api.sy.events.SpendingLimitAnswer; | ||
import org.jdiameter.api.sy.events.SpendingLimitRequest; | ||
import org.jdiameter.api.sy.events.SpendingTerminationRequest; | ||
import org.jdiameter.api.sy.events.SpendingNotificationAnswer; | ||
import org.jdiameter.api.sy.events.SpendingTerminationAnswer; | ||
|
||
/** | ||
* This interface defines the possible actions for th;e different states in the server Sy | ||
* Interface state machine. | ||
* | ||
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a> | ||
* @author <a href="mailto:[email protected]"> Alexandre Mendonca </a> | ||
* @author <a href="mailto:[email protected]"> Bartosz Baranowski </a> | ||
*/ | ||
public interface ServerSySessionListener { | ||
|
||
void doInitialSpendingLimitReportRequest(ClientSySession session, SpendingLimitRequest request, SpendingLimitAnswer answer) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void doIntermediateSpendingLimitReportRequest(ClientSySession session, SpendingLimitRequest request, SpendingLimitAnswer answer) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void doFinalSpendingLimitReportRequest(ClientSySession session, SpendingTerminationRequest request, SpendingTerminationAnswer answer) | ||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
void doSpendingLimitReportAnswer(ClientSySession session, SpendingNotificationAnswer answer) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .. and |
||
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; | ||
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
* TeleStax, Open Source Cloud Communications | ||
* Copyright 2011-2016, TeleStax Inc. and individual contributors | ||
* by the @authors tag. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation; either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
* This file incorporates work covered by the following copyright and | ||
* permission notice: | ||
* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2007-2011, Red Hat, Inc. 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.jdiameter.api.sy.events; | ||
|
||
import org.jdiameter.api.app.AppAnswerEvent; | ||
|
||
/** | ||
* The Spending-Termination-Answer (STA) message, indicated by the Command-Code field set to 275 is sent | ||
* by the OCS to the PCRF in reply to the STR message. | ||
* | ||
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a> | ||
* @author <a href="mailto:[email protected]"> Bartosz Baranowski </a> | ||
* @author <a href="mailto:[email protected]"> Alexandre Mendonca </a> | ||
*/ | ||
public interface SessionTerminationAnswer extends AppAnswerEvent { | ||
|
||
String _SHORT_NAME = "STA"; | ||
String _LONG_NAME = "Session-Termination-Answer"; | ||
|
||
int code = 275; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use TeleStax only license for new files:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok