Using the ITimebasedPublishEvent.EVENT_TYPE_STOP for a repository service

Hi Expert,
corresponding the the thread "https://forums.sdn.sap.com/thread.jspa?threadID=789842&tstart=0" I want to implement a repository service, which started when the validto date in the lifetime properiy is exceeded.
For this case I inserted in the method "received" an If-Clausel which should catch this event, like this:
public void received(IEvent event) {
     IResourceEvent myEvent = (IResourceEvent) event;
     IResource res = myEvent.getResource();
     if (event.getType() == ITimebasedPublishEvent.EVENT_TYPE_STOP ) {
Do I have to change something in the "addRepositoryAssignment" and/or "removeRepositoryAssignment"? Or in general?
Thanks in Advanced!
Best regards and a nice WE!
Markus

Hi Praveen,
you are right. I found an event "EVENT_TYPE_STOP_TEMPLATE" in the "TimebasedPublishEvent" class, which solve my syntax error.
Now, I have the problem that the service is never running. From the coding perspective it looks right now ok for me.
Do you have to make same changes in the settings samewhere?
Any ideas?
Best regards,
Markus
My Coding for the repository service looks like this right now:
public class DeleteFile extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver {
  private static final String TYPE = "ACC_DeleteFile";
  private Collection repositoryManagers;
  public DeleteFile() {
     super();
     // Do not add code here. Add it to startUpImpl() instead
  public String getServiceType() {
     return DeleteFile.TYPE;
  protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
     // implement this method as follows:
     // - Verify configuration data
     // - Get references to other needed (global) services
     // - Check whether other repository services (this service depends on) are also assigned to the repository managers
     // - Usually the service registers itself for certain events at all repository managers
     this.repositoryManagers = repositoryManagers;
     Iterator it = repositoryManagers.iterator();
     while (it.hasNext()) {
          try {
               addRepositoryAssignment((IRepositoryManager) it.next());
          } catch (ServiceNotAvailableException e) {
               throw new StartupException(e.getMessage(), e);
  protected void shutDownImpl() {
     Iterator it = repositoryManagers.iterator();
       while (it.hasNext()) {
            try {
                 removeRepositoryAssignment((IRepositoryManager) it.next());
            } catch (WcmException e) {
                 e.printStackTrace();
  protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
     // Implement this method: Usually the service registers itself for certain events at the repository manager.
     try {
          mgr.getEventBroker().register( this, TimebasedPublishEvent.EVENT_TYPE_STOP_TEMPLATE);
     } catch (Exception e) {
          e.printStackTrace();
  protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException {
     // Implement this method: Usually the service must unregister itself as an event handler.
     mgr.getEventBroker().unregister( this, TimebasedPublishEvent.EVENT_TYPE_STOP_TEMPLATE);
  public void reconfigure(IConfiguration config) throws ConfigurationException {
     this.stateHandler.preReconfigure();
     // check the new configuration data
     try {
     catch (ConfigurationException ex) {
       this.stateHandler.postReconfigure(ex);
       throw ex;
     this.config = config;
     this.stateHandler.postReconfigure();
  public void received(IEvent event) {
     com.sapportals.portal.prt.logger.ILogger logger = com.sapportals.portal.prt.runtime.PortalRuntime.getLogger();
     logger.severe(TYPE, "Start ACCDeleteFile");
     IResourceEvent myEvent = (IResourceEvent) event;
     IResource res = myEvent.getResource();
     if (event.getType() == ITimebasedPublishEvent.EVENT_TYPE_STOP ) {
          try {                    
               IRepositoryServiceFactory repServiceFactory = ResourceFactory.getInstance().getServiceFactory();
               IRepositoryService repositoryService =      repServiceFactory.getRepositoryService( res, IWcmConst.TIMEBASED_PUBLISH_SERVICE);
               ITimebasedPublishServiceManager tpbService = (ITimebasedPublishServiceManager) repositoryService;
               Date actualDate = new Date();
               Date validTo = new Date();
               validTo = tpbService.readInvalidDate(res);
               if(actualDate.getTime() < validTo.getTime()){
                    res.delete();               
          } catch (Exception e) {
               e.printStackTrace();
     logger.severe(TYPE, "End ACCDeleteFile");

Similar Messages

  • We are using the Azure server for our web services. Server is generating an error "Unable to connect to the remote server". What is this error means

    We are using the Azure server for our web services. Server is generating an error "Unable to connect to the remote server". What is this error means  

    Hello,
    Did you means that you use the Windows Azure Virtual Machine DNS name as the server name in the Reporting Server Web Services URL?
    For example:
    Report server:http://uebi.cloudapp.net/reportserver
    Report manager:http://uebi.cloudapp.net/reports
    If you want to connect to Report Manager on the virtual machine from a remote computer, you should create a  virtual machine TCP Endpoint and open the port in the virtual machine’s firewall. By default, the report server listens for HTTP requests
    on port 80.
    Reference:http://msdn.microsoft.com/en-us/library/jj992719.aspx#bkmk_ssrs_connect_2_remote_RM
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • How to update an existing item in a sharepoint list using the WSS adapter for Biztalk

    Is there a way that a record in SP list be updated using WSS adapter in biztalk ?
    BizTalk 2013 and SP 2013 ..
    Regards
    Ritu Raj
    When you see answers and helpful posts,
    please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • How to use the same element in different Web-Services?

    I have defined a web-services in two WSDL files.
    I want to use the same type in this two services. Because if one service call the other one, it could pass the class it just got. Otherwise, the classes can't be casted.
    Web-Service1:
    public com.package1.State inputValue (com.package1.State state) {
    return state;
    Web-Service2:
    public com.package2.State inputValue (com.package2.State state) {
    return state;
    }And now, If I call from the Service2, the Service1 and put
    Service1.inputValue(com.package2.State state) ;
    I can't do this, can't cast and so on. But I want my tool WSDL2Java, will create the same State.class for two Web-Services, like:
    Web-Service1:
    public com.package3.State inputValue (com.package3.State state) {
    return state;
    Web-Service2:
    public com.package3.State inputValue (com.package3.State state) {
    return state;
    }Is it possible? How to define it in wsdl?
    Thanks in advance.

    You can certainly do this in WSDL, simply put your
    common element in a schema file and "include" it into
    each of your WSDL files. Obviously your element will
    have to use the same namespace in all places.
    I'm not sure whether wsdl2java can cope with
    "include" statements in WSDL. I know plenty of other
    similar tools, e.g. Axis and .Net tools, didn't
    support this however they may have moved on since I
    used them.
    To get around this you have to "manually" include the
    schema in each wsdl for code generation purposes.Thanks for the answer. I did as you said and it works fine.

  • I have an apple ID which I use to sign into icloud for my iPad and iPhone.But when I use the same ID for setting up iCloud on my Macbook it says INCORRECT ID or password, try again. I tried changing my passwords but it does not work for the macbook.

    I have an apple ID which I use to sign into icloud for my iPad and iPhone.But when I use the same ID for setting up iCloud on my Macbook it says INCORRECT ID or password, try again. I tried changing my passwords several times but it does not work for the macbook.

    You will have to provide the correct password to delete the existing account, if you have tried but are not getting the password reset email, contact Apple for assistance by going to https://expresslane.apple.com, then click More Products and Services>Apple ID>Other Apple ID Topics>Lost or forgotten Apple ID password.

  • My iPod won't charge on a wall charger, only on the computer. I used the same cord for both though. I used to be able to charge it with a wall charger, but now suddenly I can't. I've even used other wall pieces. Nothing seems to work.

    My iPod will no longer charge with a wall charger, only the computer. I know it's not becuase of the wall piece or my cord, since I also use the same cord for computer charging, and the wall piece seems to work with others devices. It worked a couple of weeks ago, then suddenly quit. I think it may be something to do with the inside of my iPod where the charger goes. I find it really inconvient to always have to use the computer to charge my iPod. I believe I have a three year warrenty on my iPod, but I wouldn't think it would cover this problem. Is there anything I can do to fix it?

    Not Charge
    - See:    
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store. Bring the wall charger
      Apple Retail Store - Genius Bar
    If you have a three-year warrany it is not from Apple. The standare Apple warrantyis 1 year and y can purchas an extended warranty that give y a total of two years. You can check your Apple warranty coverage hee:
    Check Your Service and Support Coverage

  • HT3702 My Master card card was rejected in the US store, it was issued in Jordan from Jordan Ahli Bank! However, it is accepted in the Jordanian store, any reason why? and what should i do to get to use the US store for future purchases?

    My Master card card was rejected in the US store, it was issued in Jordan from Jordan Ahli Bank! However, it is accepted in the Jordanian store, any reason why? and what should i do to get to use the US store for future purchases?

    Because they are the terms of use of the stores - terms from the US store :
    The iTunes Service is available to you only in the United States, its territories, and possessions. You agree not to use or attempt to use the iTunes Service from outside these locations. Apple may use technologies to verify your compliance.
    And similar terms apply to all other country's iTunes stores. Part of the reason is licensing (Apple can only sell content where the providers have granted them licenses to sell it), amd part might be due country's laws (some country's have restrictions as to what can be sold within their country). If there is content that you want that is not currently in the Jordanian store then you can try requesting that it be added (but the content providers might not let Apple sell it there) : http://www.apple.com/feedback/itunes.html

  • Problems using the Java API inside a Web Service

    Hi,
    after I've built a standalone Java RMI client, using the API, I wanted to use the same code in a Web Service I've built and deployed in tomcat (jwsdp-1.3). But i ran into a few problems..
    - although I have the exact same code in both programs, the one in the web service simply blocks when I initiate the Locator class (see above...);
    - all the .jar's that I use in the client are deployed in the WEB-IF/lib of the web service directory on tomcat;
    - no exceptions are thrown in tomcat, so i don't know what's going on;
    Is there any specific configuration for the API to run on tomcat?
    Could it be that the .jar's needed by the Locator class may have some kind of conflict with the ones in tomcat?
    Thanks...
    Note: The code on the client is totaly stable and fully operational.
    The web service uses java.rmi.Remote (extends Remote).
    Here's part of the code:
    Properties env = new Properties();
    env.setProperty("orabpel.platform", "oc4j_10g");
    env.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
    env.setProperty("java.naming.provider.url","ormi://dellpc05/orabpel");
    env.setProperty("java.naming.security.principal","admin");
    env.setProperty("java.naming.security.credentials","welcome");
    Locator locator = new Locator("default", "bpel", env);
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    (...)

    I've put a
    try{Locator...}
    }catch(Throwable t) {
    System.out.println(t.getMessage());
    t.printStackTrace();
    around the Locator..
    I still don't know why it's throwing this...
    Here's what it gets:
    before Locator
    javax/jms/JMSException
    java.lang.NoClassDefFoundError: javax/jms/JMSException
         at com.evermind.server.ThreadState.getCurrentState(ThreadState.java:206)
         at com.evermind.server.rmi.RMIConnection.checkServletCaller(RMIConnection.java:3448)
         at com.evermind.server.rmi.RMIConnection.<init>(RMIConnection.java:181)
         at com.evermind.server.rmi.RMIServer.addNode(RMIServer.java:856)
         at com.evermind.server.rmi.RMIServer.getConnection(RMIServer.java:953)
         at com.evermind.server.rmi.RMIInitialContextFactory.getInitialContext(RMIInitialContextFactory.java:309)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.<init>(InitialContext.java:195)
         at com.collaxa.cube.util.CXBeanRegistry.lookupDomainManagerBean(CXBeanRegistry.java:205)
         at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:84)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:120)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:91)
         at dmc.tm.resultprovider.ResultProviderImpl$ResultProviderThread.taskTimeoutExceeded(ResultProviderImpl.java:231)
         at dmc.tm.resultprovider.ResultProviderImpl$ResultProviderThread.run(ResultProviderImpl.java:160)

  • Why won't my camera work? I used the screen shot for the first time and since i did that every time i take a picture the shutter closes as though it's taking it but no picture gets taken...help! Any suggestions?

    Why won't my camera work? I used the screen shot for the first time and since i did that every time i take a picture the shutter closes as though it's taking it but no picture gets taken...help! Any suggestions?

    Hey briannagrace96,
    Welcome to Apple Support Communities! I'd check out the following article, it looks like it applies to your situation:
    iPod: Appears in Windows but not in iTunes
    http://support.apple.com/kb/ts1363
    You'll want to go through the following troubleshooting steps, and for more detail on each step follow the link to the article above:
    Try the iPod troubleshooting assistant:
    If you have not already done so, try the steps in the iPod Troubleshooting Assistant (choose your iPod model from the list).
    If the issue remains after following your iPod's troubleshooting assistant, follow the steps below to continue troubleshooting your issue.
    Restart the iPod Service
    Restart the Apple Mobile Device Service
    Empty your Temp directory and restart
    Verify that the Apple Mobile Device USB Driver is installed
    Change your iPod's drive letter
    Remove and reinstall iTunes
    Disable conflicting System Services and Startup Items
    Update, Reconfigure, Disable, or Remove Security Software
    Deleting damaged or incorrect registry keys
    Take care,
    David

  • How do I change the icloud account on my iphone? I want to use the same account for all my apple devices (macbook air and imac and iphone). I can't see where I can amend the iphone account because it is in grey?

    I want to use the same account for all my apple devices (macbook air, imac and iphone). I can't see how I can amend the iphone account because it is in grey? I also can't remember the password for this account so i can't even delete it and start again?
    Help!
    Thanks

    Deleting an iCloud account only deletes it from the Device, not from iCloud.  In iOS 8, the name of this setting changed to "Sign Out" as that is a better reflection of what actually happens.  Your iCloud data remains on the server, available to devices still signed into the account, but the device you sign out of the account on is disconnected from the account, and as a result, the iCloud data from that account is removed from the device.  It will redownload to the device should you sign back into the account.
    The only issue you'll run into when you switch between accounts is with my photo stream photos older than 30 days.  When you delete (or sign out of) and account, your photo stream photos are deleted along with the other data from the account in question.  However, unlike other data which remains on the server and can redownload to your device when you sign back in, my photo stream photos only remain in iCloud for 30 days.  When you sign back in, you will only get back my photo stream photos added in the last 30 days (as older photos are no longer in iCloud to redownload).  Like other account data, any my photo stream photos on your other devices signed into the account are unaffected by this.  If you want to keep older my photo stream photos on your device as you change iCloud accounts, save them to your camera roll before deleting (signing out of) the account.

  • My external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive. Same thing has happened with Final Cut Express.

    My new LaCie external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive.
    The same thing happened recently between Final Cut Express and my other LaCie external hard drive used as the Scratch disk. It fixed itself.
    I've run out of ideas. Help would be very much appreciated. Thanks.

    have you done some searches on FCPx and time machine? Is there a known issue with using a TM drive with FCPx? dunno but ...wait...I'll take 60 sec for you cause I'm just that kind of guy....   google...." fcpx time machine problem"  Frist page link 
    http://www.premiumbeat.com/blog/fcpx-bug-best-practices-for-using-external-hard- drives-and-final-cut-pro-x/
           You cannot have time machine backups on your hard drive if you intend to use it in FCPX.
    booya!

  • Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? Difference between Enterprise and SE?

    We’re seeing the following issue: sql - Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? - Stack Overflow (posted by a colleague of mine) and are curious to know if this behaviour is due to a difference between standard and enterprise, or could we doing something else wrong in our DB config.?
    We have also reproduced the issue on the following stacks:
    Oracle SE One 11.2.0.3 (with Spatial enabled)
    Redhat Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    11.2.0.3.0 Standard Edition and 11.2.0.4.0 Standard Edition (both with Spatial enabled)
    Microsoft Windows Server 2003R2 Standard x64 Edition
    However, the SQL works fine if we try it on Oracle 11.2.0.3.0 *Enterprise* Edition.
    Any help or advice would be much appreciated.
    Kindest Regards,
    Kevin

    In my experience sdo_filter ALWAYS uses the spatial index, so that's not the problem. Since you did not provide the explain plans, we can't say for sure but I think yhu is right: Standard Edition can't use the bitmap operations, and thus it'll take longer to combine the results of the two queries (because the optimizer will surely split this OR up in two parts, then combine them).
    BTW: when asking questions about queries here, it would be nice if you posted the queries here as well, so that we do not have to check another website in order to see what you are doing. Plus it will probably get you more answers, because not everyone can be bothered to click on that link. It would also have been nice if you had posted your own answer on the other post here as well, because my recommendation would have been to use union all - but since you already found that out for yourself my recommendation would have been a little late.

  • I have the G Drive 1 TB (GEN4 1TB) external drive purchased in 2010. I need to connect to my new MacBook Pro. I'm using the external drive for media storage of my video editing projects. Will a 800fw to thunderbolt adapter cable work?

    I have the G Drive 1 TB (GEN4 1TB) external drive purchased in 2010. I need to connect to my new MacBook Pro. I'm using the external drive for media storage of my video editing projects. Will a 800fw to thunderbolt adapter cable work? I understand that using a USB port connection is not fast enough for video editing. I read somewhere the G Drives don't connect well to MacBook Pro.
    thanks
    larry

    I doubt this can be relocated or moved so you might want to just repost in the macbook pro area.
      MacBook Pro
    https://discussions.apple.com/community/notebooks/macbook_pro
    https://discussions.apple.com/community/mac_os?view=discussions
    Can you afford a new Thunderbolt case and cable? any case with FW800 is going to be slow 72MB/sec and less, and any new 1TB drive is capable of 75MB/s minimum up to 125MB/sec.
    Thunderbolt storage can of course when setup properly reach 100's of MB higher using multiple drives.
    Use what you have for a system backup or for secondary backup storage.
    you might be able to take the drive - most cases allow you to open and swap drives - and use this:
    G-Technology 1TB G-DRIVE mini High-Speed Portable Hard Drive                                   
    or this:
    http://store.apple.com/us/product/HB137VC/A/g-technology-4tb-g-raid-professional -high-performance-dual-drive-hard-drive?fnode=5f

  • I have used the same laptop for all three of my iPhones but awhile back this laptop had a virus so my husband wiped it out and now when I sync my iPhone I no longer get my entire music library ( including purchased songs) on my iPhone. How do I fix this?

    I have always used the same laptop for all of my iPhones but awhile back this laptop had a virus so my husband wiped out the laptop and now when I sync my iPhone I no longer receive my entire music library (including purchased songs) on my iPhone. How do I fix this?

    kimberlyfromtopeka wrote:
    Ok,thanks but, I should be able to something so that I am able to sync the entire library again not just the purchased songs.
    If the non purchased music is not on your computer, how can it Sync to your iPhone...

  • HT204074 How do I use 2 apple id's on one mac?  I have my apple id on my mac and would like to use the same mac for my wife's phone and ipad?

    How do I use 2 apple id's on one mac?  I have my apple id on my mac and would like to use the same mac for my wife's phone and ipad?

    Correction, thats two itune id's

Maybe you are looking for

  • How to get the alert context from scom event into incident description?

    Hello, I user SCO for creating incidents of SCOM events. My problem ist that in some events the most interesting information is standing in AlertContext. But I cannot add this text to the descritipn field of our incident tool. If I user the published

  • "Unknown error : Support information ; Security Code - 359"

    I've got a user who is attempting to input his digital signature however upon doing so he receives the error message "Unknown error : Support information ; Security Code - 359" Does any one eccountered this problem and knows how to fix it?

  • Web Dispatcher is not started

    I have installed SAP web Dispatcher successfully. I found following error message in dev_webdisp file, I check profile it has Message server ( java CI instance) host name and message server HTTP port (50100). I am not sure about this parameter ms/htt

  • PS CC won't save a custom workspace.

    PS CC won't save a custom workspace. Nothing happens. In addition, I get a "Can't apply workspace because of a system error" when i try to view the What's New workspace. Just downloaded the CC today. Mac 10.7.5, 3.4 GHz processor, 16GB RAM. Thanks fo

  • Logic keeps crashing after 9.1.5 update

    Hello everyone! Logic keeps crashing after ive updated to 9.1.5 on Lion. I couldnt find the PriviteFrameworks folder, so I just tried the ProKit update, but it says Im running a new version. Heres the crash info Process:         Logic Pro [864] Path: