Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation, maven settings sample file and fix build CS and SB errors #6

Open
wants to merge 8 commits into
base: stable/aluminium
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

* build artifacts
```
mvn clean install -DskipTests
mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true -Dodlparent.spotbugs.skip -Dodlparent.checkstyle.skip
```
* build docker image
```
mvn clean install -f distribution/odltrpce-alpine-standalone
mvn clean install -s tests/odl_settings.xml -f distribution/odltrpce-alpine-standalone
```

This creates a docker image 'odl/transportpce' with the latest tag.
Expand Down
3 changes: 0 additions & 3 deletions odl-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<properties>
<transportpce.groupId>org.opendaylight.transportpce</transportpce.groupId>
<transportpce.version>${project.version}</transportpce.version>
<checkstyle.skip>true</checkstyle.skip>
<skip.checkstyle>true</skip.checkstyle>
<odlparent.spotbugs.enforce>false</odlparent.spotbugs.enforce>
<ccsdk.features.version>1.2.0-SNAPSHOT</ccsdk.features.version>
</properties>
<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,23 @@ public void onMessageReceived(String msg) {

@Override
public void onError(Throwable cause) {
LOG.error("ws connection error: {}",cause.getMessage());

LOG.error("ws connection error: {}", cause.getMessage());
}

@Override
public void onDisconnect(int statusCode, String reason) {
LOG.warn("ws connection to sdnr broken: {} {}", statusCode, reason);
if(OpendaylightClient.this.statusServlet!=null) {
if (OpendaylightClient.this.statusServlet != null) {
OpendaylightClient.this.statusServlet.setWebsocketStatus("disconnected");
}

}

@Override
public void onConnect(Session lsession) {
LOG.info("ws connection to sdnr established");
if(OpendaylightClient.this.statusServlet!=null) {
if (OpendaylightClient.this.statusServlet != null) {
OpendaylightClient.this.statusServlet.setWebsocketStatus("connected");
}

}

/**
Expand All @@ -109,7 +106,6 @@ public void onNotificationReceived(NotificationInput<?> notification) {
else {
LOG.debug("up to now not handled");
}

}
};

Expand All @@ -131,18 +127,16 @@ public OpendaylightClient() throws Exception {
this.config.getAuthenticationMethod(), this.config.getCredentialUsername(),
this.config.getCredentialPassword());
this.wsClient = this.config.getWebsocketUrl() == null ? null
: new SdnrWebsocketClient(this.config.getWebsocketUrl(), this.wsCallback, this.config.trustAllCerts());
: new SdnrWebsocketClient(this.config.getWebsocketUrl(), this.wsCallback, this.config.trustAllCerts());
if (this.wsClient != null) {
LOG.info("starting wsclient");
this.wsClient.start();

}
this.dataBroker = new RemoteDataBroker(this.restClient);
} else {
this.restClient = null;
this.dataBroker = null;
this.wsClient = null;

}
this.dataTreeChangeProvider = new RemoteDataTreeChangeProvider<>(this.restClient);
this.deviceConnectionChangeProvider = new RemoteDeviceConnectionChangeProvider(this.restClient);
Expand All @@ -158,7 +152,6 @@ public OpendaylightClient(String baseUrl, @Nullable String wsUrl, AuthMethod aut
if (this.wsClient != null) {
LOG.info("starting wsclient");
this.wsClient.start();

}
this.dataBroker = new RemoteDataBroker(this.restClient);
this.dataTreeChangeProvider = new RemoteDataTreeChangeProvider<>(this.restClient);
Expand Down Expand Up @@ -194,6 +187,7 @@ public boolean isDevicePresent(String nodeId) {
}
return false;
}

@Override
public boolean isDeviceMounted(String nodeId) {

Expand All @@ -210,6 +204,7 @@ public boolean isDeviceMounted(String nodeId) {
}
return false;
}

@Override
public DataBroker getRemoteDeviceDataBroker(String nodeId) {
DataBroker broker = this.deviceDataBrokers.get(nodeId);
Expand All @@ -227,12 +222,11 @@ public DataBroker getRemoteDataBroker() {

@Override
public MountPoint getMountPoint(String deviceId) {
if(this.isDeviceMounted(deviceId)) {
return new RemoteMountPoint(this.restClient, this.wsClient, deviceId);
}
else {
return null;
}
if (this.isDeviceMounted(deviceId)) {
return new RemoteMountPoint(this.restClient, this.wsClient, deviceId);
} else {
return null;
}
}

@Override
Expand All @@ -258,7 +252,8 @@ public void unregisterDeviceConnectionChangeListener(DeviceConnectionChangedHand

@Override
public <T extends DataObject> Optional<T> getDataFromDevice(String nodeId, LogicalDatastoreType datastore,
InstanceIdentifier<T> xciid, long deviceReadTimeout, TimeUnit deviceReadTimeoutUnit) throws InterruptedException, TimeoutException, ExecutionException {
InstanceIdentifier<T> xciid, long deviceReadTimeout, TimeUnit deviceReadTimeoutUnit)
throws InterruptedException, TimeoutException, ExecutionException {
DataBroker db = this.getRemoteDeviceDataBroker(nodeId);
return db.newReadOnlyTransaction().read(datastore, xciid).get(deviceReadTimeout, deviceReadTimeoutUnit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class RemoteOdlConfig {
public static final String KEY_PASSWORD = "password";
public static final String KEY_ENABLED = "enabled";
public static final String KEY_TRUSTALL = "trustall";


private static final String DEFAULT_BASEURL = "http://sdnr:8181";
private static final String DEFAULT_WSURL = "ws://sdnr:8181/websocket";
Expand All @@ -51,7 +50,6 @@ public class RemoteOdlConfig {
private final String password;
private final boolean trustall;
private final boolean enabled;


public RemoteOdlConfig() {
this(FILENAME);
Expand Down Expand Up @@ -135,7 +133,7 @@ private static String getProperty(final Properties prop, final String key, final

LOG.debug("try to find env var(s) for {}", value);
final Matcher matcher = PATTERN.matcher(value);
String tmp = new String(value);
String tmp = value;
while (matcher.find() && matcher.groupCount() > 0) {
final String mkey = matcher.group(1);
if (mkey != null) {
Expand All @@ -144,7 +142,7 @@ private static String getProperty(final Properties prop, final String key, final
String env = System.getenv(mkey.substring(2, mkey.length() - 1));
tmp = tmp.replace(mkey, env == null ? "" : env);
} catch (SecurityException e) {
LOG.warn("unable to read env {}: {}", value, e);
LOG.warn("unable to read env {}: ", value, e);
}
}
}
Expand Down
Loading