keycloak-federation
クラス | 公開メンバ関数 | 静的公開メンバ関数 | 公開変数類 | 全メンバ一覧
org.freedesktop.dbus.Transport クラス
org.freedesktop.dbus.Transport 連携図
Collaboration graph

クラス

class  SASL
 

公開メンバ関数

 Transport ()
 
 Transport (BusAddress address) throws IOException
 
 Transport (String address) throws IOException, ParseException
 
 Transport (String address, int timeout) throws IOException, ParseException
 
void connect (String address) throws IOException, ParseException
 
void connect (String address, int timeout) throws IOException, ParseException
 
void connect (BusAddress address) throws IOException
 
void connect (BusAddress address, int timeout) throws IOException
 
void disconnect () throws IOException
 

静的公開メンバ関数

static String genGUID ()
 

公開変数類

MessageReader min
 
MessageWriter mout
 

詳解

構築子と解体子

◆ Transport() [1/4]

org.freedesktop.dbus.Transport.Transport ( )
inline
737  {
738  }

◆ Transport() [2/4]

org.freedesktop.dbus.Transport.Transport ( BusAddress  address) throws IOException
inline
748  {
749  connect(address);
750  }
void connect(String address)
Definition: Transport.java:760

◆ Transport() [3/4]

org.freedesktop.dbus.Transport.Transport ( String  address) throws IOException, ParseException
inline
752  {
753  connect(new BusAddress(address));
754  }
void connect(String address)
Definition: Transport.java:760

◆ Transport() [4/4]

org.freedesktop.dbus.Transport.Transport ( String  address,
int  timeout 
) throws IOException, ParseException
inline
756  {
757  connect(new BusAddress(address), timeout);
758  }
void connect(String address)
Definition: Transport.java:760

関数詳解

◆ connect() [1/4]

void org.freedesktop.dbus.Transport.connect ( String  address) throws IOException, ParseException
inline
760  {
761  connect(new BusAddress(address), 0);
762  }
void connect(String address)
Definition: Transport.java:760

◆ connect() [2/4]

void org.freedesktop.dbus.Transport.connect ( String  address,
int  timeout 
) throws IOException, ParseException
inline
764  {
765  connect(new BusAddress(address), timeout);
766  }
void connect(String address)
Definition: Transport.java:760

◆ connect() [3/4]

void org.freedesktop.dbus.Transport.connect ( BusAddress  address) throws IOException
inline
768  {
769  connect(address, 0);
770  }
void connect(String address)
Definition: Transport.java:760

◆ connect() [4/4]

void org.freedesktop.dbus.Transport.connect ( BusAddress  address,
int  timeout 
) throws IOException
inline
772  {
773  if (Debug.debug) Debug.print(Debug.INFO, "Connecting to " + address);
774  OutputStream out = null;
775  InputStream in = null;
776  UnixSocket us = null;
777  Socket s = null;
778  int mode = 0;
779  int types = 0;
780  if ("unix".equals(address.getType())) {
781  types = SASL.AUTH_EXTERNAL;
782  mode = SASL.MODE_CLIENT;
783  us = new UnixSocket();
784  if (null != address.getParameter("abstract"))
785  us.connect(new UnixSocketAddress(address.getParameter("abstract"), true));
786  else if (null != address.getParameter("path"))
787  us.connect(new UnixSocketAddress(address.getParameter("path"), false));
788  us.setPassCred(true);
789  in = us.getInputStream();
790  out = us.getOutputStream();
791  } else if ("tcp".equals(address.getType())) {
792  types = SASL.AUTH_SHA;
793  if (null != address.getParameter("listen")) {
794  mode = SASL.MODE_SERVER;
795  ServerSocket ss = new ServerSocket();
796  ss.bind(new InetSocketAddress(address.getParameter("host"), Integer.parseInt(address.getParameter("port"))));
797  s = ss.accept();
798  } else {
799  mode = SASL.MODE_CLIENT;
800  s = new Socket();
801  s.connect(new InetSocketAddress(address.getParameter("host"), Integer.parseInt(address.getParameter("port"))));
802  }
803  in = s.getInputStream();
804  out = s.getOutputStream();
805  } else {
806  throw new IOException(getString("unknownAddress") + address.getType());
807  }
808 
809  if (!(new SASL()).auth(mode, types, address.getParameter("guid"), out, in, us)) {
810  out.close();
811  throw new IOException(getString("errorAuth"));
812  }
813  if (null != us) {
814  if (Debug.debug) Debug.print(Debug.VERBOSE, "Setting timeout to " + timeout + " on Socket");
815  if (timeout == 1)
816  us.setBlocking(false);
817  else
818  us.setSoTimeout(timeout);
819  }
820  if (null != s) {
821  if (Debug.debug) Debug.print(Debug.VERBOSE, "Setting timeout to " + timeout + " on Socket");
822  s.setSoTimeout(timeout);
823  }
824  mout = new MessageWriter(out);
825  min = new MessageReader(in);
826  }
MessageReader min
Definition: Transport.java:734
MessageWriter mout
Definition: Transport.java:735

◆ disconnect()

void org.freedesktop.dbus.Transport.disconnect ( ) throws IOException
inline
828  {
829  if (Debug.debug) Debug.print(Debug.INFO, "Disconnecting Transport");
830  min.close();
831  mout.close();
832  }
MessageReader min
Definition: Transport.java:734
void close()
Definition: MessageWriter.java:63
MessageWriter mout
Definition: Transport.java:735
void close()
Definition: MessageReader.java:190

◆ genGUID()

static String org.freedesktop.dbus.Transport.genGUID ( )
inlinestatic
740  {
741  Random r = new Random();
742  byte[] buf = new byte[16];
743  r.nextBytes(buf);
744  String guid = Hexdump.toHex(buf);
745  return guid.replaceAll(" ", "");
746  }

メンバ詳解

◆ min

MessageReader org.freedesktop.dbus.Transport.min

◆ mout

MessageWriter org.freedesktop.dbus.Transport.mout

このクラス詳解は次のファイルから抽出されました: