code
stringlengths
3
1.18M
language
stringclasses
1 value
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface JAuthenticationInformationRequest extends AppRequestEvent { public static final String _SHORT_NAME = "AIR"; public static final String _LONG_NAME = "Authentication-Information-Request"; public static final int code = 318; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface JUpdateLocationRequest extends AppRequestEvent { public static final String _SHORT_NAME = "ULR"; public static final String _LONG_NAME = "Update-Location-Request"; public static final int code = 316; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JNotifyRequest extends AppRequestEvent { public static final String _SHORT_NAME = "NOR"; public static final String _LONG_NAME = "Notify-Request"; public static final int code = 323; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JInsertSubscriberDataRequest extends AppRequestEvent { public static final String _SHORT_NAME = "IDR"; public static final String _LONG_NAME = "Insert-Subscriber-Data-Request"; public static final int code = 319; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JResetRequest extends AppRequestEvent { public static final String _SHORT_NAME = "RSR"; public static final String _LONG_NAME = "Reset-Request"; public static final int code = 322; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JCancelLocationAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "CLA"; public static final String _LONG_NAME = "Cancel-Location-Answer"; public static final int code = 317; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JCancelLocationRequest extends AppRequestEvent { public static final String _SHORT_NAME = "CLR"; public static final String _LONG_NAME = "Cancel-Location-Request"; public static final int code = 317; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface JAuthenticationInformationAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "AIA"; public static final String _LONG_NAME = "Authentication-Information-Answer"; public static final int code = 318; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface JPurgeUEAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "PUA"; public static final String _LONG_NAME = "Purge-UE-Answer"; public static final int code = 321; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface JUpdateLocationAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "ULA"; public static final String _LONG_NAME = "Update-Location-Answer"; public static final int code = 316; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JResetAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "RSA"; public static final String _LONG_NAME = "Reset-Answer"; public static final int code = 322; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JNotifyAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "NOA"; public static final String _LONG_NAME = "Notify-Answer"; public static final int code = 323; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JDeleteSubscriberDataAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "DSA"; public static final String _LONG_NAME = "Delete-Subscriber-Data-Answer"; public static final int code = 320; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppAnswerEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JInsertSubscriberDataAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "IDA"; public static final String _LONG_NAME = "Insert-Subscriber-Data-Answer"; public static final int code = 319; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface JPurgeUERequest extends AppRequestEvent { public static final String _SHORT_NAME = "PUR"; public static final String _LONG_NAME = "Purge-UE-Request"; public static final int code = 321; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a.events; import org.jdiameter.api.app.AppRequestEvent; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface JDeleteSubscriberDataRequest extends AppRequestEvent { public static final String _SHORT_NAME = "DSR"; public static final String _LONG_NAME = "Delete-Subscriber-Data-Request"; public static final int code = 320; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a; 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.s6a.events.JAuthenticationInformationAnswer; import org.jdiameter.api.s6a.events.JCancelLocationRequest; import org.jdiameter.api.s6a.events.JDeleteSubscriberDataRequest; import org.jdiameter.api.s6a.events.JInsertSubscriberDataRequest; import org.jdiameter.api.s6a.events.JNotifyAnswer; import org.jdiameter.api.s6a.events.JPurgeUEAnswer; import org.jdiameter.api.s6a.events.JResetRequest; import org.jdiameter.api.s6a.events.JUpdateLocationAnswer; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface ServerS6aSession extends AppSession, StateMachine { /** * Send Cancel-Location-Request to client * * @param request Cancel-Location-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendCancelLocationRequest(JCancelLocationRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Insert-Subscriber-Data-Request to client * * @param request Insert-Subscriber-Data-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendInsertSubscriberDataRequest(JInsertSubscriberDataRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Delete-Subscriber-Data-Request to client * * @param request Delete-Subscriber-Data-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendDeleteSubscriberDataRequest(JDeleteSubscriberDataRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Reset-Request to client * * @param request Reset-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendResetRequest(JResetRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Authentication-Information-Answer to client * * @param answer Authentication-Information-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendAuthenticationInformationAnswer(JAuthenticationInformationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Purge-UE-Answer to client * * @param answer Purge-UE-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendPurgeUEAnswer(JPurgeUEAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Notify-Answer to client * * @param answer Notify-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendNotifyAnswer(JNotifyAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Update-Location-Answer to client * * @param answer Update-Location-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendUpdateLocationAnswer(JUpdateLocationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.s6a.events.JAuthenticationInformationRequest; import org.jdiameter.api.s6a.events.JCancelLocationAnswer; import org.jdiameter.api.s6a.events.JCancelLocationRequest; import org.jdiameter.api.s6a.events.JDeleteSubscriberDataAnswer; import org.jdiameter.api.s6a.events.JDeleteSubscriberDataRequest; import org.jdiameter.api.s6a.events.JInsertSubscriberDataAnswer; import org.jdiameter.api.s6a.events.JInsertSubscriberDataRequest; import org.jdiameter.api.s6a.events.JNotifyRequest; import org.jdiameter.api.s6a.events.JPurgeUERequest; import org.jdiameter.api.s6a.events.JResetAnswer; import org.jdiameter.api.s6a.events.JResetRequest; import org.jdiameter.api.s6a.events.JUpdateLocationRequest; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a> */ public interface ServerS6aSessionListener { void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doAuthenticationInformationRequestEvent(ServerS6aSession session, JAuthenticationInformationRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doPurgeUERequestEvent(ServerS6aSession session, JPurgeUERequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doUpdateLocationRequestEvent(ServerS6aSession session, JUpdateLocationRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doNotifyRequestEvent(ServerS6aSession session, JNotifyRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doCancelLocationAnswerEvent(ServerS6aSession session, JCancelLocationRequest request, JCancelLocationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doInsertSubscriberDataAnswerEvent(ServerS6aSession session, JInsertSubscriberDataRequest request, JInsertSubscriberDataAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doDeleteSubscriberDataAnswerEvent(ServerS6aSession session, JDeleteSubscriberDataRequest request, JDeleteSubscriberDataAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doResetAnswerEvent(ServerS6aSession session, JResetRequest request, JResetAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.s6a.events.JAuthenticationInformationAnswer; import org.jdiameter.api.s6a.events.JAuthenticationInformationRequest; import org.jdiameter.api.s6a.events.JCancelLocationRequest; import org.jdiameter.api.s6a.events.JDeleteSubscriberDataRequest; import org.jdiameter.api.s6a.events.JInsertSubscriberDataRequest; import org.jdiameter.api.s6a.events.JNotifyAnswer; import org.jdiameter.api.s6a.events.JNotifyRequest; import org.jdiameter.api.s6a.events.JPurgeUEAnswer; import org.jdiameter.api.s6a.events.JPurgeUERequest; import org.jdiameter.api.s6a.events.JResetRequest; import org.jdiameter.api.s6a.events.JUpdateLocationAnswer; import org.jdiameter.api.s6a.events.JUpdateLocationRequest; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface ClientS6aSessionListener { void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doCancelLocationRequestEvent(ClientS6aSession session, JCancelLocationRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doInsertSubscriberDataRequestEvent(ClientS6aSession session, JInsertSubscriberDataRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doDeleteSubscriberDataRequestEvent(ClientS6aSession session, JDeleteSubscriberDataRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doResetRequestEvent(ClientS6aSession session, JResetRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doAuthenticationInformationAnswerEvent(ClientS6aSession session, JAuthenticationInformationRequest request, JAuthenticationInformationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doPurgeUEAnswerEvent(ClientS6aSession session, JPurgeUERequest request, JPurgeUEAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doUpdateLocationAnswerEvent(ClientS6aSession session, JUpdateLocationRequest request, JUpdateLocationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doNotifyAnswerEvent(ClientS6aSession session, JNotifyRequest request, JNotifyAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.s6a; 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.s6a.events.JAuthenticationInformationRequest; import org.jdiameter.api.s6a.events.JCancelLocationAnswer; import org.jdiameter.api.s6a.events.JDeleteSubscriberDataAnswer; import org.jdiameter.api.s6a.events.JInsertSubscriberDataAnswer; import org.jdiameter.api.s6a.events.JNotifyRequest; import org.jdiameter.api.s6a.events.JPurgeUERequest; import org.jdiameter.api.s6a.events.JResetAnswer; import org.jdiameter.api.s6a.events.JUpdateLocationRequest; /** * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface ClientS6aSession extends AppSession, StateMachine { /** * Send Authentication-Information-Request to server * * @param request Authentication-Information-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendAuthenticationInformationRequest(JAuthenticationInformationRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Purge-UE-Request to server * * @param request Purge-UE-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendPurgeUERequest(JPurgeUERequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Notify-Request to server * * @param request Notify-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendNotifyRequest(JNotifyRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Update-Location-Request to server * * @param request Update-Location-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendUpdateLocationRequest(JUpdateLocationRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Cancel-Location-Answer to server * * @param answer Cancel-Location-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendCancelLocationAnswer(JCancelLocationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Insert-Subscriber-Data-Answer to server * * @param answer Insert-Subscriber-Data-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendInsertSubscriberDataAnswer(JInsertSubscriberDataAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Delete-Subscriber-Data-Answer to server * * @param answer Delete-Subscriber-Data-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendDeleteSubscriberDataAnswer(JDeleteSubscriberDataAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send Reset-Answer to server * * @param answer Reset-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendResetAnswer(JResetAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.app; import org.jdiameter.api.OverloadException; import org.jdiameter.api.InternalException; /** * The StateMachine lets you organize event handling, * if the order of the events are important to you. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface StateMachine { /** * Add a new state change listener * @param listener a reference to the listener that will get information about state changes. */ void addStateChangeNotification(StateChangeListener listener); /** * Remove a state change listener * @param listener a reference to the listener that will get information about state changes. */ void removeStateChangeNotification(StateChangeListener listener); /** * Handle an event in the current state. * @param event processing event * @return true if staterocessed * @throws OverloadException if queue of state mashine is full * @throws InternalException if FSM has internal error */ boolean handleEvent(StateEvent event) throws InternalException, OverloadException; /** * Get the current state * @param stateType type of state * @return current state */ <E> E getState(Class<E> stateType); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.app; import org.jdiameter.api.AvpDataException; /** * Basic class for application specific request event (Sx, Rx, Gx) * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AppRequestEvent extends AppEvent { /** * Return destination host avp value ( null if avp is empty ) * * @return destination host avp value * @throws AvpDataException if avp is not string */ public String getDestinationHost() throws AvpDataException; /** * Return destination realm avp value ( null if avp is empty ) * * @return origination realm avp value * @throws AvpDataException if avp is not string */ public String getDestinationRealm() throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.app; /** * This interface must be extended by any class that should implement a certain state in the state machine. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface State { /** * Action that should be taken each time this state is entered */ void entryAction(); /** * Action that should be taken each time this state is exited */ void exitAction(); /** * This method processed received event. * @param event the event to process. * @return true if event is processed */ boolean processEvent(StateEvent event); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.app; import org.jdiameter.api.ApplicationId; import org.jdiameter.api.BaseSession; import org.jdiameter.api.Session; import java.util.List; /** * Basic class for application specific session (Sx, Rx, Gx) * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AppSession extends BaseSession { /** * Return true if session has stateless FSM * * @return true if session has stateless FSM */ boolean isStateless(); /** * Return current value of applicationId of application session. * * @return applicationId of application session. */ ApplicationId getSessionAppId(); /** * Returns a list of child sessions * * @return List of child delivery sessions */ List<Session> getSessions(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.app; /** * The Event class holds information about the different events that can be handled * by the state machine. Events are prioritized depending on the importance of the event. * The priority model tries to ensure that old messages are handled before any new ones. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface StateEvent extends Comparable { /** * This method should be adapted by any subclass * to return the type corresponding to the actual event. * @return type of this StateEvent */ public <E> E encodeType(Class<E> enumType); /** * Return type of this StateEvent * @return type of this StateEvent */ public Enum getType(); /** * Returns a negative value if the priority for this object * is higher than the priority for the supplied object. * @param obj the Event to compare to. * @return compare result */ /** * Set information object to this StateEvent * @param data information object */ public void setData(Object data); /** * Return information object of this StateEvent * @return information object of this StateEvent */ public Object getData(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.app; import org.jdiameter.api.Avp; import org.jdiameter.api.AvpDataException; /** * Basic class for application specific answer event (Sx, Rx, Gx) * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AppAnswerEvent extends AppEvent { /** * Return result code (or experimental if present) AVP of answer message * @return result code (or experimental if present) AVP of answer message * @throws AvpDataException if result code avp absent */ Avp getResultCodeAvp() throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.app; /** * Interface used to inform about changes in the state for a FSM. * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface StateChangeListener<T> { /** * @deprecated * A change of state has occurred for a FSM. * @param oldState Old state of FSM * @param newState New state of FSM */ @SuppressWarnings("unchecked") void stateChanged(Enum oldState, Enum newState); /** * A change of state has occurred for a FSM. * * @param source the App Session that generated the change. * @param oldState Old state of FSM * @param newState New state of FSM */ @SuppressWarnings("unchecked") void stateChanged(T source, Enum oldState, Enum newState); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.app; import org.jdiameter.api.Message; import org.jdiameter.api.InternalException; import org.jdiameter.api.AvpDataException; import java.io.Serializable; /** * Basic class for application specific event (Sx, Rx, Gx) * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AppEvent extends Serializable { /** * @return commCode of parent message */ public int getCommandCode(); /** * @return set of associated message * @throws InternalException signals that internal message is not set. */ public Message getMessage() throws InternalException; /** * Return origination host avp value ( null if avp is empty ) * * @return origination host avp value * @throws AvpDataException if avp is not string */ public String getOriginHost() throws AvpDataException; /** * Return origination realm avp value ( null if avp is empty ) * * @return origination realm avp value * @throws AvpDataException if avp is not string */ public String getOriginRealm() throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * The listener interface for receiving runtime configuration changes events. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface ConfigurationListener { /** * Invoked when an changes is occurs. * @param key index of changed element * @param newValue new value * @return true if new value is applied */ boolean elementChanged(int key, Object newValue); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * The NoRouteException signals that no route exist for a given realm. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public class RouteException extends Exception { private static final long serialVersionUID = 1L; /** * Constructor with reason string * @param message reason string */ public RouteException(String message) { super(message); } /** * Constructor with reason string and parent exception * @param message message reason string * @param cause parent exception */ public RouteException(String message, Throwable cause) { super(message, cause); } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006-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; /** * Stack properties for working. * This interface equals IMemento interface from Eclispe (pattern Memento). * It interface hideWay of a storage of stack properties (XML file ant etc) * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author artem.litvinov@gmail.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface Configuration { /** * Returns the Byte point value of the given key. * * @param key the key * @param defaultValue the Default Value * @return the value, or <code>defValue</code> if the key was not found or was found * but was not a Byte point number */ byte getByteValue(int key, byte defaultValue); /** * Returns the Integer point value of the given key. * * @param key the key * @param defaultValue the Default Value * @return the value, or <code>defaultValue</code> if the key was not found or was found * but was not a Integer point number */ int getIntValue(int key, int defaultValue); /** * Returns the long point value of the given key. * * @param key the key * @param defaultValue the Default Value * @return the value, or <code>defaultValue</code> if the key was not found or was found * but was not a long point number */ long getLongValue(int key, long defaultValue); /** * Returns the double point value of the given key. * * @param key the key * @param defaultValue the Default Value * @return the value, or <code>defaultValue</code> if the key was not found or was found * but was not a double point number */ double getDoubleValue(int key, double defaultValue); /** * Returns the byte[] point value of the given key. * * @param key the key * @param defaultValue the Default Value * @return the value, or <code>defaultValue</code> if the key was not found or was found * but was not a byte[] point number */ byte[] getByteArrayValue(int key, byte[] defaultValue); /** * Returns the boolean point value of the given key. * * @param key the key * @param defaultValue the Default Value * @return the value, or <code>defaultValue</code> if the key was not found or was found * but was not a boolean point number */ boolean getBooleanValue(int key, boolean defaultValue); /** * Returns the String point value of the given key. * * @param key the key * @param defaultValue the Default Value * @return the value, or <code>defaultValue</code> if the key was not found or was found * but was not a String point number */ String getStringValue(int key, String defaultValue); /** * @param key key of attribute * @return true if value of parameter is not null */ boolean isAttributeExist(int key); /** * Returns all children with the given type id. * * @param key the type id * @return an array of children with the given type */ Configuration[] getChildren(int key); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx; 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.gx.events.GxReAuthRequest; import org.jdiameter.api.gx.events.GxCreditControlAnswer; /** * Basic class for server credit-control application specific session. * Listener must be injected from constructor of implementation class * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface ServerGxSession extends AppSession, StateMachine { /** * Send credit-control answer to client * @param answer Credit-Control-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ public void sendCreditControlAnswer(GxCreditControlAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send re-authentication request to client * @param request Re-Auth-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ public void sendGxReAuthRequest(GxReAuthRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.gx.events.GxReAuthAnswer; import org.jdiameter.api.gx.events.GxReAuthRequest; import org.jdiameter.api.gx.events.GxCreditControlRequest; /** * This interface defines the possible actions for the different states in the server * Credit-Control Application state machine. * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface ServerGxSessionListener { /** * Notifies this ServerRoSessionListener that the ServerRoSession has received a CCR message. * * @param session parent application session (FSM) * @param request request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doCreditControlRequest(ServerGxSession session, GxCreditControlRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this ServerRoSessionListener that the ServerRoSession has received a RAA message. * * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doGxReAuthAnswer(ServerGxSession session, GxReAuthRequest request, GxReAuthAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this ServerRoSessionListener that the ServerRoSession has received not Ro message, * now it can be even RAA. * * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx.events; import org.jdiameter.api.app.AppRequestEvent; /** * The CCR messages, indicated by the Command-Code field set to 272 is sent by the CTF to the OCF * in order to request credits for the request bearer / subsystem / service. * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface GxCreditControlRequest extends AppRequestEvent { public static final String _SHORT_NAME = "CCR"; public static final String _LONG_NAME = "Credit-Control-Request"; public static final int code = 272; boolean isRequestedActionAVPPresent(); int getRequestedActionAVPValue(); boolean isRequestTypeAVPPresent(); int getRequestTypeAVPValue(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx.events; import org.jdiameter.api.Avp; import org.jdiameter.api.app.AppAnswerEvent; /** * The Credit-Control-Answer (CCA) messages, indicated by the Command-Code field set to 272 is sent * by the OCF to the CTF in order to reply to the CCR. * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface GxCreditControlAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "CCA"; public static final String _LONG_NAME = "Credit-Control-Answer"; public static final int code = 272; boolean isCreditControlFailureHandlingAVPPresent(); int getCredidControlFailureHandlingAVPValue(); boolean isDirectDebitingFailureHandlingAVPPresent(); int getDirectDebitingFailureHandlingAVPValue(); boolean isRequestTypeAVPPresent(); int getRequestTypeAVPValue(); Avp getValidityTimeAvp(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx.events; import org.jdiameter.api.app.AppRequestEvent; /** * The CCR messages, indicated by the Command-Code field set to 272 is sent by the CTF to the OCF * in order to request credits for the request bearer / subsystem / service. * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface GxReAuthRequest extends AppRequestEvent { public static final String _SHORT_NAME = "RAR"; public static final String _LONG_NAME = "Re-Auth-Request"; public static final int code = 258; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx.events; import org.jdiameter.api.app.AppAnswerEvent; /** * The Credit-Control-Answer (CCA) messages, indicated by the Command-Code field set to 272 is sent * by the OCF to the CTF in order to reply to the CCR. * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface GxReAuthAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "RAA"; public static final String _LONG_NAME = "Re-Auth-Answer"; public static final int code = 258; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx; 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.gx.events.GxReAuthAnswer; import org.jdiameter.api.gx.events.GxCreditControlRequest; /** * Basic class for Gx client credit-control application specific session. * Listener must be injected from constructor of implementation class. * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface ClientGxSession extends AppSession, StateMachine { /** * Send credit-control request to server. * @param request Credit-Control-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ public void sendCreditControlRequest(final GxCreditControlRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send re-authentication answer to server * @param answer Re-Auth-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ public void sendGxReAuthAnswer(final GxReAuthAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gx; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.gx.events.GxReAuthRequest; import org.jdiameter.api.gx.events.GxCreditControlAnswer; import org.jdiameter.api.gx.events.GxCreditControlRequest; /** * This interface defines the possible actions for the different states in the client * Credit-Control Application state machine. * * @author <a href="mailto:carl-magnus.bjorkell@emblacom.com"> Carl-Magnus Björkell </a> */ public interface ClientGxSessionListener { /** * Notifies this ClientGxSessionListener that the ClientGxSession has received a Ro message. * * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error has occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doCreditControlAnswer(ClientGxSession session, GxCreditControlRequest request, GxCreditControlAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this ClientGxSessionListener that the ClientGxSession has received a RAR message. * * @param session parent application session (FSM) * @param request request object * @throws InternalException The InternalException signals that internal error has occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doGxReAuthRequest(ClientGxSession session, GxReAuthRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this ClientGxSessionListener that the ClientGxSession has received a non Gx message, usually some extension. * * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error has occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Provides with default value of DDFH AVP - this is used when AVP is not present or send * operation fails for some reason.<br> * DDFH is of type Enumerated - int32 * * @return */ int getDefaultDDFHValue(); /** * Provides with default value of CCFH AVP - this is used when AVP is not present or send * operation fails for some reason.<br> * CCFH is of type Enumerated - int32 * * @return */ int getDefaultCCFHValue(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; import org.jdiameter.api.app.AppSession; /** * This class created session instance (Factory) * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface SessionFactory { /** * Generates new session id which can be used as argument in * {@link #getNewSession(String)} or * {@link #getNewAppSession(String, ApplicationId, Class)}. * * @return new id for session. * @since 1.5.4.1-build416 */ public String getSessionId(); /** * See {@link #getSessionId()}. This method has similar semantics, it adds * custom part to id. * * @param customPart * @return * @since 1.5.4.1-build416 */ public String getSessionId(String customPart); /** * Create new raw session instance * * @return session instance of session * @throws InternalException if a error occurs */ RawSession getNewRawSession() throws InternalException; /** * Create new session with new session id * * @return session instance of session * @throws InternalException if a error occurs */ Session getNewSession() throws InternalException; /** * Create new session with predefined sessionId * You can create special sessions to work on distributed systems * * @param sessionId instance of session * @return session instance of session * @throws InternalException if a error occurs */ Session getNewSession(String sessionId) throws InternalException; /** * Create new vendor specific application session * Use this method for create specific application sessions * Example: ClientShSession session = factory.getNewSession(appId, ClientShSession.class) * * @param applicationId predefined application id * @param userSession A Class defining an interface that the result must implement. * @return session instance * @throws InternalException if a error occurs */ <T extends AppSession> T getNewAppSession(ApplicationId applicationId, Class<? extends AppSession> userSession) throws InternalException; /** * Create new vendor specific application session with predefined sessionId, origination host/realm names. * You can create special sessions to work on distributed systems * Use this method for create specific application sessions * Example: ClientShSession session = factory.getNewSession(appId, ClientShSession.class) * * @param sessionId instance of session * @param applicationId predefined application id * @param userSession A Class defining an interface that the result must implement. * @return session instance * @throws InternalException if a error occurs */ <T extends AppSession> T getNewAppSession(String sessionId, ApplicationId applicationId, Class<? extends AppSession> userSession) throws InternalException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * This enumerated class define type of jDiameter stacks * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public enum StackType { TYPE_CLIENT, TYPE_SERVER }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * Signals that a method has been invoked at an illegal or * inappropriate time. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public class IllegalDiameterStateException extends Exception { private static final long serialVersionUID = 1L; public IllegalDiameterStateException() { } public IllegalDiameterStateException(String message) { super(message); } public IllegalDiameterStateException(String message, Throwable cause) { super(message, cause); } public IllegalDiameterStateException(Throwable cause) { super(cause); } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; //import org.jdiameter.api.auth.events.ReAuthAnswer; //import org.jdiameter.api.auth.events.ReAuthRequest; import org.jdiameter.api.rx.events.RxReAuthRequest; import org.jdiameter.api.rx.events.RxReAuthAnswer; //import org.jdiameter.api.auth.events.AbortSessionAnswer; //import org.jdiameter.api.auth.events.AbortSessionRequest; import org.jdiameter.api.rx.events.RxAbortSessionRequest; import org.jdiameter.api.rx.events.RxAbortSessionAnswer; //import org.jdiameter.api.auth.events.SessionTermRequest; import org.jdiameter.api.rx.events.RxSessionTermRequest; import org.jdiameter.api.rx.events.RxAARequest; /** * This interface defines the possible actions for the different states in the server Rx * Interface state machine. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ServerRxSessionListener { void doAARequest(ServerRxSession session, RxAARequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doSessionTermRequest(ServerRxSession session, RxSessionTermRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doReAuthAnswer(ServerRxSession session, RxReAuthRequest request, RxReAuthAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doAbortSessionAnswer(ServerRxSession session, RxAbortSessionRequest request, RxAbortSessionAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.rx.events.RxAAAnswer; import org.jdiameter.api.rx.events.RxAARequest; import org.jdiameter.api.rx.events.RxAbortSessionRequest; import org.jdiameter.api.rx.events.RxReAuthRequest; import org.jdiameter.api.rx.events.RxSessionTermAnswer; import org.jdiameter.api.rx.events.RxSessionTermRequest; /** * This interface defines the possible actions for the different states in the client * Rx Interface state machine. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ClientRxSessionListener { void doAAAnswer(ClientRxSession session, RxAARequest request, RxAAAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doReAuthRequest(ClientRxSession session, RxReAuthRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doSessionTermAnswer(ClientRxSession session, RxSessionTermRequest request, RxSessionTermAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doAbortSessionRequest(ClientRxSession session, RxAbortSessionRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppAnswerEvent; /** * The AAA command, indicated by the Command-Code field set to 265 and the 'R' bit cleared * in the Command Flags field, is sent by the PCRF to the AF in response to the AAR command. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxAAAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "AAA"; public static final String _LONG_NAME = "AA-Answer"; public static final int code = 265; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppRequestEvent; /** * The RAR command, indicated by the Command-Code field set to 258 and the 'R' bit set in the * Command Flags field, is sent by an PCRF to the AF in order to provide it with the Session Information. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxReAuthRequest extends AppRequestEvent { public static final String _SHORT_NAME = "RAR"; public static final String _LONG_NAME = "Re-Auth-Request"; public static final int code = 258; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppAnswerEvent; /** * The STA command, indicated by the Command-Code field set to 275 and the 'R' bit cleared * in the Command Flags field, is sent by the PCRF to the AF in response to the STR command. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxSessionTermAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "STA"; public static final String _LONG_NAME = "Session-Termination-Answer"; public static final int code = 275; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppAnswerEvent; /** * The RAA command, indicated by the Command-Code field set to 258 and the 'R' bit cleared * in the Command Flags field, is sent by the AF to the PCRf in response to the RAR command. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxReAuthAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "RAA"; public static final String _LONG_NAME = "Re-Auth-Answer"; public static final int code = 258; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppRequestEvent; /** * The STR command, indicated by the Command-Code field set to 275 and the 'R' bit set in the * Command Flags field, is sent by an AF to the PCRF in order to terminate a session. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxSessionTermRequest extends AppRequestEvent { public static final String _SHORT_NAME = "STR"; public static final String _LONG_NAME = "Session-Termination-Request"; public static final int code = 275; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppRequestEvent; /** * The AAR command, indicated by the Command-Code field set to 265 and the 'R' bit set in the * Command Flags field, is sent by an AF to the PCRF in order to provide it with the Session Information. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxAARequest extends AppRequestEvent { public static final String _SHORT_NAME = "AAR"; public static final String _LONG_NAME = "AA-Request"; public static final int code = 265; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppAnswerEvent; /** * The ASA command, indicated by the Command-Code field set to 274 and the 'R' bit cleared * in the Command Flags field, is sent by the AF to the PCRF in response to the ASR command. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxAbortSessionAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "ASA"; public static final String _LONG_NAME = "Abort-Session-Answer"; public static final int code = 274; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx.events; import org.jdiameter.api.app.AppRequestEvent; /** * The ASR command, indicated by the Command-Code field set to 274 and the 'R' bit set in the * Command Flags field, is sent by a PCRF to the AF in order to abort a session. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RxAbortSessionRequest extends AppRequestEvent { public static final String _SHORT_NAME = "ASR"; public static final String _LONG_NAME = "Abort-Session-Request"; public static final int code = 274; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx; 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.rx.events.RxAARequest; import org.jdiameter.api.rx.events.RxAbortSessionAnswer; import org.jdiameter.api.rx.events.RxReAuthAnswer; import org.jdiameter.api.rx.events.RxSessionTermRequest; /** * Basic class for Rx Client Interface specific session. * Listener must be injected from constructor of implementation class. * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ClientRxSession extends AppSession, StateMachine { public void sendAARequest(final RxAARequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; public void sendSessionTermRequest(final RxSessionTermRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; public void sendReAuthAnswer(final RxReAuthAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; public void sendAbortSessionAnswer(final RxAbortSessionAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.rx; 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.rx.events.RxAAAnswer; import org.jdiameter.api.rx.events.RxAbortSessionRequest; import org.jdiameter.api.rx.events.RxReAuthRequest; import org.jdiameter.api.rx.events.RxSessionTermAnswer; /** * Basic class for Rx Server Interface specific session. * Listener must be injected from constructor of implementation class * * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ServerRxSession extends AppSession, StateMachine { public void sendAAAnswer(RxAAAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; public void sendSessionTermAnswer(RxSessionTermAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; public void sendReAuthRequest(RxReAuthRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; public void sendAbortSessionRequest(RxAbortSessionRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * Common event listener * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface EventListener<R extends Message, A extends Message> { /** * Notifies this Listener that stack has received diameter answer message. * For network requests - answer parameter is null * * @param request the request message * @param answer the answer on application request */ void receivedSuccessMessage(R request, A answer); /** * Notifies this Listener that the request has timeout. * * @param request the request has timeout */ void timeoutExpired(R request); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * The session delivery objects are responsible for delivering all incoming Message to a specific session. * It determines the Diameter Session object that the message belongs to by querying the message's session id AVP. * The delivery object searches the local session database for a matching session. If no matching session is found, * the delivery object will lookup a matching session factory object that has an application id matching the * application id of the message. If there is a registered session factory, then the delivery object will ask the * factory to create a new session and delivery the message to the newly created session. If non of these lookup's * are successful, the session delivery object will silently discard the message. * Wrapper interface allows adapt message to any driver vendor specific interface * Serializable interface allows use this class in SLEE Event objects * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author artem.litvinov@gmail.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface BaseSession { /** * Returns the time when this session was created (milliseconds) * Start point of time January 1, 1970 GMT. * @return long specifying when this session was created */ long getCreationTime(); /** * Returns the last time an event occurred on this session (milliseconds) * Start point of time January 1, 1970 GMT. * @return long specifying when last time an event occurred on this session */ long getLastAccessedTime(); /** * Return true if session is not released * @return true if session is not released */ boolean isValid(); /** * Release all resources append to session */ void release(); /** * Indicates if this is an App Session or a raw/base session * @return */ boolean isAppSession(); /** * Indicates if the session is replicable * * @return */ boolean isReplicable(); /** * @return session-id as String (Session-Id AVP) */ String getSessionId(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth; 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.AppAnswerEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.app.StateMachine; import org.jdiameter.api.auth.events.AbortSessionRequest; import org.jdiameter.api.auth.events.ReAuthRequest; import org.jdiameter.api.auth.events.SessionTermAnswer; /** * Basic class for server authentication application specific session. * Listener must injection from constructor of implementation class. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ServerAuthSession extends AppSession, StateMachine { /** * Send authenticate answer to client * @param answer Authentication answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ void sendAuthAnswer(AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send re-authenticate request to client * @param request Re-Authentication request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ void sendReAuthRequest(ReAuthRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send session abort session request to client * @param request Abort-Session-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ void sendAbortSessionRequest(AbortSessionRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send session termination answer to client * @param request Session-Term-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ void sendSessionTerminationAnswer(SessionTermAnswer request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.auth.events.AbortSessionRequest; import org.jdiameter.api.auth.events.ReAuthRequest; import org.jdiameter.api.auth.events.SessionTermAnswer; /** * This interface defines the possible actions that the different states in the * Authentication state machine * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ClientAuthSessionListener { /** * Notifies this AuthSessionEventListener that the ClientAuthSesssion has recived AuthAnswer message. * @param session parent application session (FSM) * @param request authentication request object * @param answer authentication answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doAuthAnswerEvent(ClientAuthSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ClientAuthSesssion has recived ReAuthRequest message. * @param session parent application session (FSM) * @param request re-authentication request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doReAuthRequestEvent(ClientAuthSession session, ReAuthRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ClientAuthSesssion has recived AbortSessionRequest message. * @param session parent application session (FSM) * @param request abort session request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doAbortSessionRequestEvent(ClientAuthSession session, AbortSessionRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ClientAuthSesssion has recived SessionTerminationAnswer message. * @param session parent application session (FSM) * @param answer abort session request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doSessionTerminationAnswerEvent(ClientAuthSession session, SessionTermAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ClientAuthSesssion has recived not authentication message. * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth.events; import org.jdiameter.api.AvpDataException; import org.jdiameter.api.app.AppRequestEvent; /** * A Abort Session Request is a request from a client to a server * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AbortSessionRequest extends AppRequestEvent { public static final String _SHORT_NAME = "ASR"; public static final String _LONG_NAME = "Abort-Session-Request"; public static final int code = 274; /** * Return Auth-Application-Id value of request * @return Auth-Application-Id value of request * @throws org.jdiameter.api.AvpDataException if avp is not integer */ long getAuthApplicationId() throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth.events; import org.jdiameter.api.app.AppAnswerEvent; /** * A Answer message is sent by a recipient of Request once it has received and * interpreted the Request. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface SessionTermAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "STA"; public static final String _LONG_NAME = "Session-Termination-Answer"; public static final int code = 275; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth.events; import org.jdiameter.api.app.AppAnswerEvent; /** * A Answer message is sent by a recipient of Request once it has received and * interpreted the Request. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AbortSessionAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "ASA"; public static final String _LONG_NAME = "Abort-Session-Answer"; public static final int code = 274; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth.events; import org.jdiameter.api.app.AppAnswerEvent; /** * A Answer message is sent by a recipient of Request once it has received and * interpreted the Request. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ReAuthAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "RAA"; public static final String _LONG_NAME = "Re-Auth-Answer"; public static final int code = 258; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth.events; import org.jdiameter.api.AvpDataException; import org.jdiameter.api.app.AppRequestEvent; /** * A ReAuthentication Request is a request from a client to a server * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ReAuthRequest extends AppRequestEvent { public static final String _SHORT_NAME = "RAR"; public static final String _LONG_NAME = "Re-Auth-Request"; public static final int code = 258; /** * Return re-authentication request type * @return re-authentication request type * @throws org.jdiameter.api.AvpDataException if avp is not integer */ int getReAuthRequestType() throws AvpDataException; /** * Return Auth-Application-Id value of request * @return Auth-Application-Id value of request * @throws AvpDataException if avp is not integer */ long getAuthApplicationId() throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth.events; import org.jdiameter.api.AvpDataException; import org.jdiameter.api.app.AppRequestEvent; /** * A Session Termination Request is a request from a client to a server * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface SessionTermRequest extends AppRequestEvent { public static final String _SHORT_NAME = "STR"; public static final String _LONG_NAME = "Session-Termination-Request"; public static final int code = 275; /** * @return Auth-Application-Id value of request * @throws AvpDataException if result code avp is not integer */ long getAuthApplicationId() throws AvpDataException; /** * @return termination cause * @throws AvpDataException if result code avp is not integer */ int getTerminationCause() throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.auth.events.AbortSessionAnswer; import org.jdiameter.api.auth.events.ReAuthAnswer; import org.jdiameter.api.auth.events.ReAuthRequest; import org.jdiameter.api.auth.events.SessionTermRequest; /** * This interface defines the possible actions that the different states in the * Authentication state machine * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ServerAuthSessionListener { /** * Notifies this AuthSessionEventListener that the ServerAuthSesssion has recived AuthRequest message. * @param session parent application session (FSM) * @param request authentication request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doAuthRequestEvent(ServerAuthSession session, AppRequestEvent request) throws InternalException, org.jdiameter.api.IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ServerAuthSesssion has recived ReAuthAnswer message. * @param session parent application session (FSM) * @param request re-authentication request object * @param answer re-authentication answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doReAuthAnswerEvent(ServerAuthSession session, ReAuthRequest request, ReAuthAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ServerAuthSesssion has recived AbortSessionRequest message. * @param session parent application session (FSM) * @param answer abort session event event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doAbortSessionAnswerEvent(ServerAuthSession session, AbortSessionAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ServerAuthSesssion has recived SessionTerminationRequest message. * @param session parent application session (FSM) * @param request session termination request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doSessionTerminationRequestEvent(ServerAuthSession session, SessionTermRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ServerAuthSesssion has recived not authentication message. * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.auth; 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.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.app.StateMachine; import org.jdiameter.api.auth.events.AbortSessionAnswer; import org.jdiameter.api.auth.events.ReAuthAnswer; import org.jdiameter.api.auth.events.SessionTermRequest; /** * Basic class for authentication application specific session * Listener must injection from constructor of implementation class * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ClientAuthSession extends AppSession, StateMachine { /** * Send authentication session request to server * @param request Authentication-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ void sendAuthRequest(AppRequestEvent request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send re-authentication session answer to server * @param answer Re-Authentication-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ void sendReAuthAnswer(ReAuthAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send abort session answer to server * @param answer Abort-Session-Answer event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded */ void sendAbortSessionAnswer(AbortSessionAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Send session termination request to server * @param request Session-Term-Request event instance * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. **/ void sendSessionTerminationRequest(SessionTermRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; /** * This interface append to base interface specific methods for * creating and send diameter requests and responses * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author artem.litvinov@gmail.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface Session extends BaseSession, Wrapper { /** * Set session request listener * @param listener session request listener */ void setRequestListener(NetworkReqListener listener); /** * Returns a new Request object with the specified command code, applicationId, realm * and predefined system avps. * @param commandCode code of message * @param appId applicationId of destination application * @param destRealm name of destination Realm * @return new message object */ Request createRequest(int commandCode, ApplicationId appId, String destRealm); /** * Returns a new Request object with the specified command code, applicationId, realm, host * and predefined system avps. * @param commandCode code of message * @param appId applicationId of destination application * @param destRealm name of destination Realm * @param destHost name of destination Host * @return new Request object */ Request createRequest(int commandCode, ApplicationId appId, String destRealm, String destHost); /** * Returns a new Request object base on previous request.(header is copied) * @param prevRequest previous request (header is copied) * @return new Request object */ Request createRequest(Request prevRequest); /** * Sends and wait response message with default timeout * @param message request/answer diameter message * @param listener event listener * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ void send(Message message, EventListener<Request, Answer> listener) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Sends and wait response message with defined timeout * @param message request/answer diameter message * @param listener event listener * @param timeOut value of timeout * @param timeUnit type of timeOut value * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ void send(Message message, EventListener<Request, Answer> listener, long timeOut, TimeUnit timeUnit) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Sends and wait response message with default timeout * @param message request/answer diameter message * @return InFuture result of an asynchronous operation * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ Future<Message> send(Message message) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Sends and wait response message with defined timeout * @param message request/answer diameter message * @return InFuture result of an asynchronous operation * @param timeOut value of timeout * @param timeUnit type of timeOut value * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ Future<Message> send(Message message, long timeOut, TimeUnit timeUnit) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * This interface is used to inform about changes in the peer table. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface PeerTableListener { /** * This method notified about adding a new peer to peer table * @param peer peer instance */ void peerAccepted(Peer peer); /** * This method notified about removing a peer from peer table * @param peer peer instance */ void peerRemoved(Peer peer); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * The ApplicationAlreadyUse signals that the application a user is reporting * support for is already in use by someone else. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public class ApplicationAlreadyUseException extends Exception { private static final long serialVersionUID = 1L; /** * Constructor with reason string * @param message reason string */ public ApplicationAlreadyUseException(String message) { super(message); } /** * Constructor with reason string and parent exception * @param message message reason string * @param cause parent exception */ public ApplicationAlreadyUseException(String message, Throwable cause) { super(message, cause); } /** * Constructor with parent exception * @param cause parent exception */ public ApplicationAlreadyUseException(Throwable cause) { super(cause); } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; import java.io.Serializable; import java.net.InetAddress; import java.util.Date; /** * A set of data representing a message avp set. AvpSet is simple container of avps allows direct access to Avp by Avp code * or index of Avp. The AvpSet interface provides add/rem methods for appending new Avp and remove Avp from AvpSet. * Wrapper interface allows adapt message to any driver vendor specific interface * Serializable interface allows use this class in SLEE Event objects * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface AvpSet extends Iterable<Avp>, Serializable, Wrapper { /** * get AVP by code * @param avpCode code of Avp * @return Avp instance */ Avp getAvp(int avpCode); /** * get AVP by position * @param index position of Avp * @return Avp instance */ Avp getAvpByIndex(int index); /** * get AVP by code * @param avpCode code of Avp * @param vendorId vendor of Avp * @return Avp instance */ Avp getAvp(int avpCode, long vendorId); /** * get AVP by code * @param avpCode code of Avp * @return array Avp instance */ AvpSet getAvps(int avpCode); /** * get AVP by code * @param avpCode code of Avp * @param vendorId vendor of Avp * @return array Avp instance */ AvpSet getAvps(int avpCode, long vendorId); /** * Remove AVPs with avpCode * @param avpCode code of Avp * @return array of removed Avps instance */ AvpSet removeAvp(int avpCode); /** * Remove AVPs with avpCode * @param avpCode code of Avp * @param vendorId code of Vendor * @return array of removed Avps instance */ AvpSet removeAvp(int avpCode, long vendorId); /** * Remove Avp by Avp index * @param index Avp position * @return Avp instance */ Avp removeAvpByIndex(int index); /** * Return count of top Avps * @return size of top Avps */ int size(); /** * Return array of avp * @return array of avp */ Avp[] asArray(); /** * Append avp array as value * @param value avp array */ void addAvp(Avp... value); /** * Append array of avps * @param value avp array from AvpSet container */ void addAvp(AvpSet value); /** * Append byte[] AVP * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp addAvp(int avpCode, byte[] value); /** * Append byte[] AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, byte[] value, boolean mFlag, boolean pFlag); /** * Append byte[] AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, byte[] value, long vendorId, boolean mFlag, boolean pFlag); /** * Append int AVP * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp addAvp(int avpCode, int value); /** * Append int AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, int value, boolean mFlag, boolean pFlag); /** * Append int AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, int value, long vendorId, boolean mFlag, boolean pFlag); /** * Append long(integer64) AVP * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp addAvp(int avpCode, long value); /** * Append long(integer64) AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, long value, boolean mFlag, boolean pFlag); /** * Append long(integer64) AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, long value, long vendorId, boolean mFlag, boolean pFlag); /** * Append long(integer64) AVP * @param avpCode code of Avp * @param value Avp data * @param asUnsignedInt32 true if value is unsigned integer 32 type * @return Avp instance */ Avp addAvp(int avpCode, long value, boolean asUnsignedInt32); /** * Append long(integer64) AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asUnsignedInt32 true if value is unsigned integer 32 type * @return Avp instance */ Avp addAvp(int avpCode, long value, boolean mFlag, boolean pFlag, boolean asUnsignedInt32); /** * Append long(integer64) AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asUnsignedInt32 true if value is unsigned integer 32 type * @return Avp instance */ Avp addAvp(int avpCode, long value, long vendorId, boolean mFlag, boolean pFlag, boolean asUnsignedInt32); /** * Append float AVP * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp addAvp(int avpCode, float value); /** * Append float AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, float value, boolean mFlag, boolean pFlag); /** * Append float AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, float value, long vendorId, boolean mFlag, boolean pFlag); /** * Append double(float64) AVP * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp addAvp(int avpCode, double value); /** * Append double(float64) AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, double value, boolean mFlag, boolean pFlag); /** * Append double(float64) AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, double value, long vendorId, boolean mFlag, boolean pFlag); /** * Append String(UTF-8 or Octet) AVP * @param avpCode code of Avp * @param value Avp data * @param asOctetString true if it octet string * @return Avp instance */ Avp addAvp(int avpCode, String value, boolean asOctetString); /** * Append String(UTF-8 or Octet) AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asOctetString true if it octet string * @return Avp instance */ Avp addAvp(int avpCode, String value, boolean mFlag, boolean pFlag, boolean asOctetString); /** * Append String(UTF-8 or Octet) AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asOctetString true if it octet string * @return Avp instance */ Avp addAvp(int avpCode, String value, long vendorId, boolean mFlag, boolean pFlag, boolean asOctetString); /** * Append URI AVP * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp addAvp(int avpCode, URI value); /** * Append URI AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, URI value, boolean mFlag, boolean pFlag); /** * Append URI AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, URI value, long vendorId, boolean mFlag, boolean pFlag); /** * Append Address AVP * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp addAvp(int avpCode, InetAddress value); /** * Append Address AVP * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, InetAddress value, boolean mFlag, boolean pFlag); /** * Append Address AVP * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, InetAddress value, long vendorId, boolean mFlag, boolean pFlag); /** * Append Diameter Time AVP * @param avpCode code of Avp * @param date value * @return Avp instance */ Avp addAvp(int avpCode, Date date); /** * Append Diameter Time AVP * @param avpCode code of Avp * @param date value * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, Date date, boolean mFlag, boolean pFlag); /** * Append Diameter Time AVP * @param avpCode code of Avp * @param date value * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp addAvp(int avpCode, Date date, long vendorId, boolean mFlag, boolean pFlag); /** * Append Grouped AVP * @param avpCode code of Avp * @return AvpSet instance */ AvpSet addGroupedAvp(int avpCode); /** * Append Grouped AVP * @param avpCode code of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return AvpSet instance */ AvpSet addGroupedAvp(int avpCode, boolean mFlag, boolean pFlag); /** * Append Grouped AVP * @param avpCode code of Avp * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return AvpSet instance */ AvpSet addGroupedAvp(int avpCode, long vendorId, boolean mFlag, boolean pFlag); /** * Insert AvpSet * @param index index of inserted avp * @param value avp array */ void insertAvp(int index, Avp... value); /** * Insert AvpSet * @param index index of inserted avp * @param value avp array from AvpSet container */ void insertAvp(int index, AvpSet value); /** * Insert byte[] AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp insertAvp(int index, int avpCode, byte[] value); /** * Insert byte[] AVP * @param avpCode code of Avp * @param index index of inserted avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, byte[] value, boolean mFlag, boolean pFlag); /** * Insert byte[] AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, byte[] value, long vendorId, boolean mFlag, boolean pFlag); /** * Insert int AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp insertAvp(int index,int avpCode, int value); /** * Insertint AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, int value, boolean mFlag, boolean pFlag); /** * Insert int AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, int value, long vendorId, boolean mFlag, boolean pFlag); /** * Insert long(integer64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp insertAvp(int index, int avpCode, long value); /** * Insert long(integer64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, long value, boolean mFlag, boolean pFlag); /** * Insert long(integer64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, long value, long vendorId, boolean mFlag, boolean pFlag); /** * Insert long(integer64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param asUnsignedInt32 true if value is unisignet integer 32 type * @return Avp instance */ Avp insertAvp(int index, int avpCode, long value, boolean asUnsignedInt32); /** * Insert long(integer64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asUnsignedInt32 true if value is unisignet integer 32 type * @return Avp instance */ Avp insertAvp(int index, int avpCode, long value, boolean mFlag, boolean pFlag, boolean asUnsignedInt32); /** * Insert long(integer64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asUnsignedInt32 true if value is unisignet integer 32 type * @return Avp instance */ Avp insertAvp(int index, int avpCode, long value, long vendorId, boolean mFlag, boolean pFlag, boolean asUnsignedInt32); /** * Insert float AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp insertAvp(int index, int avpCode, float value); /** * Insert float AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, float value, boolean mFlag, boolean pFlag); /** * Insert float AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, float value, long vendorId, boolean mFlag, boolean pFlag); /** * Insert double(float64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp insertAvp(int index, int avpCode, double value); /** * Insert double(float64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, double value, boolean mFlag, boolean pFlag); /** * Insert double(float64) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, double value, long vendorId, boolean mFlag, boolean pFlag); /** * Insert String(UTF-8 or Octet) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param asOctetString true if it octet string * @return Avp instance */ Avp insertAvp(int index, int avpCode, String value, boolean asOctetString); /** * Insert String(UTF-8 or Octet) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asOctetString true if it octet string * @return Avp instance */ Avp insertAvp(int index, int avpCode, String value, boolean mFlag, boolean pFlag, boolean asOctetString); /** * Insert String(UTF-8 or Octet) AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @param asOctetString true if it octet string * @return Avp instance */ Avp insertAvp(int index, int avpCode, String value, long vendorId, boolean mFlag, boolean pFlag, boolean asOctetString); /** * Insert URI AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp insertAvp(int index, int avpCode, URI value); /** * Insert URI AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, URI value, boolean mFlag, boolean pFlag); /** * Insert URI AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, URI value, long vendorId, boolean mFlag, boolean pFlag); /** * Insert Address AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @return Avp instance */ Avp insertAvp(int index, int avpCode, InetAddress value); /** * Insert Address AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, InetAddress value, boolean mFlag, boolean pFlag); /** * Insert Address AVP * @param index index of inserted avp * @param avpCode code of Avp * @param value Avp data * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, InetAddress value, long vendorId, boolean mFlag, boolean pFlag); /** * Insert Diameter Time AVP * @param index index of inserted avp * @param avpCode code of Avp * @param date value * @return Avp instance */ Avp insertAvp(int index, int avpCode, Date date); /** * Insert Diameter Time AVP * @param index index of inserted avp * @param avpCode code of Avp * @param date value * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, Date date, boolean mFlag, boolean pFlag); /** * Insert Diameter Time AVP * @param index index of inserted avp * @param avpCode code of Avp * @param date value * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return Avp instance */ Avp insertAvp(int index, int avpCode, Date date, long vendorId, boolean mFlag, boolean pFlag); /** * Insert Grouped AVP * @param index index of inserted avp * @param avpCode code of Avp * @return AvpSet instance */ AvpSet insertGroupedAvp(int index, int avpCode); /** * Insert Grouped AVP * @param index index of inserted avp * @param avpCode code of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return AvpSet instance */ AvpSet insertGroupedAvp(int index, int avpCode, boolean mFlag, boolean pFlag); /** * Insert Grouped AVP * @param index index of inserted avp * @param avpCode code of Avp * @param vendorId vendor of Avp * @param mFlag true set M flag/false clear M flag in header Avp * @param pFlag true set P flag/false clear P flag in header Avp * @return AvpSet instance */ AvpSet insertGroupedAvp(int index, int avpCode, long vendorId, boolean mFlag, boolean pFlag); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * An Answer message is sent by a recipient of Request once it has received and interpreted the Request. * Answers contain a Result-Code AVP and other AVPs in message body. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface Answer extends Message { /** * @return ResultCode Avp from message */ public Avp getResultCode(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.acc; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.app.StateMachine; import org.jdiameter.api.acc.events.AccountAnswer; import org.jdiameter.api.OverloadException; import org.jdiameter.api.InternalException; import org.jdiameter.api.RouteException; /** * Basic class for server accounting application specific session. * Listener must injection from constructor of implementation class. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ServerAccSession extends AppSession, StateMachine { /** * Send Account Answer to Client * @param answer request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendAccountAnswer(AccountAnswer answer) throws InternalException, IllegalStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.acc; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.acc.events.AccountRequest; /** * This interface defines the possible actions that the different states in the * Accounting state machine * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ServerAccSessionListener { /** * Notifies this AccSessionEventListener that the ServerAccSesssion has recived AccRequest message. * @param appSession parent application session (FSM) * @param request accounting request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doAccRequestEvent(ServerAccSession appSession, AccountRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AuthSessionEventListener that the ServerAuthSesssion has recived not authentication message. * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.acc.events; import org.jdiameter.api.AvpDataException; import org.jdiameter.api.app.AppAnswerEvent; /** * An Answer message is sent by a recipient of Request once it has received and * interpreted the Request. * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AccountAnswer extends AppAnswerEvent { public static final String _SHORT_NAME = "ACA"; public static final String _LONG_NAME = "Accounting-Answer"; public static final int code = 271; /** * @return Record type of answer * @throws org.jdiameter.api.AvpDataException if result code avp is not integer */ int getAccountingRecordType() throws AvpDataException; /** * @return record number * @throws AvpDataException if result code avp is not integer */ long getAccountingRecordNumber() throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.acc.events; import org.jdiameter.api.AvpDataException; import org.jdiameter.api.app.AppRequestEvent; /** * An Account Request is a request from a client to a server * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface AccountRequest extends AppRequestEvent { public static final String _SHORT_NAME = "ACR"; public static final String _LONG_NAME = "Accounting-Request"; public static final int code = 271; /** * @return Record type of request * @throws AvpDataException if result code avp is not integer */ int getAccountingRecordType() throws AvpDataException; /** * @return record number * @throws AvpDataException if result code avp is not integer */ long getAccountingRecordNumber() throws AvpDataException; /** * * @param recordType * @throws AvpDataException */ void setAccountingRecordType(int recordType) throws AvpDataException; /** * * @param number * @throws AvpDataException */ void setAccountingRecordNumber(long number) throws AvpDataException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.acc; import org.jdiameter.api.IllegalDiameterStateException; import org.jdiameter.api.InternalException; import org.jdiameter.api.OverloadException; import org.jdiameter.api.RouteException; import org.jdiameter.api.acc.events.AccountAnswer; import org.jdiameter.api.acc.events.AccountRequest; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppAnswerEvent; /** * This interface defines the possible actions that the different states in the * Accounting state machine * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ClientAccSessionListener { /** * Notifies this AccSessionEventListener that the ClientAccSesssion has recived AccAnswer message. * @param appSession parent application session (FSM) * @param request accounting request object * @param answer accounting answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doAccAnswerEvent(ClientAccSession appSession, AccountRequest request, AccountAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this AccSessionEventListener that the ClientAccSesssion has recived not account message. * @param appSession parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doOtherEvent(AppSession appSession, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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.acc; import org.jdiameter.api.InternalException; import org.jdiameter.api.OverloadException; import org.jdiameter.api.RouteException; import org.jdiameter.api.acc.events.AccountRequest; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.app.StateMachine; /** * Basic class for accounting application specific session * Listener must injection from constructor of implementation class * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface ClientAccSession extends AppSession, StateMachine { /** * Send Account Request to Server * @param request request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void sendAccountRequest(AccountRequest request) throws InternalException, IllegalStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * An exception that provides information on a stack has application request overload. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public class OverloadException extends Exception { private static final long serialVersionUID = 1L; double lowThreshold, highThreshold, value; /** * Default constructor */ public OverloadException() { super(); } /** * Constructor with overload data * @param lowThreshold low threshold overload value * @param highThreshold high threshold overload value * @param value current overload value */ public OverloadException(double lowThreshold, double highThreshold, double value) { this.lowThreshold = lowThreshold; this.highThreshold = highThreshold; this.value = value; } /** * Constructor with reason string * @param message reason string */ public OverloadException(String message) { super(message); } /** * Constructor with reason string and parent exception * @param message message reason string * @param cause parent exception */ public OverloadException(String message, Throwable cause) { super(message, cause); } /** * Constructor with parent exception * @param cause parent exception */ public OverloadException(Throwable cause) { super(cause); } /** * @return current low threshold overload value */ public double getLowThreshold() { return lowThreshold; } /** * @return current high threshold overload value */ public double getHighThreshold() { return highThreshold; } /** * @return current overload value */ public double getValue() { return value; } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; import java.io.PrintWriter; import static java.security.AccessController.doPrivileged; import java.security.PrivilegedAction; import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; /** * <P>The basic service for managing a set of Diameter stacks.<br> * * <P>As part of its initialization, the <code>DriverManager</code> class will * attempt to load the stacks classes referenced in the "diameter.drivers" * system property. This allows a user to customize the Diameter Drivers * used by their applications. For example in your * ~/.hotjava/properties file you might specify: * <pre> * <CODE>diameter.drivers=foo.bah.Stack:wombat.diameter.Stack</CODE> * </pre> * * A program can also explicitly load Diameter stacks at any time. For * example, the my.diameter.Stack is loaded with the following statement: * <pre> * <CODE>Class.forName("my.diameter.Stack");</CODE> * </pre> * * <P>When the method <code>getSession</code> is called, * the <code>StackManager</code> will attempt to * locate a suitable stack from amongst those loaded at * initialization and those loaded explicitly using the same classloader * as the current applet or application. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public final class StackManager { private static final Object logSync = new Object(); private static List<StackInfo> stacks = new CopyOnWriteArrayList<StackInfo>(); private static PrintWriter logWriter = null; private static boolean initialized = false; static void initialize() { if (initialized) return; initialized = true; loadInitialStacks(); println("Diameter StackManager initialized"); } private StackManager() { } /** * Retrieves the log writer. * * The <code>getLogWriter</code> and <code>setLogWriter</code> * methods should be used instead * of the <code>get/setlogStream</code> methods, which are deprecated. * @return a <code>java.io.PrintWriter</code> object * @see #setLogWriter */ public static PrintWriter getLogWriter() { synchronized (logSync) { return logWriter; } } /** * Sets the logging/tracing <code>PrintWriter</code> object * that is used by the <code>StackManager</code> and all drivers. * <P> * There is a minor versioning problem created by the introduction * of the method <code>setLogWriter</code>. The * method <code>setLogWriter</code> cannot create a <code>PrintStream</code> object * that will be returned by <code>getLogStream</code> * * @param out the new logging/tracing <code>PrintStream</code> object; * <code>null</code> to disable logging and tracing * @throws SecurityException * if a security manager exists and its * <code>checkPermission</code> method denies * setting the log writer */ public static void setLogWriter(java.io.PrintWriter out) { synchronized (logSync) { logWriter = out; } } /** * Attempts to locate a stack. * The <code>StackManager</code> attempts to select an appropriate stack from * the set of registered Diameter stacks. * @param className class name of stack * @return stack instance * @exception InternalException if a manager has internal error */ public static synchronized Stack getStack(String className) throws InternalException { println(new StringBuilder().append("StackManager.getStack(\"").append(className).append("\")").toString()); if (!initialized) { initialize(); } // Gets the classloader of the code that called this method, may be null. ClassLoader callerCL = ClassLoader.getSystemClassLoader(); // Walk through the loaded stacks attempting to locate someone who understands the given URL. for (StackInfo di : stacks) { // If the caller does not have permission to load the stack then skip it. if (getCallerClass(callerCL, di.stackClassName) != di.stackClass) { println(new StringBuilder().append(" skipping: ").append(di).toString()); continue; } println(new StringBuilder().append(" trying ").append(di).toString()); if (di.stackClassName.equals(className)) { // Success! println("geStack returning " + di); return (di.stack); } } println("getStack: no suitable stack"); throw new InternalException("No suitable stack"); } /** * Registers the given stack with the <code>ScoketManager</code>. * A newly-loaded stack class should call * the method <code>registerStack</code> to make itself * known to the <code>StackManager</code>. * * @param stack the new Diameter Stack that is to be registered with the * <code>StackManager</code> * @exception InternalException if a manager has internal error */ public static synchronized void registerStack(Stack stack) throws InternalException { if (!initialized) { initialize(); } StackInfo stackInfo = new StackInfo(); stackInfo.stack = stack; stackInfo.stackClass = stack.getClass(); stackInfo.stackClassName = stackInfo.stackClass.getName(); stacks.add(stackInfo); println(new StringBuilder().append("registerStack: ").append(stackInfo).toString()); } /** * Drops a driver from the <code>DiameterManager</code>'s list. Applets can only * deregister stacks from their own classloaders. * * @param stack the Diameter stack to drop * @exception InternalException if a manager has internal error */ public static synchronized void deregisterStack(Stack stack) throws InternalException { // Gets the classloader of the code that called this method, may be null. ClassLoader callerCL = ClassLoader.getSystemClassLoader(); println(new StringBuilder().append("StackManager.deregisterStack: ").append(stack).toString()); // Walk through the loaded stacks. int i; StackInfo stackInfo = null; for (i = 0; i < stacks.size(); i++) { stackInfo = stacks.get(i); if (stackInfo.stack == stack) break; } // If we can't find the stack just return. if (i >= stacks.size()) { println(" couldn't find stack to unload"); return; } // If the caller does not have permission to load the stack then throw a security exception. if (stackInfo == null || getCallerClass(callerCL, stackInfo.stackClassName) != stackInfo.stackClass) { throw new SecurityException(); } // Remove the stack. Other entries in stacks get shuffled down. stacks.remove(i); } /** * Retrieves an Enumeration with all of the currently loaded Diameter stacks * to which the current caller has access. * * <P><B>Note:</B> The classname of a stack can be found using * <CODE>d.getClass().getName()</CODE> * * @return the list of Diameter stacks loaded by the caller's class loader */ public static synchronized Enumeration<Stack> getStacks() { List<Stack> result = new CopyOnWriteArrayList<Stack>(); if (!initialized) { initialize(); } // Gets the classloader of the code that called this method, may be null. ClassLoader callerCL = ClassLoader.getSystemClassLoader(); // Walk through the loaded stacks. for (StackInfo di : stacks) { // If the caller does not have permission to load the stack then skip it. if (getCallerClass(callerCL, di.stackClassName) != di.stackClass) { println(new StringBuilder().append(" skipping: ").append(di).toString()); continue; } result.add(di.stack); } return Collections.enumeration(result); } public static void println(String message) { synchronized (logSync) { if (logWriter != null) { logWriter.println(message); // automatic flushing is never enabled, so we must do it ourselves logWriter.flush(); } } } private static Class getCallerClass(ClassLoader callerClassLoader, String stackClassName) { Class callerC; try { callerC = Class.forName(stackClassName, true, callerClassLoader); } catch (Exception ex) { callerC = null; } return callerC; } private static void loadInitialStacks() { String stacks; try { stacks = doPrivileged( new GetPropertyAction("diameter.stacks") ); } catch (Exception ex) { stacks = null; } println(new StringBuilder().append("StackManager.initialize: diameter.stacks = ").append(stacks).toString()); if (stacks == null) return; while (stacks.length() != 0) { int x = stacks.indexOf(':'); String stack; if (x < 0) { stack = stacks; stacks = ""; } else { stack = stacks.substring(0, x); stacks = stacks.substring(x + 1); } if (stack.length() == 0) continue; try { println(new StringBuilder().append("StackManager.Initialize: loading ").append(stack).toString()); Class.forName(stack, true, ClassLoader.getSystemClassLoader()); } catch (Exception ex) { println(new StringBuilder().append("StackManager.Initialize: load failed: ").append(ex).toString()); } } } } class GetPropertyAction implements PrivilegedAction<String> { private String theProp; private String defaultVal; public GetPropertyAction(String s) { theProp = s; } public GetPropertyAction(String s, String s1) { theProp = s; defaultVal = s1; } public String run() { String s = System.getProperty(theProp); return s != null ? s : defaultVal; } } class StackInfo { Stack stack; Class stackClass; String stackClassName; public String toString() { return (new StringBuilder().append("stack[className=").append(stackClassName).append(","). append(stack).append("]").toString()); } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gq; import org.jdiameter.api.auth.ServerAuthSession; /** * Basic class for Server Gq application specific session * Listener must be injected from constructor of implementation class * * @author <a href="mailto:webdev@web-ukraine.info"> Yulian Oifa </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface GqServerSession extends ServerAuthSession { }
Java
/* * JBoss, Home of Professional Open Source * Copyright 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.gq; import org.jdiameter.api.auth.ClientAuthSession; /** * Basic class for Client Gq application specific session * Listener must be injected from constructor of implementation class * * @author <a href="mailto:webdev@web-ukraine.info"> Yulian Oifa </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface GqClientSession extends ClientAuthSession { }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * Base Realm interface. * * @author erick.svenson@yahoo.com * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface Realm { /** * Return name of this realm * * @return name */ public String getName(); /** * Return applicationId associated with this realm * * @return applicationId */ public ApplicationId getApplicationId(); /** * Return realm local action for this realm * * @return realm local action */ public LocalAction getLocalAction(); /** * Return true if this realm is dynamic updated * * @return true if this realm is dynamic updated */ public boolean isDynamic(); /** * Return expiration time for this realm in milisec * * @return expiration time */ public long getExpirationTime(); /** * Returns true if realm is local. Local means that it is defined as local(not action) realm for this peer. * @return */ public boolean isLocal(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * Interface for JDiameter classes which provide the ability to retrieve the * delegate instance when the instance in question is in fact a proxy class. * The wrapper pattern is employed by many JDiameter stack implementations to * provide extensions beyond the traditional JDiameter API that are specific to a * data source. Developers may wish to gain access to these resources that are wrapped ( * the delegates) as proxy class instances representing the the actual resources. * This interface describes a standard mechanism to access these wrapped resources * represented by their proxy, to permit direct access to the resource delegates. * * @author erick.svenson@yahoo.com * @author artem.litvinov@gmail.com * @version 1.5.1 Final */ public interface Wrapper { /** * Returns true if this either implements the interface argument or is directly or indirectly a wrapper for * an object that does. Returns false otherwise. If this implements the interface then return true, else if t * his is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If * this does not implement the interface and is not a wrapper, return false. This method should be implemented * as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap * calls that may fail. If this method returns true then calling unwrap with the same argument should succeed. * @param iface A Class defining an interface that the result must implement. * @return true if this implements the interface or directly or indirectly wraps an object that does. * @throws InternalException If no object found that implements the interface */ boolean isWrapperFor(java.lang.Class<?> iface) throws InternalException; /** * Returns an object that implements the * given interface to allow access to non-standard methods, or standard methods * not exposed by the proxy. The result may be either the object found to implement * the interface or a proxy for that object. If the receiver implements the interface * then that is the object. If the receiver is a wrapper and the wrapped object implements * the interface then that is the object. Otherwise the object is the result of calling unwrap * recursively on the wrapped object. If the receiver is not a wrapper and does not implement the * interface, then an SQLException is thrown. * * @param iface A Class defining an interface that the result must implement. * @return an object that implements the interface. May be a proxy for the actual implementing object. * @throws InternalException If no object found that implements the interface */ <T> T unwrap(java.lang.Class<T> iface) throws InternalException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * The AvpDataException signals invalid operations on Avp data. * * @author erick.svenson@yahoo.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public class AvpDataException extends Exception { private static final long serialVersionUID = -5898449417016355792L; protected Avp avp; /** * Default constructor */ public AvpDataException(Avp avp) { super(); this.avp = avp; } /** * Constructor with reason string * @param message reason string */ public AvpDataException(String message, Avp avp) { super(message); this.avp = avp; } /** * Constructor with reason string and parent exception * @param message message reason string * @param cause parent exception */ public AvpDataException(String message, Throwable cause, Avp avp) { super(message, cause); this.avp = avp; } /** * Constructor with parent exception * @param cause parent exception */ public AvpDataException(Throwable cause, Avp avp) { super(cause); this.avp = avp; } /** * Default constructor */ public AvpDataException() { super(); } /** * Constructor with reason string * @param message reason string */ public AvpDataException(String message) { super(message); } /** * Constructor with reason string and parent exception * @param message message reason string * @param cause parent exception */ public AvpDataException(String message, Throwable cause) { super(message, cause); } /** * Constructor with parent exception * @param cause parent exception */ public AvpDataException(Throwable cause) { super(cause); } public Avp getAvp() { return avp; } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; import java.io.IOException; import java.net.InetAddress; import java.util.Set; /** * Peer contains everything that is worth knowing about a peer and * define some operation for working with this peer. * * @author erick.svenson@yahoo.com * @author artem.litvinov@gmail.com * @version 1.5.1 Final */ public interface Peer { /** * Establishes a connection towards a remote peer. * @throws IllegalDiameterStateException */ void connect() throws InternalException, IOException, IllegalDiameterStateException; /** * Close the connection to the peer. * @throws IllegalDiameterStateException */ void disconnect(int disconnectCause) throws InternalException, IllegalDiameterStateException; /** * All implementations must support PeerState interface as argument * @return state of peer */ <E> E getState(Class<E> enumc); /** * @return URI of peer */ URI getUri(); /** * @return array of peer ip addresses */ InetAddress[] getIPAddresses(); /** * @return Realm name of peer */ String getRealmName(); /** * @return vendor id of peer stack implementation */ long getVendorId(); /** * @return product name of peer stack implementation */ String getProductName(); /** * @return firmware version of peer stack implementation */ long getFirmware(); /** * @return set of common Application-id of peer; */ Set<ApplicationId> getCommonApplications(); /** * Append peer state change listener to the peer manager * @param listener listener instance */ void addPeerStateListener(PeerStateListener listener); /** * Remove peer state change listener from the peer manager * @param listener listener instance */ void removePeerStateListener(PeerStateListener listener); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * This class allows processed stack overloaded notification * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface OverloadListener { /** * Notifies this OverloadListener that the stack has overload. * @param peer listening peer * @param value value of overload */ void overloadDetected(URI peer, double value); /** * Notifies this OverloadListener that the stack has overload cased * @param peer listening peer */ void overloadCeased(URI peer); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * This interface extends PeerTable interface and * append some operation for controls peer and realm table * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public interface MutablePeerTable extends PeerTable { /** * Return peer statistics * @param peerHost host of peer * @return peer statistics */ Statistic getStatistic(String peerHost); /** * Append peer table listener * @param listener listener instance */ void setPeerTableListener(PeerTableListener listener); /** * Add new peer to peer table * @param peer URI of peer (host, port and other connection information) * for example: aaa://host.example.com:6666;transport=tcp;protocol=diameter * @param realmName name of realm * @param connecting attempt connect * @return peer instance */ Peer addPeer(URI peer, String realmName, boolean connecting); /** * Remove peer from peer table * @param peerHost host of peer * @return removed peer instance */ Peer removePeer(String peerHost); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; import java.io.Serializable; /** * The application Id is used to point out an application * that is supported or used. It is a combination of Authentication application id, * Accounting application id and Vendor id. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public final class ApplicationId implements Serializable { private static final long serialVersionUID = 1L; /** * Undefined value of id for application identifier */ public static final long UNDEFINED_VALUE = 0x0; /** * Standards-track application IDs are by Designated Expert with Specification Required [IANA] */ public interface Standard { long DIAMETER_COMMON_MESSAGE = 0x0; long NASREQ = 0x1; long MOBILE_IP = 0x2; long DIAMETER_BASE_ACCOUNTING = 0x3; long RELAY = 0xffffffff; } /** * IANA [IANA] has assigned the range 0x00000001 to 0x00ffffff for * standards-track applications; and 0x01000000 - 0xfffffffe for vendor * specific applications, on a first-come, first-served basis. The * following values are allocated. */ public interface Ranges { long STANDARDS_TRACK_APPLICATIONS_MIN = 0x00000001; long STANDARDS_TRACK_APPLICATIONS_MAX = 0x00ffffff; long VENDOR_SPECIFIC_APPLICATIONS_MIN = 0x01000000; long VENDOR_SPECIFIC_APPLICATIONS_MAX = 0xfffffffe; } private long venId = UNDEFINED_VALUE; private long authId = UNDEFINED_VALUE; private long acctId = UNDEFINED_VALUE; /** * Create instance of ApplicationId use Authentication-App-Id * @param authAppId authentication application id * @return instance of class */ public static ApplicationId createByAuthAppId(long authAppId) { return new ApplicationId(UNDEFINED_VALUE, authAppId, UNDEFINED_VALUE); } /** * Create instance of ApplicationId use Accounting-Applicaion-Id * @param acchAppId accounting applicaion Id * @return instance of class */ public static ApplicationId createByAccAppId(long acchAppId) { return new ApplicationId(UNDEFINED_VALUE, UNDEFINED_VALUE, acchAppId); } /** * Create instance of ApplicationId use Authentication-App-Id and Vendor-Id * @param vendorId vendor specific id * @param authAppId authentication application id * @return instance of class */ public static ApplicationId createByAuthAppId(long vendorId, long authAppId) { return new ApplicationId(vendorId, authAppId, UNDEFINED_VALUE); } /** * Create instance of ApplicationId use Accounting-Applicaion-Id and Vendor-Id * @param vendorId vendor specific id * @param acchAppId accounting applicaion Id * @return instance of class */ public static ApplicationId createByAccAppId(long vendorId, long acchAppId) { return new ApplicationId(vendorId, UNDEFINED_VALUE, acchAppId); } /** * Create instance * @param vendorId vendor specific id * @param authAppId authentication application id * @param acctAppId accounting applicaion Id */ private ApplicationId(long vendorId, long authAppId, long acctAppId) { this.authId = authAppId; this.acctId = acctAppId; this.venId = vendorId; } /** * @return Vendor-Isd */ public long getVendorId() { return venId; } /** * @return Authentication-Application-Id */ public long getAuthAppId() { return authId; } /** * @return Accounting-Application-Id */ public long getAcctAppId() { return acctId; } /** * @param obj check object * @return true if check object equals current instance (all appId is equals) */ public boolean equals(Object obj) { if (obj instanceof ApplicationId) { ApplicationId appId = (ApplicationId) obj; return authId == appId.authId && acctId == appId.acctId && venId == appId.venId; } else { return false; } } /** * @return hash code of object */ public int hashCode() { int result; result = (int) (venId ^ (venId >>> 32)); result = 31 * result + (int) (authId ^ (authId >>> 32)); result = 31 * result + (int) (acctId ^ (acctId >>> 32)); return result; } /** * @return String representation of object */ public String toString() { return new StringBuffer("AppId ["). append("Vendor-Id:").append(venId). append("; Auth-Application-Id:").append(authId). append("; Acct-Application-Id:").append(acctId). append("]"). toString(); } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * An exception that provides information on a stack error or other errors. * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public class InternalException extends Exception { private static final long serialVersionUID = 1L; /** * Default constructor */ public InternalException() { super(); } /** * Constructor with reason string * @param message reason string */ public InternalException(String message) { super(message); } /** * Constructor with reason string and parent exception * @param message message reason string * @param cause parent exception */ public InternalException(String message, Throwable cause) { super(message, cause); } /** * Constructor with parent exception * @param cause parent exception */ public InternalException(Throwable cause) { super(cause); } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * * @author erick.svenson@yahoo.com */ public interface Selector<T, A> { /** * Return true if rule is true * @param object check object * @return true if rule is true */ boolean checkRule(T object); /** * Return metainformation object * @return metainformation object */ A getMetaData(); }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.validation; import java.util.List; import org.jdiameter.api.Avp; import org.jdiameter.api.AvpSet; /** * Represents avp, it stores info about presence, multiplicity, avp * code, vendor. * * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @since 1.5.4.0-build404 */ public interface AvpRepresentation{ /** * <pre> * Represents multiplicity of AVP: * 0 The AVP MUST NOT be present in the message. * </pre> */ public final static String _MP_NOT_ALLOWED = "0"; /** * <pre> * Represents multiplicity of AVP: * 0+ Zero or more instances of the AVP MAY be present in the message. * </pre> */ public final static String _MP_ZERO_OR_MORE = "0+"; /** * <pre> * Represents multiplicity of AVP: * 0-1 Zero or one instance of the AVP MAY be present in the message. * It is considered an error if there are more than one instance of the AVP. * </pre> */ public final static String _MP_ZERO_OR_ONE = "0-1"; /** * <pre> * Represents multiplicity of AVP: * 1 One instance of the AVP MUST be present in the message. * message. * </pre> */ public final static String _MP_ONE = "1"; /** * <pre> * Represents multiplicity of AVP: * 1+ At least one instance of the AVP MUST be present in the * message. * </pre> */ public final static String _MP_ONE_AND_MORE = "1+"; public final static String _DEFAULT_MANDATORY = "may"; public final static String _DEFAULT_PROTECTED = "may"; public final static String _DEFAULT_VENDOR = "mustnot"; public final static int _FIX_POSITION_INDEX = -1; public enum Rule { must, may, mustnot, shouldnot }; public enum Type { OctetString, Integer32, Integer64, Unsigned32, Unsigned64, Float32, Float64, Grouped, Address, Time, UTF8String, DiameterIdentity, DiameterURI, Enumerated, IPFilterRule, QoSFilterRule }; public boolean isPositionFixed(); //public void markFixPosition(int index); public boolean isCountValidForMultiplicity(int avpCount); public boolean isCountValidForMultiplicity(AvpSet destination,int numberToAdd); public boolean isAllowed(int avpCode,long vendorId); public boolean isAllowed(int avpCode); public int getPositionIndex(); public int getCode(); public long getVendorId(); public boolean isAllowed(); public String getMultiplicityIndicator(); public String getName(); public boolean isGrouped(); //public void setGrouped(boolean grouped); public List<AvpRepresentation> getChildren(); //public void setChildren(List<AvpRepresentation> children); //public void setCode(int code); //public void setVendorId(long vendor); //public void setMultiplicityIndicator(String multiplicityIndicator); //public void setName(String name); public boolean isWeak(); //public void markWeak(boolean isWeak); public String getDescription(); public boolean isMayEncrypt(); public String getRuleMandatory(); public int getRuleMandatoryAsInt(); public String getRuleProtected(); public int getRuleProtectedAsInt(); public String getRuleVendorBit(); public int getRuleVendorBitAsInt(); public String getType(); public boolean isProtected(); public boolean isMandatory(); /** * Validates passed avp. * @param avp - simply avp which should be confronted vs definition */ public void validate(Avp avp) throws AvpNotAllowedException; /** * Validates passed avp. * @param avpSet - AvpSet which represents internal content of this avp */ public void validate(AvpSet avpSet) throws AvpNotAllowedException; public String toString(); public int hashCode(); public boolean equals(Object obj); public Object clone() throws CloneNotSupportedException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.validation; import java.io.InputStream; import org.jdiameter.api.Message; /** * Second generation Dictionary/Validator. This interface is exposed directly. * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> * @version 1.1 */ public interface Dictionary { /** * Fetches Avp representation for given code. If no such AVP is found, * <b>null</b> value is returned. * * @param code * - positive integer, equal to AVP code. * @return AvpRepresentation for given code or <b>null</b> */ public AvpRepresentation getAvp(int code); /** * Fetches Avp representation for given code and vendorId. If no such AVP is * found, <b>null</b> value is returned. * * @param code * - positive integer, equal to AVP code. * @param vendorId * - positive long representing vendor code. * @return AvpRepresentation for given code/vendor pair or <b>null</b> */ public AvpRepresentation getAvp(int code, long vendorId); /** * Fetches Avp representation for given name. If no such AVP is found, * <b>null</b> value is returned. * * @param name * - name of AVP, like Session-Id. * @return AvpRepresentation for given name or <b>null</b> */ public AvpRepresentation getAvp(String avpName); /** * * @param commandCode * - command code of message * @param isRequest * - switches if lookup searches for request or answer * @return message representation for given code and flag value or * <b>null</b> */ public MessageRepresentation getMessage(int commandCode, boolean isRequest); /** * * @param commandCode * - command code of message * @param applicationId * - application id present in message header * @param isRequest * - switches if lookup searches for request or answer * * @return message representation for given code, application and flag value * or <b>null</b> */ public MessageRepresentation getMessage(int commandCode, long applicationId, boolean isRequest); /** * Configures dictionary. It can be called multiple times, each call * reconfigures dictionary. * * @param is */ public void configure(InputStream is); // Validator ---------------------------------------------------------------- /** * Gets whether validator is enabled. * * @return <ul> * <li><b>true</b> if validator is enabled</li> * <li><b>false</b> if validator is disabled</li> * </ul> */ public boolean isEnabled(); /** * Sets whether validator is enabled. * * @param enabled true to enable the validator, false to disable it */ public void setEnabled(boolean enabled); /** * Gets whether validator is configured. * * @return <ul> * <li><b>true</b> if validator has been initialized</li> * <li><b>false</b> if validator has not yet been initialized</li> * </ul> */ public boolean isConfigured(); /** * Gets validator level for OUTGOING messages. * Possible values are defined at {@link ValidatorLevel} * * @return an instance of {@link ValidatorLevel} representing the current level */ public ValidatorLevel getSendLevel(); /** * Gets validator level for OUTGOING messages. * Possible values are defined at {@link ValidatorLevel} * * @param sendLevel an instance of {@link ValidatorLevel} representing the new level */ public void setSendLevel(ValidatorLevel sendLevel); /** * Gets validator level for INCOMING messages. * Possible values are defined at {@link ValidatorLevel} * * @return an instance of {@link ValidatorLevel} representing the current level */ public ValidatorLevel getReceiveLevel(); /** * Sets validator level for INCOMING messages. * Possible values are defined at {@link ValidatorLevel} * * @param receiveLevel an instance of {@link ValidatorLevel} representing the new level */ public void setReceiveLevel(ValidatorLevel receiveLevel); /** * Performs validation according to configured levels * * @param message - message we want to validate * @param incoming - flag indicating if {@link #message} is incoming message or outgoing. * @throws AvpNotAllowedException - in case validation fails. Exception has details(avp code and similar) about failure. */ public void validate(Message message, boolean incoming) throws AvpNotAllowedException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.validation; /** * Represents possible levels for Diameter Validator * * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @since 1.5.4.0-build404 */ public class ValidatorLevel { public static final String _OFF = "OFF"; public static final String _MESSAGE = "MESSAGE"; public static final String _ALL = "ALL"; public static final ValidatorLevel OFF = new ValidatorLevel(_OFF); public static final ValidatorLevel MESSAGE = new ValidatorLevel(_MESSAGE); public static final ValidatorLevel ALL = new ValidatorLevel(_ALL); private String name = null; private ValidatorLevel(String name) { super(); this.name = name; } public static ValidatorLevel fromString(String s) throws IllegalArgumentException { if (s.toUpperCase().equals(_OFF)) return OFF; if (s.toUpperCase().equals(_MESSAGE)) return MESSAGE; if (s.toUpperCase().equals(_ALL)) return ALL; throw new IllegalArgumentException("No level for such value: " + s); } public String toString() { return "ValidatorLevel [name=" + name + "]"; } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.validation; /** * Class to indicate error in AVP add operation. * * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public class AvpNotAllowedException extends RuntimeException { private static final long serialVersionUID = 1L; private int avpCode = -1; private long vendorId = -1L; /** * */ public AvpNotAllowedException(int code, long vendor) { this.avpCode = code; this.vendorId = vendor; } /** * * @param message */ public AvpNotAllowedException(String message, int code, long vendor) { super(message); this.avpCode = code; this.vendorId = vendor; } /** * * @param cause */ public AvpNotAllowedException(Throwable cause, int code, long vendor) { super(cause); this.avpCode = code; this.vendorId = vendor; } /** * * @param message * @param cause */ public AvpNotAllowedException(String message, Throwable cause, int code, long vendor) { super(message, cause); this.avpCode = code; this.vendorId = vendor; } public int getAvpCode() { return avpCode; } public long getVendorId() { return vendorId; } @Override public String toString() { return "AvpNotAllowedExcption [avpCode=" + avpCode + ", vendorId=" + vendorId + ", toString()=" + super.toString() + "]"; } }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.validation; import java.util.Map; import org.jdiameter.api.AvpSet; import org.jdiameter.api.Message; /** * This class represents message/command in validation framework. It contains * basic info about command along with avp list - their multiplicity and * allowance. * * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @since 1.5.4.0-build404 */ public interface MessageRepresentation { public Map<AvpRepresentation, AvpRepresentation> getMessageAvps(); public int getCommandCode(); public long getApplicationId(); public boolean isRequest(); public String getName(); /** * Fetches Avp representation for given code. If no such AVP is found, * <b>null</b> value is returned. AVP must be top level AVP to be fetched by * this operation. * * @param code * - positive integer, equal to AVP code. * @return AvpRepresentation for given code or <b>null</b> */ public AvpRepresentation getAvp(int code); /** * Fetches Avp representation for given code and vendorId. If no such AVP is * found, <b>null</b> value is returned. AVP must be top level AVP to be * fetched by this operation. * * @param code * - positive integer, equal to AVP code. * @param vendorId * - positive long representing vendor code. * @return AvpRepresentation for given code/vendor pair or <b>null</b> */ public AvpRepresentation getAvp(int code, long vendorId); public boolean isCountValidForMultiplicity(int code, int avpCount); public boolean isCountValidForMultiplicity(int code, long vendorId, int avpCount); public boolean isCountValidForMultiplicity(AvpSet destination, int code, long vendorId, int numberToAdd); public boolean isCountValidForMultiplicity(AvpSet destination, int code, int numberToAdd); public boolean isCountValidForMultiplicity(AvpSet destination, int code, long vendorId); public boolean isCountValidForMultiplicity(AvpSet destination, int code); public boolean isAllowed(int avpCode, long vendorId); public boolean isAllowed(int avpCode); public void validate(Message msg, ValidatorLevel validatorLevel) throws AvpNotAllowedException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * This Enum class defines commCode of realm local actions * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public enum LocalAction { LOCAL, RELAY, PROXY, REDIRECT }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; /** * This enumerated class define Peer states. More information you can read on document * "Authentication, Authorization and Accounting (AAA) Transport Profile" * * @author erick.svenson@yahoo.com * @version 1.5.1 Final */ public enum PeerState { OKAY, SUSPECT, DOWN, REOPEN, INITIAL }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2006, 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; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; /** * This interface append to base interface specific methods for * creating and send raw diameter messages * * @version 1.5.1 Final * * @author erick.svenson@yahoo.com * @author artem.litvinov@gmail.com * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> */ public interface RawSession extends BaseSession, Wrapper { /** * Returns a new message object with the specified command code, applicationId * and predefined avps. * @param commandCode code of message * @param applicationId applicationId of destination application * @param avp array of avps * @return new message object */ Message createMessage(int commandCode, ApplicationId applicationId, Avp... avp); /** * Returns a new message object with the predefined Command-code, ApplicationId, HopByHopIdentifier, EndToEndIdentifier * This method allow created message from storage or created specific message. * @param commandCode code of message * @param applicationId applicationId of destination application * @param hopByHopIdentifier hop by hop identifier of message * @param endToEndIdentifier end to end identifier of message * @param avp array of avps * @return new message object */ Message createMessage(int commandCode, ApplicationId applicationId, long hopByHopIdentifier, long endToEndIdentifier, Avp... avp); /** * Returns a new message object with the copy of parent message header * @param message origination message * @param copyAvps if true all avps will be copy to new message * @return Returns a new message object with the copy of parent message header */ Message createMessage(Message message, boolean copyAvps); /** * Sends and wait response message with default timeout * @param message request/answer diameter message * @param listener event listener * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ void send(Message message, EventListener<Message, Message> listener) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Sends and wait response message with defined timeout * @param message request/answer diameter message * @param listener event listener * @param timeOut value of timeout * @param timeUnit type of timeOut value * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ void send(Message message, EventListener<Message, Message> listener, long timeOut, TimeUnit timeUnit) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Sends and wait response message with default timeout * @param message request/answer diameter message * @return InFuture result of an asynchronous operation * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ Future<Message> send(Message message) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Sends and wait response message with defined timeout * @param message request/answer diameter message * @return InFuture result of an asynchronous operation * @param timeOut value of timeout * @param timeUnit type of timeOut value * @throws org.jdiameter.api.InternalException The InternalException signals that internal error is occurred. * @throws org.jdiameter.api.IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws org.jdiameter.api.RouteException The NoRouteException signals that no route exist for a given realm. * @throws org.jdiameter.api.OverloadException The OverloadException signals that destination host is overloaded. */ Future<Message> send(Message message, long timeOut, TimeUnit timeUnit) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.ro; 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.AppAnswerEvent; import org.jdiameter.api.app.AppRequestEvent; import org.jdiameter.api.app.AppSession; import org.jdiameter.api.auth.events.ReAuthAnswer; import org.jdiameter.api.auth.events.ReAuthRequest; import org.jdiameter.api.ro.events.RoCreditControlRequest; /** * This interface defines the possible actions for the different states in the server * Credit-Control Application state machine. * * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface ServerRoSessionListener { /** * Notifies this ServerRoSessionListener that the ServerRoSession has received a CCR message. * * @param session parent application session (FSM) * @param request request object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doCreditControlRequest(ServerRoSession session, RoCreditControlRequest request) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this ServerRoSessionListener that the ServerRoSession has received a RAA message. * * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doReAuthAnswer(ServerRoSession session, ReAuthRequest request, ReAuthAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; /** * Notifies this ServerRoSessionListener that the ServerRoSession has received not Ro message, * now it can be even RAA. * * @param session parent application session (FSM) * @param request request object * @param answer answer object * @throws InternalException The InternalException signals that internal error is occurred. * @throws IllegalDiameterStateException The IllegalStateException signals that session has incorrect state (invalid). * @throws RouteException The NoRouteException signals that no route exist for a given realm. * @throws OverloadException The OverloadException signals that destination host is overloaded. */ void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException; }
Java
/* * JBoss, Home of Professional Open Source * Copyright 2010, 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.ro.events; import org.jdiameter.api.app.AppRequestEvent; /** * The CCR messages, indicated by the Command-Code field set to 272 is sent by the CTF to the OCF * in order to request credits for the request bearer / subsystem / service. * * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a> * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a> */ public interface RoCreditControlRequest extends AppRequestEvent { public static final String _SHORT_NAME = "CCR"; public static final String _LONG_NAME = "Credit-Control-Request"; public static final int code = 272; boolean isRequestedActionAVPPresent(); int getRequestedActionAVPValue(); boolean isRequestTypeAVPPresent(); int getRequestTypeAVPValue(); }
Java