diff options
author | Tarun Gupta <tarun1995gupta@gmail.com> | 2015-06-20 12:10:51 (GMT) |
---|---|---|
committer | Tarun Gupta <tarun1995gupta@gmail.com> | 2015-06-30 13:23:04 (GMT) |
commit | ba7342e593920595af36fcd8e8e44ec206f8b561 (patch) | |
tree | fa8921599a20d85845d23d9a97bbc1cf230c7a51 /src/com/isode/stroke/elements/StreamInitiation.java | |
parent | a673d269487fd86efe7f9c5f9b4cd1c00cab556d (diff) | |
download | stroke-ba7342e593920595af36fcd8e8e44ec206f8b561.zip stroke-ba7342e593920595af36fcd8e8e44ec206f8b561.tar.bz2 |
Add StreamInitiation Elements.
Adds StreamInitiationFileInfo Element, its Parser and Serializer.
Adds StreamInitiation Element, its Parser and Serializer.
Adds StreamError Parser and Serializer.
Updates StreamManagementEnabled Element.
License:
This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Test-Information:
Tests added for StreamInitiation Parser and Serializer, which passes.
Change-Id: I21a7de3f6a5ac0955b6e5aaae3c2607a30eae002
Diffstat (limited to 'src/com/isode/stroke/elements/StreamInitiation.java')
-rw-r--r-- | src/com/isode/stroke/elements/StreamInitiation.java | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/src/com/isode/stroke/elements/StreamInitiation.java b/src/com/isode/stroke/elements/StreamInitiation.java new file mode 100644 index 0000000..466139c --- /dev/null +++ b/src/com/isode/stroke/elements/StreamInitiation.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010-2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ +/* + * Copyright (c) 2015 Tarun Gupta. + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +package com.isode.stroke.elements; + +import com.isode.stroke.elements.Payload; +import com.isode.stroke.elements.StreamInitiationFileInfo; +import com.isode.stroke.base.NotNull; +import java.util.Vector; + +public class StreamInitiation extends Payload { + + private boolean isFileTransfer; + private String id = ""; + private StreamInitiationFileInfo fileInfo; + private Vector<String> providedMethods = new Vector<String>(); + private String requestedMethod = ""; + + /** + * Default Constructor. + */ + public StreamInitiation() { + this.isFileTransfer = true; + } + + /** + * @return id, NotNull. + */ + public String getID() { + return id; + } + + /** + * @param id, NotNull. + */ + public void setID(String id) { + NotNull.exceptIfNull(id, "id"); + this.id = id; + } + + /** + * @return fileInfo. + */ + public StreamInitiationFileInfo getFileInfo() { + return fileInfo; + } + + /** + * @param fileInfo. + */ + public void setFileInfo(StreamInitiationFileInfo info) { + fileInfo = info; + } + + /** + * @return providedMethods. + */ + public Vector<String> getProvidedMethods() { + return providedMethods; + } + + /** + * @param method, Not Null. + */ + public void addProvidedMethod(String method) { + NotNull.exceptIfNull(method, "method"); + providedMethods.add(method); + } + + /** + * @param method, Not Null. + */ + public void setRequestedMethod(String method) { + NotNull.exceptIfNull(method, "method"); + requestedMethod = method; + } + + /** + * @return method, Not Null. + */ + public String getRequestedMethod() { + return requestedMethod; + } + + /** + * @return isFileTransfer. + */ + public boolean getIsFileTransfer() { + return isFileTransfer; + } + + /** + * @param isFileTransfer. + */ + public void setIsFileTransfer(boolean b) { + isFileTransfer = b; + } +}
\ No newline at end of file |