From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001
From: Daniel Baumann
+ Acceptor is a delegating service. You can add further acceptors by giving
+ them a service name com.sun.star.connection.Acceptor.xxx, where xxx is the
+ connection type used in the connection string during accept()/connect() call.
+
+ */
+published service Acceptor: XAcceptor;
+
+
+}; }; }; };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/udkapi/com/sun/star/connection/AlreadyAcceptingException.idl b/udkapi/com/sun/star/connection/AlreadyAcceptingException.idl
new file mode 100644
index 0000000000..0562011a51
--- /dev/null
+++ b/udkapi/com/sun/star/connection/AlreadyAcceptingException.idl
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+ module com { module sun { module star { module connection {
+
+/** Is thrown, when there is another thread already accepting on this instance.
+ */
+published exception AlreadyAcceptingException: com::sun::star::uno::Exception
+{
+};
+
+
+};};};};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/udkapi/com/sun/star/connection/ConnectionSetupException.idl b/udkapi/com/sun/star/connection/ConnectionSetupException.idl
new file mode 100644
index 0000000000..a4c1d2edc9
--- /dev/null
+++ b/udkapi/com/sun/star/connection/ConnectionSetupException.idl
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+ module com { module sun { module star { module connection {
+
+/** Is thrown, when it is not possible to accept on a local resource.
+ */
+published exception ConnectionSetupException: com::sun::star::uno::Exception
+{
+};
+
+
+};};};};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/udkapi/com/sun/star/connection/Connector.idl b/udkapi/com/sun/star/connection/Connector.idl
new file mode 100644
index 0000000000..5e6801de44
--- /dev/null
+++ b/udkapi/com/sun/star/connection/Connector.idl
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+ module com { module sun { module star { module connection {
+
+published interface XConnector;
+
+
+/** allows to establish a connection to another process.
+
+ Connector is a delegating service. You can add further connectors by giving
+ them a service name com.sun.star.connection.Connector.xxx, where xxx is the
+ connection type used in the connection string during accept()/connect() call.
+ */
+published service Connector: XConnector;
+
+
+}; }; }; };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/udkapi/com/sun/star/connection/NoConnectException.idl b/udkapi/com/sun/star/connection/NoConnectException.idl
new file mode 100644
index 0000000000..baa7e3da85
--- /dev/null
+++ b/udkapi/com/sun/star/connection/NoConnectException.idl
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+module com { module sun { module star { module connection {
+
+/** Is thrown in case no one is accepting on the specified resource.
+ */
+published exception NoConnectException: com::sun::star::uno::Exception
+{
+};
+
+
+};};};};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/udkapi/com/sun/star/connection/SocketPermission.idl b/udkapi/com/sun/star/connection/SocketPermission.idl
new file mode 100644
index 0000000000..a86cb9f45d
--- /dev/null
+++ b/udkapi/com/sun/star/connection/SocketPermission.idl
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+module com { module sun { module star { module connection {
+
+
+/** This permission represents access to a network via sockets.
+ A SocketPermission consists of a host specification and a set of actions
+ specifying ways to connect to that host. The host is specified as
+
+ The possible ways to connect to the host are
+
+ host = (hostname | IPaddress)[:portrange]
+ portrange = portnumber | -portnumber | portnumber-[portnumber]
+
+ The host is expressed as a DNS name, as a numerical IP address, or as
+ "localhost"
(for the local machine). The wildcard "*"
+ may be included once
+ in a DNS name host specification. If it is included, it must be in the
+ leftmost position, as in "*.sun.com"
.
+
+ The port or portrange is optional. A port specification of the form "N-"
,
+ where N
is a port number, signifies all ports numbered N
and above,
+ while a specification of the form "-N"
indicates all ports numbered
+ N
and below.
+
+
+
accept
connect
listen
resolve
+ The "listen"
action is only meaningful when used with "localhost"
.
+ The "resolve"
(resolve host/ip name service lookups) action is implied when
+ any of the other actions are present.
+
+ As an example of the creation and meaning of SocketPermissions, note that if
+ the following permission
+
+SocketPermission("foo.bar.com:7777", "connect,accept");
+
+ is granted, it allows to connect to port 7777 on foo.bar.com, and to
+ accept connections on that port.
+
+ Similarly, if the following permission
+
+SocketPermission("localhost:1024-", "accept,connect,listen");
+
+ is granted, it allows that code to accept connections on, connect to, or listen
+ on any port between 1024 and 65535 on the local host.
+
+ This is the counterpart to the XConnector interface. + */ +published interface XAcceptor: com::sun::star::uno::XInterface +{ + /** accepts an interprocess connection. Waits until someone connects to the resource. +
+ After a successful return, the method may be called again to accept + further connections, but the parameter string MUST be left unchanged. + + + @param sConnectionDescription + contains the kind of the connection plus a + comma separated list of attributes, + e.g., socket,host=localhost,port=2345 for a tcpip connection. + + @return null reference, + stopAccepting was called. + Otherwise a valid XConnection reference. + + @throws AlreadyAcceptingException + Only one acceptor-thread per instance allowed. + @throws ConnectionSetupException + Problems during setting up the acceptor. + (e.g., Security-reasons, socket already busy, etc.) + @throws com::sun::star::lang::IllegalArgumentException + sConnectionDescription could not be interpreted + + */ + XConnection accept( [in] string sConnectionDescription ) + raises( AlreadyAcceptingException, + ConnectionSetupException, + com::sun::star::lang::IllegalArgumentException); + + + /** pushes acceptor out of the accept-call. + */ + void stopAccepting(); +}; + +};};};}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/udkapi/com/sun/star/connection/XConnection.idl b/udkapi/com/sun/star/connection/XConnection.idl new file mode 100644 index 0000000000..1af7b1ff67 --- /dev/null +++ b/udkapi/com/sun/star/connection/XConnection.idl @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module connection { + +/** A bidirectional bytestream. + +
You should additionally implement XConnection2. + + @see XConnection2 + */ +published interface XConnection: com::sun::star::uno::XInterface +{ + + /** reads a requested number of bytes from the connection. +
This method is blocking, meaning that it always returns a bytesequence + with the requested number of bytes, unless it has reached end of file (which + often means, that close() has been called). + +
please see also the readSomeBytes() method of XConnection2. + + @return The read number of bytes. + The return value and the length of the + returned sequence must be identical. + @param aReadBytes + The buffer to receive the read bytes. + @param nBytesToRead + The number of bytes to be read from the stream. + + @throws com::sun::star::io::IOException + in case an error occurred during reading from the stream. + */ + long read( [out] sequence < byte > aReadBytes , [in] long nBytesToRead ) + raises( com::sun::star::io::IOException ); + + /** writes the given bytesequence to the stream. +
The method blocks until the whole sequence is written. + + @throws com::sun::star::io::IOException + in case an error occurred during writing to the stream. + */ + void write( [in] sequence < byte > aData ) + raises( com::sun::star::io::IOException ); + + + /** Empties all internal buffers. + */ + void flush( ) + raises( com::sun::star::io::IOException ); + + /** Immediately terminates any ongoing read or write calls. + All subsequent read or write calls() + */ + void close( ) + raises( com::sun::star::io::IOException ); + + + /** A unique string describing the connection. + +
This string is different from the arguments to XConnection::accept() + and XConnector::connect(). In general, the string contains an additional + handle value. For example, "socket,host=localhost,port=2002,uniqueValue=2324".
+ */ + string getDescription(); +}; + +};};};}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/udkapi/com/sun/star/connection/XConnection2.idl b/udkapi/com/sun/star/connection/XConnection2.idl new file mode 100644 index 0000000000..72c836edb4 --- /dev/null +++ b/udkapi/com/sun/star/connection/XConnection2.idl @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module connection { + + + + +/** + XConnection2 extends theXConnection
interface
+ with available
and readSomeBytes
+*/
+published interface XConnection2: com::sun::star::connection::XConnection
+{
+
+ /** Gives the number of bytes available via read
+ without blocking.
+ */
+ long available() raises(com::sun::star::io::IOException);
+
+ /** Blocks if no data is available otherwise reads at
+ max nMaxBytesToRead but at least 1 byte.
+
+ */
+ long readSomeBytes([out] sequenceMaybe supported by connections returned from XAcceptor::accept() + or XConnector::connect(). + */ +published interface XConnectionBroadcaster: com::sun::star::uno::XInterface +{ + + /** registers an object to receive events from this connection. + +
It is suggested to allow multiple registration of the same listener, + thus for each time a listener is added, it has to be removed. + */ + void addStreamListener( [in] com::sun::star::io::XStreamListener aListener ); + + + /** unregisters an object to receive events from this connection. + +
It is suggested to allow multiple registration of the same listener, + thus for each time a listener is added, it has to be removed. + */ + void removeStreamListener( [in] com::sun::star::io::XStreamListener aListener ); +}; + +};};};}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/udkapi/com/sun/star/connection/XConnector.idl b/udkapi/com/sun/star/connection/XConnector.idl new file mode 100644 index 0000000000..742068b033 --- /dev/null +++ b/udkapi/com/sun/star/connection/XConnector.idl @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module connection { + +/** + allows to actively establish an interprocess connection. + */ +published interface XConnector: com::sun::star::uno::XInterface +{ + /** creates a new connection interprocess connection. +
+ Tries to connect to an XAcceptor. Behavior is unspecified + if a call to connect is made when another call to connect either has not + yet returned or has returned successfully without raising an exception. + + @param sConnectionDescription + contains the kind of the connection plus a + comma separated list of attributes, + e.g., socket,host=localhost,port=2345 for a tcpip connection. + + @throws ConnectionSetupException + Problems during setting up the connector + on client side, (e.g., Security-reasons, socket already busy .. ), + or the string could not be interpreted correctly. + + @throws NoConnectException + Couldn't reach a server (e.g. network failure), + no server is listening + */ + XConnection connect( [in] string sConnectionDescription ) + raises( NoConnectException,ConnectionSetupException ); +}; + + +};};};}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3