Changeset 365

User picture

Author: klystr

(2009/12/04 09:31) About 2 years ago

Get van Q2 done

Affected files

Updated Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/channels/ESBQueue.java Download diff

364365
52
		return this.queue.poll();
52
		return this.queue.poll();
53
	}
53
	}
54
54
55
	/**
56
	 * Geeft Array terug van hele queue
57
	 * 
58
	 * @return Lijst met alle items
59
	 */
60
	public LinkedList<String> peekEntireQueue() {
61
		return new LinkedList<String>(this.queue);
62
	}
63
55
	public void setqName(String qName) {
64
	public void setqName(String qName) {
56
		this.qName = qName;
65
		this.qName = qName;
57
	}
66
	}

Updated Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/ftp/ESBFTP.java Download diff

364365
113
		try {
113
		try {
114
			outputStream = new ByteArrayOutputStream();
114
			outputStream = new ByteArrayOutputStream();
115
			this.ftpClient.retrieveFile(filePath, outputStream);
115
			this.ftpClient.retrieveFile(filePath, outputStream);
116
			this.ftpClient.dele(filePath);
116
			// this.ftpClient.dele(filePath);
117
		} catch (IOException e) {
117
		} catch (IOException e) {
118
			e.printStackTrace();
118
			e.printStackTrace();
119
		}
119
		}

Added Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/http/get-example.txt

Show contents

Added Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/http/HTTPConnection.java

Show contents

Added Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/http/HTTPGetConnection.java

Show contents

Updated Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/http/HTTPQ2AppChannel.java Download diff

364365
3
import hanze.ga.wt3.channels.Q2App;
3
import hanze.ga.wt3.channels.Q2App;
4
import hanze.ga.wt3.helper.Security;
4
import hanze.ga.wt3.helper.Security;
5
5
6
import java.io.IOException;
7
import java.net.ServerSocket;
8
6
public class HTTPQ2AppChannel extends Q2App {
9
public class HTTPQ2AppChannel extends Q2App {
7
10
8
	private Security httpSecurity;
11
	private Security httpSecurity;
12
	private ServerSocket serverSocket;
9
13
10
	public Security getHttpSecurity() {
14
	public Security getHttpSecurity() {
11
		return httpSecurity;
15
		return httpSecurity;
12
	}
16
	}
13
17
18
	private void openConnection() {
19
		try {
20
			System.out.println("[HTTPQ2AppChannel] Start listening on port "
21
					+ this.getChannelPort() + " for Queue: " + this.getSourceQueue().getqName());
22
23
			serverSocket = new ServerSocket(this.getChannelPort());
24
			while (true) {
25
				new Thread(new HTTPGetConnection(serverSocket.accept(), this)).start();
26
			}
27
		} catch (IOException e) {
28
			e.printStackTrace();
29
		}
30
	}
31
14
	@Override
32
	@Override
15
	public void run() {
33
	public void run() {
16
34
		this.openConnection();
17
	}
35
	}
18
36
19
	public void setHttpSecurity(Security httpSecurity) {
37
	public void setHttpSecurity(Security httpSecurity) {

Updated Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/xml/configuration.xml Download diff

364365
21
		<adapter> 
21
		<adapter> 
22
			<direction>Q2APP</direction> 
22
			<direction>Q2APP</direction> 
23
			<protocol >HTTP</protocol> 
23
			<protocol >HTTP</protocol> 
24
			<port>9090</port> 
24
			<port>8080</port> 
25
			<security> 
25
			<security> 
26
				<enc-type>AES-128</enc-type> 
26
				<enc-type>AES-128</enc-type> 
27
				<key>3939A97A7779676969AD39D0E1F3ADFA</key> 
27
				<key>3939A97A7779676969AD39D0E1F3ADFA</key>