IT. Expert System.

Android Reference

ClientOperation


javax.obex

Class ClientOperation

  • All Implemented Interfaces:
    BaseStream, Operation


    public final class ClientOperation
    extends Object
    implements Operation, BaseStream
    This class implements the Operation interface. It will read and write data via puts and gets.
    • Constructor Detail

      • ClientOperation

        public ClientOperation(int maxSize,
                       ClientSession p,
                       HeaderSet header,
                       boolean type)
                        throws IOException
        Creates new OperationImpl to read and write data to a server
        Parameters:
        maxSize - the maximum packet size
        p - the parent to this object
        type - true if this is a get request; false
        header - the header to set in the initial request
        Throws:
        IOException - if the an IO error occurred
    • Method Detail

      • abort

        public void abort()
                   throws IOException
        Sends an ABORT message to the server. By calling this method, the corresponding input and output streams will be closed along with this object.
        Specified by:
        abort in interface Operation
        Throws:
        IOException - if the transaction has already ended or if an OBEX server called this method
      • getResponseCode

        public int getResponseCode()
                            throws IOException
        Retrieves the response code retrieved from the server. Response codes are defined in the ResponseCodes interface.
        Specified by:
        getResponseCode in interface Operation
        Returns:
        the response code retrieved from the server
        Throws:
        IOException - if an error occurred in the transport layer during the transaction; if this method is called on a HeaderSet object created by calling createHeaderSet in a ClientSession object
        See Also:
        ResponseCodes
      • getEncoding

        public String getEncoding()
        This method will always return null
        Specified by:
        getEncoding in interface Operation
        Returns:
        null
      • getType

        public String getType()
        Returns the type of content that the resource connected to is providing. E.g. if the connection is via HTTP, then the value of the content-type header field is returned.
        Specified by:
        getType in interface Operation
        Returns:
        the content type of the resource that the URL references, or null if not known
      • getLength

        public long getLength()
        Returns the length of the content which is being provided. E.g. if the connection is via HTTP, then the value of the content-length header field is returned.
        Specified by:
        getLength in interface Operation
        Returns:
        the content length of the resource that this connection's URL references, or -1 if the content length is not known
      • close

        public void close()
                   throws IOException
        Closes the connection and ends the transaction
        Specified by:
        close in interface Operation
        Throws:
        IOException - if the operation has already ended or is closed
      • getReceivedHeader

        public HeaderSet getReceivedHeader()
                                    throws IOException
        Returns the headers that have been received during the operation. Modifying the object returned has no effect on the headers that are sent or retrieved.
        Specified by:
        getReceivedHeader in interface Operation
        Returns:
        the headers received during this Operation
        Throws:
        IOException - if this Operation has been closed
      • sendHeaders

        public void sendHeaders(HeaderSet headers)
                         throws IOException
        Specifies the headers that should be sent in the next OBEX message that is sent.
        Specified by:
        sendHeaders in interface Operation
        Parameters:
        headers - the headers to send in the next message
        Throws:
        IOException - if this Operation has been closed or the transaction has ended and no further messages will be exchanged
        IllegalArgumentException - if headers was not created by a call to ServerRequestHandler.createHeaderSet()
        NullPointerException - if headers is null
      • ensureNotDone

        public void ensureNotDone()
                           throws IOException
        Verifies that additional information may be sent. In other words, the operation is not done.
        Specified by:
        ensureNotDone in interface BaseStream
        Throws:
        IOException - if the operation is completed
      • ensureOpen

        public void ensureOpen()
                        throws IOException
        Verifies that the connection is open and no exceptions should be thrown.
        Specified by:
        ensureOpen in interface BaseStream
        Throws:
        IOException - if an exception needs to be thrown
      • continueOperation

        public boolean continueOperation(boolean sendEmpty,
                                boolean inStream)
                                  throws IOException
        Continues the operation since there is no data to read.
        Specified by:
        continueOperation in interface BaseStream
        Parameters:
        sendEmpty - true if the operation should send an empty packet or not send anything if there is no data to send
        inStream - true if the stream is input stream or is output stream
        Returns:
        true if the operation was completed; false if no operation took place
        Throws:
        IOException - if an IO error occurs
      • streamClosed

        public void streamClosed(boolean inStream)
                          throws IOException
        Called when the output or input stream is closed.
        Specified by:
        streamClosed in interface BaseStream
        Parameters:
        inStream - true if the input stream is closed; false if the output stream is closed
        Throws:
        IOException - if an IO error occurs


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 3766 / . Delta: 0.02647 с