Skip to content

Commit

Permalink
checkstyle integration and eclipse compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ermerp authored and bahellma committed Mar 3, 2015
1 parent b0ad1fa commit 1eca250
Show file tree
Hide file tree
Showing 69 changed files with 2,903 additions and 3,022 deletions.
53 changes: 52 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,65 @@
<licenseName>apache_v2</licenseName>
<canUpdateDescription>true</canUpdateDescription>
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
<canUpdateCopyright>false</canUpdateCopyright>
<canUpdateCopyright>true</canUpdateCopyright>
<descriptionTemplate>${basedir}/src/license/description_template.ftl</descriptionTemplate>
<roots>
<root>src/main/java</root>
<root>src/test/java</root>
<root>src/license/dummy</root>
</roots>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.10</version>
<configuration>
<propertyExpansion>headerfile=${project.basedir}/src/license/dummy/Dummy.java</propertyExpansion>
<configLocation>http://trust.f4.hs-hannover.de/download/dev_docs/code_conventions/trustHsHCodeconventions.xml</configLocation>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/templates/keystore</directory>
<targetPath>resources</targetPath>
</resource>
<resource>
<directory>src/main/templates/img</directory>
<targetPath>resources</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
<resources>
<resource>
Expand Down
23 changes: 9 additions & 14 deletions src/main/java/de/hshannover/f4/trust/irongui/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@
* #L%
*/



package de.hshannover.f4.trust.irongui;




import javax.swing.SwingUtilities;
import javax.swing.UIManager;

Expand All @@ -57,36 +52,36 @@
public class Client {

public static final String VERSION = "${project.version}";

private final ViewController mViewController;
private final IfmapFacade mIfmapFacade;

public Client() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.put("PopupMenu.consumeEventOnClose", Boolean.TRUE);
//UIManager.put("Button.showMnemonics", Boolean.TRUE);
// UIManager.put("Button.showMnemonics", Boolean.TRUE);
} catch (Throwable e) {
e.printStackTrace();
}
PropertiesRepository mPropertiesRep = new PropertiesRepository();
ConnectionRepository mConnectionRep = new ConnectionRepository();
PublisherRepository mPublisherRep = new PublisherRepository();
SynchronisationService mSyncService = new SynchronisationService(mPropertiesRep,
mConnectionRep, mPublisherRep);
SynchronisationService mSyncService = new SynchronisationService(
mPropertiesRep, mConnectionRep, mPublisherRep);
mSyncService.init();
mIfmapFacade = new IfmapFacade(mSyncService);
mViewController = new ViewController(mIfmapFacade);
mViewController = new ViewController(mIfmapFacade);
}
public void start(){

public void start() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
mViewController.showMainFrame();
}
});
}

public static void main(String[] args) {
Client client = new Client();
client.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@
* #L%
*/



package de.hshannover.f4.trust.irongui.communication;




import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -98,18 +93,18 @@ public String getEndpoint() {
}

public boolean isConnected() {
if (mIfmap != null && mIfmap.getSessionID() != null) {
if (mIfmap != null && mIfmap.getSessionId() != null) {
return true;
}
return false;
}

public String getPublisherID() {
return mIfmap.getPublisherID();
public String getPublisherId() {
return mIfmap.getPublisherId();
}

public String getSessionID() {
return mIfmap.getSessionID();
public String getSessionId() {
return mIfmap.getSessionId();
}

void setConnectionParameter(ConnectionParameter params) {
Expand All @@ -122,7 +117,7 @@ public ConnectionParameter getConnectionParameters() {

public void disconnect() throws IfmapErrorResult, IfmapException,
InterruptedException {
if (this.mIfmap != null) {
if (this.mIfmap != null) {
this.enableDumping(false);
this.enablePolling(false);
this.mIfmap.endSession();
Expand All @@ -147,8 +142,7 @@ public void connect() throws FileNotFoundException, IOException,
mParameter.getTruststore(), mParameter.getTruststorePass(),
mParameter.isBasicAuthEnabled(),
mParameter.getBasicauthUser(),
mParameter.getBasicauthPass(),
mParameter.getMaxPollSize());
mParameter.getBasicauthPass(), mParameter.getMaxPollSize());
}
mExecuterService = Executors.newCachedThreadPool();
mIfmap.newSession();
Expand Down Expand Up @@ -196,7 +190,7 @@ public void subscribeDelete(Set<String> keys) {
mSemaphore0.release();
}
}

public void enablePolling(boolean poll) {
if (poll) {
mPollThread = new Poller();
Expand All @@ -215,8 +209,8 @@ public void enableDumping(boolean dump) {
fDump = mExecuterService.submit(mDumpThread);
} else {
mDumpThread.mDone = true;
if (fDump != null) {
fDump.cancel(true);
if (fDump != null) {
fDump.cancel(true);
}
}
}
Expand All @@ -240,17 +234,20 @@ private ConnectionParameter cloneConnectionParameter(ConnectionParameter tmp) {

@Override
public boolean equals(Object o) {
if (o == null)
if (o == null) {
return false;
if (this == o)
}
if (this == o) {
return true;
if (!(o instanceof Connection))
}
if (!(o instanceof Connection)) {
return false;

}
if (this.hashCode() == o.hashCode()) {
return true;
} else
} else {
return false;
}
}

@Override
Expand All @@ -277,13 +274,13 @@ public Object call() throws Exception {
poll = IfmapMarshaller.filterPollResult(mSelf, poll);
IfmapFacade.notifyRepositoryChanged(mSelf, poll);
mSemaphore1.release();
} catch (Exception e) {
} catch (Exception e) {
mDone = true;
IfmapFacade.notifyConnectionBroken(mSelf, e);
mSemaphore1.release();
mSemaphore1.release();
}
}

mDone = true;
mSemaphore1.release();
return null;
Expand All @@ -301,7 +298,7 @@ private List<IdentifierData> transformResult(
Identifier ident = itr.next();
IdentifierData identData = new IdentifierData(ident);
String uuid = CryptoUtil
.generateMD5BySize(ident.toString(), 16);
.generateMd5BySize(ident.toString(), 16);
if (!SubscriptionRepository.getInstance().isAlreadySubscribed(
mSelf, identData)) {
identData.setSubscriptionName(uuid);
Expand Down Expand Up @@ -337,9 +334,9 @@ public Object call() throws Exception {
.addSubscription(mSelf, id);
cTemp.add(id.getRequestObject());
}
//List<String> uuids =
mIfmap.subscribeUpdate(
cTemp, 10, null, null, null, null);
// List<String> uuids =
mIfmap.subscribeUpdate(cTemp, 10, null, null,
null, null);
}
}
}
Expand All @@ -352,8 +349,8 @@ public Object call() throws Exception {
Thread.sleep(10000);
} catch (Exception e) {
e.printStackTrace();
System.err.println("Dump stopped (Exception occured)");
mSemaphore0.release();
System.err.println("Dump stopped (Exception occured)");
mSemaphore0.release();
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@
* #L%
*/



package de.hshannover.f4.trust.irongui.communication;




import de.hshannover.f4.trust.irongui.exception.ConnectionCreationException;

public class ConnectionFactory {
Expand All @@ -58,7 +53,8 @@ public static Connection createConnection(ConnectionParameter params)
params.getKeystorePass(), params.getTruststore(),
params.getTruststorePass(), params.isBasicAuthEnabled(),
params.getBasicauthUser(), params.getBasicauthPass(),
params.isDump(), params.isAutoConnect(), params.getMaxPollSize());
params.isDump(), params.isAutoConnect(),
params.getMaxPollSize());
return new Connection(tmp);
}

Expand Down
Loading

0 comments on commit 1eca250

Please sign in to comment.