/** Adds a media format to the media description. * Each element in this Vector should be an String value which matches one of the * a=rtpmap: attribute fields of the media description. * @param mediaFormats the format to add. * @throws SdpException if the vector is null */ public void setMediaFormats(Vector mediaFormats) throws SdpException { if (mediaFormats == null) throw new SdpException("The mediaFormats is null"); this.formats = mediaFormats; }
public Throwable getRootCause() { return fillInStackTrace(); }
public String getMessage() { return super.getMessage(); }
public TimeZoneAdjustment createTimeZoneAdjustment(Date d, int offset) { ZoneField z = new ZoneField(); try { Hashtable<Date, Integer> t = new Hashtable<Date, Integer>(1); t.put(d, offset); z.setZoneAdjustments(t); } catch (SdpException e) { e.printStackTrace(); } return z; }
public SessionName createSessionName(String name) { SessionNameField sn = new SessionNameField(); try { sn.setValue(name); } catch (SdpException e) { e.printStackTrace(); } return sn; }
/** Sets the name of the session originator. * @param user the string username. * @throws SdpException if the parameter is null */ public void setUsername(String user) throws SdpException { if (user == null) throw new SdpException("The user parameter is null"); else { this.username = user; } }
public Version createVersion(int value) { ProtoVersionField pv = new ProtoVersionField(); try { pv.setVersion(value); } catch (SdpException e) { e.printStackTrace(); return null; } return pv; }
public String getMessage() { if (super.getMessage() != null) return super.getMessage(); else if (mEx != null) return mEx.getMessage(); else return null; }
/** Returns the type of the network for this Connection. * @param type to set * @throws SdpException if the type is null */ public void setAddressType(String type) throws SdpException { if (type == null) throw new SdpException("the type is null"); this.addrtype = type; }
public Info createInfo(String value) { InformationField i = new InformationField(); try { i.setValue(value); } catch (SdpException e) { e.printStackTrace(); } return i; }
/** * Adds the specified Attribute to this Description object. * * @param attributes - the attribute to add * @throws SdpException * if the vector is null */ public void setAttributes(Vector attributes) throws SdpException { if (attributes == null) throw new SdpException("The parameter is null"); else attributesList = attributes; }
public Phone createPhone(String value) { PhoneField p = new PhoneField(); try { p.setValue(value); } catch (SdpException e) { e.printStackTrace(); } return p; }
/** * Set Preconditions * * @param preconditions - vector with precondition attributes * @throws SdpException -- if precondition attributes is null */ public void setPreconditions(Vector preconditions) throws SdpException { if (preconditions == null) throw new SdpException("Precondition attributes are null"); else preconditionAttributes = preconditions; }
public EMail createEMail(String value) { EmailField e = new EmailField(); try { e.setValue(value); } catch (SdpException e1) { e1.printStackTrace(); } return e; }
/** * set the value of the Bandwidth with the specified type * * @param bandwidths * type of the Bandwidth object whose value is requested * @throws SdpException * if vector is null */ public void setBandwidths(Vector bandwidths) throws SdpException { if (bandwidths == null) throw new SdpException("The vector bandwidths is null"); this.bandwidthFields = bandwidths; }
public MediaDescription createMediaDescription(String media, int port, int numPorts, String transport, String[] formats) { MediaDescriptionImpl md = new MediaDescriptionImpl(); Vector<String> types = new Vector<String>(); for (String format : formats) { types.addElement(format); } Media m; try { m = createMedia(media, port, numPorts, transport, types); md.setMedia(m); } catch (SdpException e) { e.printStackTrace(); } return md; }
/** * set the value of the Bandwidth with the specified type. * * @param bandwidthList * to set * @throws SdpException * if the vector is null */ public void setBandwidths(Vector bandwidthList) throws SdpException { if (bandwidthList == null) throw new SdpException("The parameter is null"); else this.bandwidthList = bandwidthList; }
public Attribute createAttribute(String name, String value) { AttributeField a = new AttributeField(); try { a.setName(name); a.setValueAllowNull(value); } catch (SdpException e) { e.printStackTrace(); return null; } return a; }
/** * Sets a an email address to contact for further information about the * session. This corresponds to the e= field of the SDP data. * * @param emails * email - the email address. * @throws SdpException * if the vector is null */ public void setEmails(Vector emails) throws SdpException { if (emails == null) throw new SdpException("The parameter is null"); else emailList = emails; }
public BandWidth createBandwidth(String modifier, int value) { BandwidthField bw = new BandwidthField(); try { bw.setBandwidth(value); bw.setType(modifier); } catch (SdpException e) { e.printStackTrace(); return null; } return bw; }