com.secpod.action
Class ClientAction

java.lang.Object
  extended by com.secpod.action.ClientAction

public class ClientAction
extends java.lang.Object

This class in an interface to the client for SCAPRepository Web Service


Nested Class Summary
 class ClientAction.InstallCert
          This class is a Certificate Installer
static class ClientAction.MyHostnameVerifier
          This class is a Host Name Verifier
 
Constructor Summary
ClientAction()
           
 
Method Summary
 void connect(java.lang.String urlStr, java.lang.String password)
          This function is used to connect to Web Service.
 void getBundle(java.lang.String sessionId, java.lang.String id, java.lang.String urlStr)
          This function is used to get the bundle zip of all related content for a particular Id.
 void getDatastream(java.lang.String sessionId, java.lang.String id, java.lang.String urlStr)
          This function is used to get the data stream for a particular XCCDF Id.
 void getPolicy(java.lang.String sessionId, java.lang.String urlStr)
          This function is used to display policies of a user.
 void getPolicycontent(java.lang.String sessionId, java.lang.String policy, java.lang.String urlStr)
          This function is used to get content for a particular policy of a user.
 void getrss(java.lang.String type, java.lang.String urlStr)
          This function is used to get the RSS Feed.
 void getXML(java.lang.String sessionId, java.lang.String id, java.lang.String urlStr)
          This function is used to get the XML content for a particular Id.
 void login(java.lang.String username, java.lang.String password, java.lang.String urlStr)
          This function is used to login to Web Service.
 void logout(java.lang.String sessionId, java.lang.String urlStr)
          This function is used to logout a user.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientAction

public ClientAction()
Method Detail

connect

public void connect(java.lang.String urlStr,
                    java.lang.String password)
This function is used to connect to Web Service.

Parameters:
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository
password - The password to key store file, default is "changeit". This password is used to call trustCert function

login

public void login(java.lang.String username,
                  java.lang.String password,
                  java.lang.String urlStr)
This function is used to login to Web Service.

Parameters:
username - Username of the user
password - Password of the user
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository

logout

public void logout(java.lang.String sessionId,
                   java.lang.String urlStr)
This function is used to logout a user.

Parameters:
sessionId - The session Id of the user provided during login.
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository

getXML

public void getXML(java.lang.String sessionId,
                   java.lang.String id,
                   java.lang.String urlStr)
This function is used to get the XML content for a particular Id. The XML is written to a file and stored in current directory.

Parameters:
sessionId - The session Id of the user provided during login. This is not required for free content. If not provided, considered null.
id - The content Id
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository

getDatastream

public void getDatastream(java.lang.String sessionId,
                          java.lang.String id,
                          java.lang.String urlStr)
This function is used to get the data stream for a particular XCCDF Id. The XML is written to a file and stored in current directory.

Parameters:
sessionId - The session Id of the user provided during login. It is mandatory.
id - The content Id
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository

getBundle

public void getBundle(java.lang.String sessionId,
                      java.lang.String id,
                      java.lang.String urlStr)
This function is used to get the bundle zip of all related content for a particular Id. The zip is stored in the current directory.

Parameters:
sessionId - The session Id of the user provided during login. This is not required for free content. If not provided, considered null.
id - The content Id
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository

getPolicy

public void getPolicy(java.lang.String sessionId,
                      java.lang.String urlStr)
This function is used to display policies of a user.

Parameters:
sessionId - The session Id of the user provided during login. It is mandatory.
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository

getPolicycontent

public void getPolicycontent(java.lang.String sessionId,
                             java.lang.String policy,
                             java.lang.String urlStr)
This function is used to get content for a particular policy of a user. The content is stored in the current directory.

Parameters:
sessionId - The session Id of the user provided during login. It is mandatory.
policy - The policy for which content needs to be downloaded
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository

getrss

public void getrss(java.lang.String type,
                   java.lang.String urlStr)
This function is used to get the RSS Feed. The XML is stored in the current directory.

Parameters:
type - This can be oval, cve, cwe, cpe, xccdf or cce
urlStr - The URL link to the Web Service (In the form repo-ip/SCAPRepoWebService, where repo-ip is the IP to the repository