From 621d9e5c413e561293d7484b93882d985b3fe15f Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Sat, 24 Mar 2012 02:27:47 -0500 Subject: Removed unnecessary pki folder. Previously the source code was located inside a pki folder. This folder was created during svn migration and is no longer needed. This folder has now been removed and the contents have been moved up one level. Ticket #131 --- .../netscape/certsrv/client/IDataProcessor.java | 36 ++++++++++++++++ .../certsrv/client/connection/IAuthenticator.java | 26 +++++++++++ .../certsrv/client/connection/IConnection.java | 50 ++++++++++++++++++++++ .../client/connection/IConnectionFactory.java | 43 +++++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 base/common/src/com/netscape/certsrv/client/IDataProcessor.java create mode 100644 base/common/src/com/netscape/certsrv/client/connection/IAuthenticator.java create mode 100644 base/common/src/com/netscape/certsrv/client/connection/IConnection.java create mode 100644 base/common/src/com/netscape/certsrv/client/connection/IConnectionFactory.java (limited to 'base/common/src/com/netscape/certsrv/client') diff --git a/base/common/src/com/netscape/certsrv/client/IDataProcessor.java b/base/common/src/com/netscape/certsrv/client/IDataProcessor.java new file mode 100644 index 000000000..b6784b6d2 --- /dev/null +++ b/base/common/src/com/netscape/certsrv/client/IDataProcessor.java @@ -0,0 +1,36 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// (C) 2007 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- +package com.netscape.certsrv.client; + +/** + * this class represents the callback interface between + * the client package and the data storage object (data model) + * + * @version $Revision$, $Date$ + */ +public interface IDataProcessor { + + /** + * This method will be callby the client package each time + * data object arrived from the server side. + * + * @param data data object expected by the interface implementor + */ + public void processData(Object data); + +} diff --git a/base/common/src/com/netscape/certsrv/client/connection/IAuthenticator.java b/base/common/src/com/netscape/certsrv/client/connection/IAuthenticator.java new file mode 100644 index 000000000..0a96ee698 --- /dev/null +++ b/base/common/src/com/netscape/certsrv/client/connection/IAuthenticator.java @@ -0,0 +1,26 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// (C) 2007 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- +package com.netscape.certsrv.client.connection; + +/** + * An interface represents authentiator. + * + * @version $Revision$, $Date$ + */ +public interface IAuthenticator { +} diff --git a/base/common/src/com/netscape/certsrv/client/connection/IConnection.java b/base/common/src/com/netscape/certsrv/client/connection/IConnection.java new file mode 100644 index 000000000..4a8166b02 --- /dev/null +++ b/base/common/src/com/netscape/certsrv/client/connection/IConnection.java @@ -0,0 +1,50 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// (C) 2007 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- +package com.netscape.certsrv.client.connection; + +import java.io.IOException; +import java.net.SocketException; + +/** + * Interface for all connection objects. + * + * @version $Revision$, $Date$ + */ +public interface IConnection { + + /** + * Send request to the server using this connection + */ + public int sendRequest(String req) throws IOException; + + /** + * Returns the response in byte array format + */ + public byte[] getResponse(); + + /** + * Close the connection + */ + public void disconnect(); + + /** + * SetTimeout + */ + public void setSoTimeout(int timeout) throws SocketException; + +} diff --git a/base/common/src/com/netscape/certsrv/client/connection/IConnectionFactory.java b/base/common/src/com/netscape/certsrv/client/connection/IConnectionFactory.java new file mode 100644 index 000000000..4506abbfa --- /dev/null +++ b/base/common/src/com/netscape/certsrv/client/connection/IConnectionFactory.java @@ -0,0 +1,43 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// (C) 2007 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- +package com.netscape.certsrv.client.connection; + +import java.io.IOException; +import java.net.UnknownHostException; + +/** + * Interface for all connection factory. Primarily act as + * the abstraction layer for different kind of connection factory. + * + * @version $Revision$, $Date$ + */ +public interface IConnectionFactory { + + /** + * Creates connection using the host and port + * + * @param host The host to connect to + * @param port The port to connect to + * @return The created connection + * @throws IOException On an IO Error + * @throws UnknownHostException If the host can't be resolved + */ + public IConnection create(String host, int port) + throws IOException, UnknownHostException; + +} -- cgit