2 new revisions:

Revision: 16533b34e7cd
Author:   Sergey Vetyutnev <[email protected]>
Date:     Tue Jun 12 07:25:18 2012
Log:      cap error messages - api
http://code.google.com/p/jss7/source/detail?r=16533b34e7cd

Revision: 2fc97fc151d4
Author:   Sergey Vetyutnev <[email protected]>
Date:     Tue Jun 12 07:29:40 2012
Log:      Merge branch 'cap2'
http://code.google.com/p/jss7/source/detail?r=2fc97fc151d4

==============================================================================
Revision: 16533b34e7cd
Author:   Sergey Vetyutnev <[email protected]>
Date:     Tue Jun 12 07:25:18 2012
Log:      cap error messages - api
http://code.google.com/p/jss7/source/detail?r=16533b34e7cd

Added:
/cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageCancelFailed.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageRequestedInfoError.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageSystemFailure.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageTaskRefused.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CancelProblem.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/RequestedInfoErrorParameter.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/TaskRefusedParameter.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/UnavailableNetworkResource.java /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageCancelFailedImpl.java
Modified:
/cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorCode.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessage.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageFactory.java /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageParameterless.java /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageFactoryImpl.java /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageImpl.java

=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageCancelFailed.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,49 @@
+/*
+ * 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.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+ *
+
+cancelFailed ERROR ::= {
+ PARAMETER SEQUENCE {
+  problem     [0] ENUMERATED {
+   unknownOperation  (0),
+   tooLate     (1),
+   operationNotCancellable (2)
+   },
+  operation    [1] InvokeID,
+  ...
+  }
+ CODE errcode-cancelFailed
+ }
+
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public interface CAPErrorMessageCancelFailed extends CAPErrorMessage {
+
+       public CancelProblem getCancelProblem();
+
+}
=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageRequestedInfoError.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,45 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+ *
+
+requestedInfoError ERROR ::= {
+ PARAMETER ENUMERATED {
+   unknownRequestedInfo  (1),
+   requestedInfoNotAvailable (2)
+   }
+ CODE errcode-requestedInfoError
+ }
+-- The requested information cannot be found.
+
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public interface CAPErrorMessageRequestedInfoError extends CAPErrorMessage {
+
+       public RequestedInfoErrorParameter getRequestedInfoErrorParameter();
+
+}
=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageSystemFailure.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,42 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+ *
+
+systemFailure ERROR ::= {
+ PARAMETER UnavailableNetworkResource
+ CODE errcode-systemFailure
+ }
+-- The operation could not be completed due to a system failure at the serving physical entity.
+
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public interface CAPErrorMessageSystemFailure extends CAPErrorMessage {
+
+       public UnavailableNetworkResource getUnavailableNetworkResource();
+
+}
=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageTaskRefused.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,48 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+ *
+
+taskRefused ERROR ::= {
+ PARAMETER ENUMERATED {
+   generic      (0),
+   unobtainable    (1),
+   congestion     (2)
+   }
+ CODE errcode-taskRefused
+ }
+-- An entity normally capable of the task requested cannot or chooses not to perform the task at +-- this time. This includes error situations like congestion and unobtainable address as used in
+-- e.g. the connect operation.)
+
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public interface CAPErrorMessageTaskRefused extends CAPErrorMessage {
+
+       TaskRefusedParameter getTaskRefusedParameter();
+
+}
=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CancelProblem.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,67 @@
+/*
+ * 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.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+*
+
+PARAMETER SEQUENCE {
+  problem     [0] ENUMERATED {
+   unknownOperation  (0),
+   tooLate     (1),
+   operationNotCancellable (2)
+   },
+
+*
+* @author sergey vetyutnev
+*
+*/
+public enum CancelProblem {
+       unknownOperation(0),
+       tooLate(1),
+       operationNotCancellable(2);
+
+       private int code;
+
+       private CancelProblem(int code) {
+               this.code = code;
+       }
+
+       public int getCode() {
+               return this.code;
+       }
+
+       public static CancelProblem getInstance(int code) {
+               switch (code) {
+               case 0:
+                       return CancelProblem.unknownOperation;
+               case 1:
+                       return CancelProblem.tooLate;
+               case 2:
+                       return CancelProblem.operationNotCancellable;
+               default:
+                       return null;
+               }
+       }
+}
+
=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/RequestedInfoErrorParameter.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,62 @@
+/*
+ * 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.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+*
+
+PARAMETER ENUMERATED {
+   unknownRequestedInfo  (1),
+   requestedInfoNotAvailable (2)
+   }
+ CODE errcode-requestedInfoError
+*
+* @author sergey vetyutnev
+*
+*/
+public enum RequestedInfoErrorParameter {
+       unknownRequestedInfo(1),
+       requestedInfoNotAvailable(2);
+
+       private int code;
+
+       private RequestedInfoErrorParameter(int code) {
+               this.code = code;
+       }
+
+       public int getCode() {
+               return this.code;
+       }
+
+       public static RequestedInfoErrorParameter getInstance(int code) {
+               switch (code) {
+               case 1:
+                       return RequestedInfoErrorParameter.unknownRequestedInfo;
+               case 2:
+                       return 
RequestedInfoErrorParameter.requestedInfoNotAvailable;
+               default:
+                       return null;
+               }
+       }
+}
+
=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/TaskRefusedParameter.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,66 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+*
+
+PARAMETER ENUMERATED {
+   generic      (0),
+   unobtainable    (1),
+   congestion     (2)
+   }
+
+*
+* @author sergey vetyutnev
+*
+*/
+public enum TaskRefusedParameter {
+       generic(0),
+       unobtainable(1),
+       congestion(2);
+
+       private int code;
+
+       private TaskRefusedParameter(int code) {
+               this.code = code;
+       }
+
+       public int getCode() {
+               return this.code;
+       }
+
+       public static TaskRefusedParameter getInstance(int code) {
+               switch (code) {
+               case 0:
+                       return TaskRefusedParameter.generic;
+               case 1:
+                       return TaskRefusedParameter.unobtainable;
+               case 2:
+                       return TaskRefusedParameter.congestion;
+               default:
+                       return null;
+               }
+       }
+}
+
=======================================
--- /dev/null
+++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/UnavailableNetworkResource.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,75 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.protocols.ss7.cap.api.errors;
+
+/**
+*
+
+UnavailableNetworkResource ::= ENUMERATED {
+ unavailableResources    (0),
+ componentFailure     (1),
+ basicCallProcessingException  (2),
+ resourceStatusFailure    (3),
+ endUserFailure      (4)
+ }
+-- Indicates the network resource that failed.
+
+*
+* @author sergey vetyutnev
+*
+*/
+public enum UnavailableNetworkResource {
+       unavailableResources(0),
+       componentFailure(1),
+       basicCallProcessingException(2),
+       resourceStatusFailure(3),
+       endUserFailure(4);
+
+       private int code;
+
+       private UnavailableNetworkResource(int code) {
+               this.code = code;
+       }
+
+       public int getCode() {
+               return this.code;
+       }
+
+       public static UnavailableNetworkResource getInstance(int code) {
+               switch (code) {
+               case 0:
+                       return UnavailableNetworkResource.unavailableResources;
+               case 1:
+                       return UnavailableNetworkResource.componentFailure;
+               case 2:
+                       return 
UnavailableNetworkResource.basicCallProcessingException;
+               case 3:
+                       return UnavailableNetworkResource.resourceStatusFailure;
+               case 4:
+                       return UnavailableNetworkResource.endUserFailure;
+               default:
+                       return null;
+               }
+       }
+}
+
=======================================
--- /dev/null
+++ /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageCancelFailedImpl.java Tue Jun 12 07:25:18 2012
@@ -0,0 +1,171 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.mobicents.protocols.ss7.cap.errors;
+
+import java.io.IOException;
+import org.mobicents.protocols.asn.AsnException;
+import org.mobicents.protocols.asn.AsnInputStream;
+import org.mobicents.protocols.asn.AsnOutputStream;
+import org.mobicents.protocols.asn.Tag;
+import org.mobicents.protocols.ss7.cap.api.CAPException;
+import org.mobicents.protocols.ss7.cap.api.CAPParsingComponentException;
+import org.mobicents.protocols.ss7.cap.api.CAPParsingComponentExceptionReason;
+import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorCode;
+import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageCancelFailed;
+import org.mobicents.protocols.ss7.cap.api.errors.CancelProblem;
+
+/**
+ *
+ * @author sergey vetyutnev
+ *
+ */
+public class CAPErrorMessageCancelFailedImpl extends CAPErrorMessageImpl implements CAPErrorMessageCancelFailed {
+
+       public static final String _PrimitiveName = 
"CAPErrorMessageCancelFailed";
+
+       private CancelProblem cancelProblem;
+
+       protected CAPErrorMessageCancelFailedImpl(CancelProblem cancelProblem) {
+               super((long) CAPErrorCode.cancelFailed);
+
+               this.cancelProblem = cancelProblem;
+       }
+
+       protected CAPErrorMessageCancelFailedImpl() {
+               super((long) CAPErrorCode.cancelFailed);
+       }
+
+
+       @Override
+       public CancelProblem getCancelProblem() {
+               return cancelProblem;
+       }
+
+       public void setCancelProblem(CancelProblem cancelProblem) {
+               this.cancelProblem = cancelProblem;
+       }
+
+       @Override
+       public int getTag() throws CAPException {
+               return Tag.ENUMERATED;
+       }
+
+       @Override
+       public int getTagClass() {
+               return Tag.CLASS_UNIVERSAL;
+       }
+
+       @Override
+       public boolean getIsPrimitive() {
+               return true;
+       }
+
+       @Override
+ public void decodeAll(AsnInputStream ansIS) throws CAPParsingComponentException {
+
+               try {
+                       int length = ansIS.readLength();
+                       this._decode(ansIS, length);
+               } catch (IOException e) {
+ throw new CAPParsingComponentException("IOException when decoding " + _PrimitiveName + ": " + e.getMessage(), e,
+                                       
CAPParsingComponentExceptionReason.MistypedParameter);
+               } catch (AsnException e) {
+ throw new CAPParsingComponentException("AsnException when decoding " + _PrimitiveName + ": " + e.getMessage(), e,
+                                       
CAPParsingComponentExceptionReason.MistypedParameter);
+               }
+       }
+
+       @Override
+ public void decodeData(AsnInputStream ansIS, int length) throws CAPParsingComponentException {
+
+               try {
+                       this._decode(ansIS, length);
+               } catch (IOException e) {
+ throw new CAPParsingComponentException("IOException when decoding " + _PrimitiveName + ": " + e.getMessage(), e,
+                                       
CAPParsingComponentExceptionReason.MistypedParameter);
+               } catch (AsnException e) {
+ throw new CAPParsingComponentException("AsnException when decoding " + _PrimitiveName + ": " + e.getMessage(), e,
+                                       
CAPParsingComponentExceptionReason.MistypedParameter);
+               }
+       }
+
+ private void _decode(AsnInputStream localAis, int length) throws CAPParsingComponentException, IOException, AsnException {
+
+               this.cancelProblem = null;
+
+ if (localAis.getTagClass() != Tag.CLASS_UNIVERSAL || localAis.getTag() != Tag.ENUMERATED || !localAis.isTagPrimitive())
+                       throw new CAPParsingComponentException(
+ "Error decoding " + _PrimitiveName + ": bad tag class or tag or parameter is not primitive",
+                                       
CAPParsingComponentExceptionReason.MistypedParameter);
+
+               int i1 = (int) localAis.readIntegerData(length);
+               this.cancelProblem = CancelProblem.getInstance(i1);
+       }
+
+       @Override
+       public void encodeAll(AsnOutputStream asnOs) throws CAPException {
+               this.encodeAll(asnOs, this.getTagClass(), this.getTag());
+       }
+
+ public void encodeAll(AsnOutputStream asnOs, int tagClass, int tag) throws CAPException {
+
+               try {
+                       asnOs.writeTag(tagClass, false, tag);
+                       int pos = asnOs.StartContentDefiniteLength();
+                       this.encodeData(asnOs);
+                       asnOs.FinalizeContent(pos);
+               } catch (AsnException e) {
+ throw new CAPException("AsnException when encoding " + _PrimitiveName + ": " + e.getMessage(), e);
+               }
+       }
+
+       public void encodeData(AsnOutputStream aos) throws CAPException {
+
+               if (this.cancelProblem == null)
+                       return;
+
+               try {
+                       aos.writeIntegerData(this.cancelProblem.getCode());
+
+               } catch (IOException e) {
+ throw new CAPException("IOException when encoding " + _PrimitiveName + ": " + e.getMessage(), e);
+               }
+       }
+
+       @Override
+       public String toString() {
+               StringBuilder sb = new StringBuilder();
+
+               sb.append(_PrimitiveName);
+               sb.append(" [");
+               if (this.cancelProblem != null) {
+                       sb.append("cancelProblem=");
+                       sb.append(cancelProblem);
+                       sb.append(",");
+               }
+               sb.append("]");
+
+               return sb.toString();
+       }
+}
+
=======================================
--- /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorCode.java Mon Apr 23 10:53:14 2012 +++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorCode.java Tue Jun 12 07:25:18 2012
@@ -34,21 +34,41 @@
        public static final int minimalCodeValue = 0;
        public static final int maximumCodeValue = 51;

+       // -- The operation has been canceled.
        public static final int canceled = 0;
+       // -- The operation failed to be canceled.
        public static final int cancelFailed = 1;
+       // -- The establish temporary connection failed.
        public static final int eTCFailed = 3;
+       // -- The caller response was not as expected.
        public static final int improperCallerResponse = 4;
+       // -- The Service Logic Program could not be found in the gsmSCF.
        public static final int missingCustomerRecord = 6;
+       // -- An expected optional parameter was not received.
        public static final int missingParameter = 7;
+       // -- The parameter was not as expected (e.g. missing or out of range).
        public static final int parameterOutOfRange = 8;
+       // -- The requested information cannot be found.
        public static final int requestedInfoError = 10;
+ // -- The operation could not be completed due to a system failure at the serving physical entity.
        public static final int systemFailure = 11;
+ // -- An entity normally capable of the task requested cannot or chooses not to perform the task at + // -- this time. This includes error situations like congestion and unobtainable address as used in
+       // -- e.g. the connect operation.)
        public static final int taskRefused = 12;
+       // -- A requested resource is not available at the serving entity.
        public static final int unavailableResource = 13;
+ // -- An incorrect sequence of Components was received (e.g. 'DisconnectForwardConnection'
+       // -- followed by 'PlayAnnouncement').
        public static final int unexpectedComponentSequence = 14;
+ // -- The data value was not as expected (e.g. route number expected but billing number received)
        public static final int unexpectedDataValue = 15;
+       // -- A parameter received was not expected.
        public static final int unexpectedParameter = 16;
+       // -- Leg not known to the gsmSSF.
        public static final int unknownLegID = 17;
+       // -- PDPID not known by the receiving entity.
        public static final int unknownPDPID = 50;
+       // -- Call Segment not known to the gsmSSF.
        public static final int unknownCSID = 51;
 }
=======================================
--- /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessage.java Mon Apr 23 10:53:14 2012 +++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessage.java Tue Jun 12 07:25:18 2012
@@ -35,11 +35,23 @@

        public boolean isEmParameterless();

-//     public boolean isEmFacilityNotSup();
+       public boolean isEmCancelFailed();
+
+       public boolean isEmRequestedInfoError();
+
+       public boolean isEmSystemFailure();
+
+       public boolean isEmTaskRefused();


        public CAPErrorMessageParameterless getEmParameterless();
-
-//     public MAPErrorMessageFacilityNotSup getEmFacilityNotSup();
+
+       public CAPErrorMessageCancelFailed getEmCancelFailed();
+
+       public CAPErrorMessageRequestedInfoError getEmRequestedInfoError();
+
+       public CAPErrorMessageSystemFailure getEmSystemFailure();
+
+       public CAPErrorMessageTaskRefused getEmTaskRefused();

 }
=======================================
--- /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageFactory.java Mon Apr 23 10:53:14 2012 +++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageFactory.java Tue Jun 12 07:25:18 2012
@@ -41,7 +41,12 @@

public CAPErrorMessageParameterless createCAPErrorMessageParameterless(Long errorCode);

-// public CAPErrorMessageSMDeliveryFailure createCAPErrorMessageSMDeliveryFailure(SMEnumeratedDeliveryFailureCause smEnumeratedDeliveryFailureCause,
-//                     byte[] signalInfo, CAPExtensionContainer 
extensionContainer);
+ public CAPErrorMessageCancelFailed createCAPErrorMessageCancelFailed(CancelProblem cancelProblem);
+
+ public CAPErrorMessageRequestedInfoError createCAPErrorMessageRequestedInfoError(CAPErrorMessageRequestedInfoError capErrorMessageRequestedInfoError);
+
+ public CAPErrorMessageSystemFailure createCAPErrorMessageSystemFailure(CAPErrorMessageSystemFailure capErrorMessageSystemFailure);
+
+ public CAPErrorMessageTaskRefused createCAPErrorMessageTaskRefused(CAPErrorMessageTaskRefused capErrorMessageTaskRefused);

 }
=======================================
--- /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageParameterless.java Mon Apr 23 10:53:14 2012 +++ /cap/cap-api/src/main/java/org/mobicents/protocols/ss7/cap/api/errors/CAPErrorMessageParameterless.java Tue Jun 12 07:25:18 2012
@@ -28,6 +28,6 @@
  * @author sergey vetyutnev
  *
  */
-public interface CAPErrorMessageParameterless extends CAPErrorMessage{
+public interface CAPErrorMessageParameterless extends CAPErrorMessage {

 }
=======================================
--- /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageFactoryImpl.java Mon Apr 23 10:53:14 2012 +++ /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageFactoryImpl.java Tue Jun 12 07:25:18 2012
@@ -23,8 +23,13 @@
 package org.mobicents.protocols.ss7.cap.errors;

 import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessage;
+import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageCancelFailed;
 import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageFactory;
import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageParameterless; +import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageRequestedInfoError; +import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageSystemFailure; +import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageTaskRefused;
+import org.mobicents.protocols.ss7.cap.api.errors.CancelProblem;

 /**
  * The factory of CAP ReturnError messages
@@ -45,4 +50,28 @@
public CAPErrorMessageParameterless createCAPErrorMessageParameterless(Long errorCode) {
                return new CAPErrorMessageParameterlessImpl(errorCode);
        }
-}
+
+       @Override
+ public CAPErrorMessageCancelFailed createCAPErrorMessageCancelFailed(CancelProblem cancelProblem) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+ public CAPErrorMessageRequestedInfoError createCAPErrorMessageRequestedInfoError(CAPErrorMessageRequestedInfoError capErrorMessageRequestedInfoError) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+ public CAPErrorMessageSystemFailure createCAPErrorMessageSystemFailure(CAPErrorMessageSystemFailure capErrorMessageSystemFailure) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+ public CAPErrorMessageTaskRefused createCAPErrorMessageTaskRefused(CAPErrorMessageTaskRefused capErrorMessageTaskRefused) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+}
=======================================
--- /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageImpl.java Mon Apr 23 10:53:14 2012 +++ /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/errors/CAPErrorMessageImpl.java Tue Jun 12 07:25:18 2012
@@ -23,7 +23,11 @@
 package org.mobicents.protocols.ss7.cap.errors;

 import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessage;
+import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageCancelFailed; import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageParameterless; +import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageRequestedInfoError; +import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageSystemFailure; +import org.mobicents.protocols.ss7.cap.api.errors.CAPErrorMessageTaskRefused;
 import org.mobicents.protocols.ss7.cap.primitives.CAPAsnPrimitive;

 /**
@@ -52,10 +56,25 @@
                return false;
        }

-//     @Override
-//     public boolean isEmFacilityNotSup() {
-//             return false;
-//     }
+       @Override
+       public boolean isEmCancelFailed() {
+               return false;
+       }
+
+       @Override
+       public boolean isEmRequestedInfoError() {
+               return false;
+       }
+
+       @Override
+       public boolean isEmSystemFailure() {
+               return false;
+       }
+
+       @Override
+       public boolean isEmTaskRefused() {
+               return false;
+       }


        @Override
@@ -63,9 +82,24 @@
                return null;
        }

-//     @Override
-//     public CAPErrorMessageFacilityNotSup getEmFacilityNotSup() {
-//             return null;
-//     }
-
-}
+       @Override
+       public CAPErrorMessageCancelFailed getEmCancelFailed() {
+               return null;
+       }
+
+       @Override
+       public CAPErrorMessageRequestedInfoError getEmRequestedInfoError() {
+               return null;
+       }
+
+       @Override
+       public CAPErrorMessageSystemFailure getEmSystemFailure() {
+               return null;
+       }
+
+       @Override
+       public CAPErrorMessageTaskRefused getEmTaskRefused() {
+               return null;
+       }
+}
+

==============================================================================
Revision: 2fc97fc151d4
Author:   Sergey Vetyutnev <[email protected]>
Date:     Tue Jun 12 07:29:40 2012
Log:      Merge branch 'cap2'
http://code.google.com/p/jss7/source/detail?r=2fc97fc151d4


Reply via email to