Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Sy Protocol Implementation #57

wants to merge 17 commits into from

Conversation

aferreiraguido
Copy link

No description provided.

Alex added 6 commits August 25, 2016 17:32
+ jdiameter-api/sy interfaces
+ jdiameter-api/sy interfaces
+ jdiameter-parent/examples/resources/dictionary.xml
+ defined OC-Supported-Features codes
+ added AVP definitions
+ jdiameter-parent/examples/resources/dictionary.xml
+ defined OC-Supported-Features codes
+ added AVP definitions
+ jdiameter-parent/examples/resources/dictionary.xml
+ fixed OC-Supported-Features codes
+ added AVP definitions for Sy
+ added DRMP
+ jdiameter-parent/examples/resources/dictionary.xml
+ fixed OC-Supported-Features codes
+ added AVP definitions for Sy
+ added DRMP
@FerUy
Copy link
Contributor

FerUy commented Sep 8, 2016

Related to issue #44

@deruelle
Copy link
Member

deruelle commented Sep 8, 2016

Thanks @aferreiraguido !

@brainslog @FerUy can you review ?

@FerUy
Copy link
Contributor

FerUy commented Sep 8, 2016

Hi @deruelle, work is not finished yet, right @aferreiraguido ?

@aferreiraguido
Copy link
Author

actually not. there was added api interfaces and AVP definitions to dictionary.xml.- Yet to be implemented is Common, Client and Server java code.

@FerUy
Copy link
Contributor

FerUy commented Sep 8, 2016

Understood. Thanks for the feedback @aferreiraguido

@aferreiraguido
Copy link
Author

Please see this is not a request for a merge, the Sy implementation is missing, I thought this pull will allow @brainslog to review the work done until now, as I need some feedback to be sure about the implementation on Server, Client and Common classes as well.

Alex added 2 commits September 9, 2016 08:11
+ jdiameter-parent/examples/resources/dictionary.xml
+ fixed OC-Supported-Features codes
+ added AVP definitions for Sy
+ added DRMP
issue #44
+ jdiameter-parent/examples/resources/dictionary.xml
+ fixed OC-Supported-Features codes
+ added AVP definitions for Sy
+ added DRMP
issue #44
@@ -0,0 +1,78 @@
/*
Copy link
Contributor

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:

/*
 * 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/>
 */

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

import org.jdiameter.api.app.StateMachine;

import org.jdiameter.api.sy.events.SpendingLimitRequest;
import org.jdiameter.api.sy.events.SpendingTerminationRequest;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class doesn't seem to be present in the commits..

void sendIntermediateSpendingLimitReportRequest(SpendingLimitRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void sendFinalSpendingLimitReportRequest(SpendingTerminationRequest request)
Copy link
Contributor

Choose a reason for hiding this comment

The 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 SpendingLimitRequest ?

Copy link
Author

Choose a reason for hiding this comment

The 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.

void sendFinalSpendingLimitReportRequest(SpendingTerminationRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void sendSpendingLimitReportAnswer(SpendingNotificationAnswer answer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this method be sendSpendingStatusNotificationAnswer ?
Also, the event class name should also be SpendingStatusNotificationAnswer instead of SpendingNotificationAnswer, IMO, to be according with the spec message name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, my fault.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing class.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

void doIntermediateSpendingLimitReportAnswer(ClientSySession session, SpendingLimitRequest request, SpendingLimitAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void doFinalSpendingLimitReportAnswer(ClientSySession session, SpendingTerminationRequest request, SpendingTerminationAnswer answer)
Copy link
Contributor

@brainslog brainslog Sep 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above, regarding using generic SpendingLimitRequest/SpendingLimitAnswer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted and fixed as well.

void doFinalSpendingLimitReportAnswer(ClientSySession session, SpendingTerminationRequest request, SpendingTerminationAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void doSpendingLimitReportRequest(ClientSySession session, SpendingNotificationAnswer answer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void doSpendingLimitReportRequest(ClientSySession session, SpendingStatusNotificationRequest request)?

  • method name should be doSpendingLimitReportRequest;
  • 2nd parameter should be a Request and not an Answer;
  • event name should be SpendingStatusNotificationRequest;

Right ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my fault, should be doSpendingStatusNotificationRequest()

void sendSpendingLimitReportRequest(SpendingNotificationRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as in Client.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes fixed

*/
public interface ClientSySession extends AppSession, StateMachine {

void sendInitialSpendingLimitReportRequest(SpendingLimitRequest request)
Copy link
Contributor

Choose a reason for hiding this comment

The 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 sendInitialSpendingLimitRequest.. I see that the spec often refers to it as you've used:

(...) uses the Initial Spending Limit Report Request procedure.
(...) trigger the PCRF sending the Initial/Intermediate/Final Spending Limit Report Request to the OCS (...)

WDYT ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right! INITIAL and INTERMEDIATE comes in AVP.SL-Request-Type

*/
public interface ServerSySessionListener {

void doInitialSpendingLimitReportRequest(ClientSySession session, SpendingLimitRequest request, SpendingLimitAnswer answer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do*Request methods only take the Request object as parameter, since those are the methods that will handle a received request, where we'll have no answer yet.

void doFinalSpendingLimitReportRequest(ClientSySession session, SpendingTerminationRequest request, SpendingTerminationAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void doSpendingLimitReportAnswer(ClientSySession session, SpendingNotificationAnswer answer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. and do*Answer methods take the Request and Answer objects as parameters, as we have both at this time and can pass them to the listener.

void doSpendingLimitReportAnswer(ClientSySession session, SpendingNotificationAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • same comments as in Client.

@@ -0,0 +1,62 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,62 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -67,6 +67,16 @@
<filtering>true</filtering>
</resource>
</resources>
<plugins>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't enforce this here, we have added similar @ https://github.com/RestComm/jdiameter/blob/master/pom.xml#L194-L201

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oks

@@ -7616,4 +7615,199 @@

<!-- ************************ END 3GPP S13/S13' AVPS ******************* -->

<!-- ***************************** 3GPP Sy AVPS ************************ -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be modified in all the instances of the dictionary.xml file, I understand it's not worth to propagate while not finished, but we should not forget about it. Main file is https://github.com/RestComm/jdiameter/blob/master/core/mux/common/config/dictionary.xml

@brainslog
Copy link
Contributor

@aferreiraguido, good job so far! Thanks for the hard work.

I have made some inline comments in the changes, please review them and let me know your thoughts and/or fix where applicable.

@aferreiraguido aferreiraguido changed the title Sy Protocol Implementation - Pull for API Interface & AVP's Sy Protocol Implementation Sep 24, 2016
Alex added 8 commits September 24, 2016 21:34
   + fixed according fo @brainslog comments
#issue 44
+renamed jdiameter/client/api/ISessionFactory.registerAppFac<t>ory()
issue #44
added testsuite/tests/sy/...
revert example/charging-server-simulator
issue #44

added AVP's for Ro messages
issue #43
@brainslog
Copy link
Contributor

Hi @aferreiraguido!

Sorry for the late review, but here are some of my notes. I thought about doing them inline, but I think it's easier to follow on a single comment, let me know if you have any doubts regarding what I am referring to!

  • @ Session and Listeners, [send/do]FinalSpendingLimit[Request/Answer] should be [send/do]SessionTermination[Request/Answer], to follow the name of the actual Diameter message.

  • Replace getSLRequestTypeAVPValue with getSLRequestType, as this simplifies the API.. we are not strict on this, as we have some getAVPValue, but I prefer if we don't add the suffix.

  • Don't change (un)registerAppFacory to (un)registerAppFactory (we know about this typo, but changing it will break many apps).

  • Also, please don't make unrelated changes in other places (eg, https://github.com/RestComm/jdiameter/pull/57/files#diff-2ea999abd5aad58a6283ef3a04cbe3dc, https://github.com/RestComm/jdiameter/pull/57/files#diff-ea50086ddc217fd882f3bc48efbd9bbe, several dictionary changes.. when you find these unrelated issues, please address them in a separate PR, so it's easier to review and merge)

  • ISyMessageFactory misses the methods for creating answers ?

  • getSLRequestTypeAVPValue always return 0 ?

  • Missing checks for null/invalid sessionData, listener, appIds values at ServerSySessionImpl constructor

  • ServerSySessionImpl is overriding methods from parent implementations with empty bodies (addStateChangeNotification, removeStateChangeNotification, getSessions, getSessionAppId, etc..)

  • ServerSySessionImpl : handleEvent : case SENT_INITIAL_RESPONSE is sending the message again instead of calling dispatchEvent(..) ?

  • ServerSySessionImpl is missing proper AnswerDelivery implementation

  • Is the ClientSySessionImpl missing (among other things?)

Overall it looks like this is still unfinished work, are you still open to finish this work ? I will be more active now on Diameter and able to provide feedback and help you quicker.

added testsuite/tests/sy/...
revert example/charging-server-simulator
issue #44

added AVP's for Ro messages
issue #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants