-include Makefile.inc
-EXAMPLES := SimpleLLTest.class SSLClient.class SSLServer.class QueryDemo.class
-# broken: ProducerTestIL.class ProducerTestLL.class
+EXAMPLES := SimpleLLTest.class SSLClient.class SSLServer.class QueryDemo.class ProducerTestIL.class ProducerTestLL.class
VPATH := examples
cd src_c && make install PREFIX=${PREFIX}
clean:
- echo TODO
+ rm -rf dist
+ find . -name \*.class -exec rm {} \;
+ cd src_c && make clean
* Example:
* ctx.setPathToCertificate("/home/paja6/myCertificate.p12");
*/
- ctx.setPathToCertificate(args[9]);
+ ctx.setCredentials(new LBCredentials(args[9],null));
System.out.println("pathToCertificate: " + args[9]);
/* Path to directory where will be saved files with logs until inter-logger sends
import org.glite.lb.SSLSend;
+import org.glite.lb.LBCredentials;
public class SSLClient {
public static void main(String[] args) {
SSLSend ssl = new SSLSend();
try {
- ssl.send(args[0],"localhost",9002,100,"baff");
+ ssl.send(new LBCredentials(args[0],null),"localhost",9002,100,"baff");
}
catch (Exception e) {
System.err.println(e);
ctx.setTimeout(5);
ctx.setAddress("localhost");
ctx.setPort(9002);
- ctx.setPathToCertificate(args[0]);
+ ctx.setCredentials(new LBCredentials(args[0],null));
ctx.setPrefix("/tmp/dglog.paja6_testProxy6");
EventRunning running = new EventRunning();
running.setNode("node");
private String prefix;
private int repeatWriteToFile = 5;
private int timeout = 30000; //in milliseconds
- private String pathToCertificate;
+ private LBCredentials cred;
private SSLSend sslSend = null;
public ContextLL() {
ILFileWriter.write(prefix, message, repeatWriteToFile);
- sslSend.send(pathToCertificate, address, port, timeout, message);
+ sslSend.send(cred, address, port, timeout, message);
}
public String getAddress() {
this.timeout = timeout;
}
- public String getPathToCertificate() {
- return pathToCertificate;
+ public LBCredentials getCredentials() {
+ return cred;
}
- public void setPathToCertificate(String pathToCertificate) {
- if (pathToCertificate == null) {
- throw new IllegalArgumentException("ContextLL pathToCertificate");
+ public void setCredentials(LBCredentials cred) {
+ if (cred == null) {
+ throw new IllegalArgumentException("ContextLL credentials");
}
- this.pathToCertificate = pathToCertificate;
+ this.cred = cred;
}
*/
public JobStatus receive(int timeout) throws LBException {
SSL ssl = new SSL();
- ssl.setProxy(keyStore);
+ ssl.setCredentials(lbCredent);
ILProtoReceiver receiver = null;
String received = null;
try {
return parser.getJobInfo();
} catch (IOException ex) {
throw new LBException(ex);
- } catch (KeyManagementException ex) {
- throw new LBException(ex);
- } catch (KeyStoreException ex) {
- throw new LBException(ex);
- } catch (NoSuchAlgorithmException ex) {
- throw new LBException(ex);
} catch (ParserConfigurationException ex) {
throw new LBException(ex);
} catch (SAXException ex) {
* @param timeout connection timeout
* @param message message which will be send
*/
- public void send(String keyStoreSender, String host,
+ public void send(LBCredentials cred, String host,
int port, int timeout, String message)
throws LBException
-// throws KeyStoreException,IOException,NoSuchAlgorithmException,KeyManagementException
{
try {
SSL lbsock = new SSL();
- lbsock.setProxy(keyStoreSender);
+ lbsock.setCredentials(cred);
Socket sock = lbsock.connect(host,port,timeout);
PrintStream s = new PrintStream(sock.getOutputStream(),false);
s.flush();
s.close();
}
- catch (KeyStoreException e) {
- throw new LBException(e);
- }
catch (IOException e) {
throw new LBException(e);
}
- catch (NoSuchAlgorithmException e) {
- throw new LBException(e);
- }
- catch (KeyManagementException e) {
- throw new LBException(e);
- }
}
}
install: compile
-mkdir -p ${PREFIX}/lib
libtool --mode=install install -m 755 ${LIB} ${PREFIX}/lib
+
+clean:
+ rm -rf ${OBJ} .libs ${LIB}