System.setProperty("javax.net.ssl.trustStore", trustStorePath);
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
String log4jProperties = (String) properties.get("log4j.configuration");
String serverUrl = (String) properties.get("server.url");
Properties props = new Properties();
props.load(new FileInputStream( File.sep log4jProperties));
PropertyConfigurator.configure(props);
PolicyAssignmentTest.stub = new DataCentricServiceStub(ser
"/axis2/services/DataCentricService");
PolicyAssignmentTest.jobServiceStub = new JobServiceStub(ser
"/axis2/services/JobService");
/**
* Login to the system
*/
SystemServiceStub systemServiceStub = new SystemServiceStub(ser
"/axis2/services/SystemService");
LoginRequest loginRequest = new LoginRequest();
loginRequest.setUserName("super");
loginRequest.setDomainName("global");
loginRequest.setPassword("netscreen");
LoginResponseType loginResponse =
systemServiceStub.LoginRequest(loginRequest).getLoginResponse();
if ((LoginStatusCodeType.Success).equals(loginResponse.getLoginStatus().
getStatus())) {
PolicyAssignmentTest.authToken = loginResponse.getAuthToken();
}
PolicyAssignmentTest.setUpDone = true;
}
Logout
This API sample code shows how to log out from the NSM server.
public void testLogout() {
try {
LogoutRequest logoutRequest = new LogoutRequest();
logoutRequest.setAuthToken(authToken);
System.out.println("\nAuthToken: " + authToken.getToken() + " logging out
...");
stub.LogoutRequest(logoutRequest);
} catch (Exception e) {
e.printStackTrace();
}
}
Copyright © 2010, Juniper Networks, Inc.
96
Network and Security Manager 2010.4 API Guide
Summary of Contents for NETWORK AND SECURITY MANAGER 2010.4 - API GUIDE REV 1
Page 6: ...Copyright 2010 Juniper Networks Inc vi...
Page 10: ...Copyright 2010 Juniper Networks Inc x Network and Security Manager 2010 4 API Guide...
Page 12: ...Copyright 2010 Juniper Networks Inc xii Network and Security Manager 2010 4 API Guide...
Page 20: ...Copyright 2010 Juniper Networks Inc 2 Network and Security Manager 2010 4 API Guide...
Page 24: ...Copyright 2010 Juniper Networks Inc 6 Network and Security Manager 2010 4 API Guide...
Page 34: ...Copyright 2010 Juniper Networks Inc 16 Network and Security Manager 2010 4 API Guide...
Page 92: ...Copyright 2010 Juniper Networks Inc 74 Network and Security Manager 2010 4 API Guide...
Page 98: ...Copyright 2010 Juniper Networks Inc 80 Network and Security Manager 2010 4 API Guide...
Page 100: ...Copyright 2010 Juniper Networks Inc 82 Network and Security Manager 2010 4 API Guide...
Page 112: ...Copyright 2010 Juniper Networks Inc 94 Network and Security Manager 2010 4 API Guide...
Page 128: ...Copyright 2010 Juniper Networks Inc 110 Network and Security Manager 2010 4 API Guide...
Page 138: ...Copyright 2010 Juniper Networks Inc 120 Network and Security Manager 2010 4 API Guide...
Page 152: ...Copyright 2010 Juniper Networks Inc 134 Network and Security Manager 2010 4 API Guide...
Page 165: ...PART 6 Index Index on page 149 147 Copyright 2010 Juniper Networks Inc...
Page 166: ...Copyright 2010 Juniper Networks Inc 148 Network and Security Manager 2010 4 API Guide...