Skip to content

Sy Protocol Implementation #57

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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/>
*/

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.auth.events.SessionTermRequest;

import org.jdiameter.api.sy.events.SpendingLimitRequest;
import org.jdiameter.api.sy.events.SpendingStatusNotificationAnswer;

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

public interface ClientSySession extends AppSession, StateMachine {

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

void sendSessionTerminationRequest(SessionTermRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void sendSpendingStatusNotificationAnswer(SpendingStatusNotificationAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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/>
*/

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.auth.events.SessionTermAnswer;
import org.jdiameter.api.auth.events.SessionTermRequest;

import org.jdiameter.api.sy.events.SpendingLimitRequest;
import org.jdiameter.api.sy.events.SpendingLimitAnswer;
import org.jdiameter.api.sy.events.SpendingStatusNotificationRequest;

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

public interface ClientSySessionListener {

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

void doSessionTerminationAnswer(ClientSySession session, SessionTermRequest request, SessionTermAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void doSpendingStatusNotificationRequest(ClientSySession session, SpendingStatusNotificationRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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/>
*/

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.auth.events.SessionTermAnswer;

import org.jdiameter.api.sy.events.SpendingLimitAnswer;
import org.jdiameter.api.sy.events.SpendingStatusNotificationRequest;

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

public interface ServerSySession extends AppSession, StateMachine {

void sendSpendingLimitAnswer(SpendingLimitAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void sendSessionTerminationAnswer(SessionTermAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void sendSpendingStatusNotificationRequest(SpendingStatusNotificationRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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/>
*/

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.auth.events.SessionTermRequest;

import org.jdiameter.api.sy.events.SpendingLimitRequest;
import org.jdiameter.api.sy.events.SpendingStatusNotificationAnswer;
import org.jdiameter.api.sy.events.SpendingStatusNotificationRequest;

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

public interface ServerSySessionListener {

void doSpendingLimitRequest(ServerSySession session, SpendingLimitRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void doSessionTerminationRequest(ServerSySession session, SessionTermRequest request)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

void doSpendingStatusNotificationAnswer(ServerSySession session, SpendingStatusNotificationRequest request, SpendingStatusNotificationAnswer answer)
throws InternalException, IllegalDiameterStateException, RouteException, OverloadException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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/>
*/

package org.jdiameter.api.sy;

/**
* This interface defines the Sy Session marker class
*
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a>
*/

import org.jdiameter.api.app.AppSession;
import org.jdiameter.api.app.StateMachine;

public interface SySession extends AppSession, StateMachine {
// simple marker interface.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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/>
*/

package org.jdiameter.api.sy.events;

import org.jdiameter.api.app.AppAnswerEvent;

/**
* The Spending-Limit-Answer (SLA) message, indicated by the Command-Code field set to 8388635 is sent
* by the OCS to the PCRF as a response to SLR message.
*
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a>
*/

public interface SpendingLimitAnswer extends AppAnswerEvent {

String _SHORT_NAME = "SLA";
String _LONG_NAME = "Spending-Limit-Answer";

int code = 8388635;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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/>
*/

package org.jdiameter.api.sy.events;

import org.jdiameter.api.app.AppRequestEvent;

/**
* The Spending-Limit-Request (SLR) message, indicated by the Command-Code field set to 8388635 is sent
* by the PCRF ot the OCS to retrieve subscription information that indicates that policy decision depends
* on policy counters held on the OCS.
*
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a>
*/

public interface SpendingLimitRequest extends AppRequestEvent {

String _SHORT_NAME = "SLR";
String _LONG_NAME = "Spending-Limit-Request";

int code = 8388635;

int getSLRequestType();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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/>
*/

package org.jdiameter.api.sy.events;

import org.jdiameter.api.app.AppAnswerEvent;

/**
* The Spending-Notification-Answer (SNA) message, indicated by the Command-Code field set to 8388636 is sent
* by the PCRF to the OCS in reply to the SNR message.
*
* @author <a href="mailto:[email protected]"> Alejandro Ferreira Guido </a>
*/

public interface SpendingStatusNotificationAnswer extends AppAnswerEvent {

String _SHORT_NAME = "SNA";
String _LONG_NAME = "Spending-Status-Notification-Answer";

int code = 8388636;

}
Loading