on 11-24-2008 9:28 AM
Hi,
Is there a way to retrieve the status of MDM Port using Java API? I could find only the possible values for a port but not to retrieve the status for a port.
Any help is appreciated.
Regards,
Dev.
Hi barathi,
I guess your requirement is to find status of perticular repository which is bound for particular port;
There is no provision to know port status in MDM JAVA API directly;
instead , since every port is bound to one Repository , you can look for Repository status; ( every repository will have its own and unique Port number)
the following code may help you , how to get the status
GetRepositoryStatusCommand command;
try {
command = new GetRepositoryStatusCommand ( get connection here ); // need to get rep connection
command.setSession(get autunticated user session ); // get Authenticated user session here
command.execute();
System.out.println (" Rep/Port Status Description = " +repStatus.getDescription() ) ;
System.out.println (" Rep/Port Status = " +repStatus.getStatus() ) ;
} catch (ConnectionException e) {
e.printStackTrace();
} catch (CommandException e) {
e.printStackTrace();
}
}
Note : - the above code is to give an Idea how to get the status ;
the method repStatus.getStatus() will return one of the following status codes;
static int DELETED
DELETED indicates the repository was deleted.
static int INVALID
INVALID indicates the repository in a invalid state.
static int LOADING
LOADING indicates the repository is in the process of loading.
static int MODIFYING
MODIFYING indicates the repository being modified.
static int NEWER
NEW indicates the repository newer than the current version of the server.
static int OLDER
OLDER indicates the repository is out of date.
static int PRELOADED
PRELOAD indicates the repository was preloaded.
static int RUNNING
RUNNING indicates the repository loaded.
static int STOPPED
STOPPED indicates the repository is not loaded.
if you need furthur help , please let me know;
Rajasekhar K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Barati,
I understand now that you are looking for the Port Status related to InBound & OutBound Ports ( Import&Syndication);
I think you need to deal some thing as follows;
1- implement com.sap.mdm.notification.RepositoryListener
2- importProcessed(ImportEvent event) method should be able to help; // This method will be Triggered when ever Event is changed
3- using ImportEvent object , you can check for the status using the folowing boolean methods
boolean isPortBlocked()
Indicate if the port is blocked
boolean isPortHasException()
Indicate if the port has files in Exception directory
boolean isPortHasReady()
Indicate if the port has files in Ready directory
boolean isPortLocked()
Indicate if the port is locked
As I didt work on this scenario , I dont have exact code with me;
I hope the above approach should solve the case;
once you are done with the case , could you please let me know?
Thanks
Rajasekhar K
User | Count |
---|---|
70 | |
26 | |
9 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.