Examples of Registration


Examples of org.cipango.kaleo.location.event.RegistrationDocument.Registration

    super(uri);
    _content = ReginfoDocument.Factory.newInstance();
    Reginfo reginfo = _content.addNewReginfo();
    reginfo.setVersion(BigInteger.ZERO);
    reginfo.setState(org.cipango.kaleo.location.event.ReginfoDocument.Reginfo.State.FULL);
    Registration reg = reginfo.addNewRegistration();
    reg.setAor(uri);
    reg.setId("123");
    if (registration != null && !registration.getBindings().isEmpty())
    {
      reg.setState(org.cipango.kaleo.location.event.RegistrationDocument.Registration.State.ACTIVE);
      for (Binding binding : registration.getBindings())
      {
        Contact contact = reg.addNewContact();
        contact.setUri(binding.getContact().toString());
        contact.setEvent(Event.REGISTERED);
        contact.setId(String.valueOf(binding.getId()));
        contact.setCallid(binding.getCallId());
        contact.setCseq(BigInteger.valueOf(binding.getCSeq()));
        contact.setExpires(BigInteger.valueOf(binding.getExpires()));
      }
    }
    else
      reg.setState(org.cipango.kaleo.location.event.RegistrationDocument.Registration.State.INIT);
   
    _state = new State(RegEventPackage.REGINFO, _content);
  }
View Full Code Here

Examples of org.cipango.kaleo.location.event.RegistrationDocument.Registration

  public void bindingChanged(String aor, Binding binding, Event.Enum event,
      org.cipango.kaleo.location.event.RegistrationDocument.Registration.State.Enum state)
  {
   
    Contact contactModified = null;
    Registration registration = _content.getReginfo().getRegistrationArray(0);
    registration.setState(state);
    for (Contact contact : registration.getContactArray())
    {
      if (contact.getId().equals(String.valueOf(binding.getId())))
      {
        contactModified = contact;
      }
    }
    if (contactModified == null)
    {
      contactModified = registration.addNewContact();
    }
    contactModified.setUri(binding.getContact().toString());
    contactModified.setEvent(event);
    contactModified.setId(String.valueOf(binding.getId()));
    contactModified.setCallid(binding.getCallId());
    contactModified.setCseq(BigInteger.valueOf(binding.getCSeq()));
    contactModified.setExpires(BigInteger.valueOf(binding.getExpires()));

    fireStateChanged();
   
   
    if (event == Event.DEACTIVATED || event == Event.EXPIRED
        || event == Event.UNREGISTERED || event == Event.REJECTED)
    {
      for (int i = 0; i < registration.getContactArray().length; i++)
      {
        if (registration.getContactArray(i) == contactModified)
        {
          registration.removeContact(i);
          break;
        }
      }
    }
  }
View Full Code Here

Examples of org.cipango.kaleo.location.event.RegistrationDocument.Registration

    }
  }

  public void allBindingsRemoved(String aor)
  {
    Registration registration = _content.getReginfo().getRegistrationArray(0);
    registration.setState(org.cipango.kaleo.location.event.RegistrationDocument.Registration.State.TERMINATED);
    for (Contact contact : registration.getContactArray())
    {
      contact.setEvent(Event.UNREGISTERED);
    }
    fireStateChanged();
     _content.getReginfo().setVersion(_content.getReginfo().getVersion().add(BigInteger.ONE));
    while(registration.getContactArray().length != 0)
    {
      registration.removeContact(0);
    }
  }
View Full Code Here

Examples of org.cipango.kaleo.location.event.RegistrationDocument.Registration

  {
    ReginfoDocument document = ReginfoDocument.Factory.newInstance();
    Reginfo reginfo = document.addNewReginfo();
    reginfo.setVersion(BigInteger.ZERO);
    reginfo.setState(org.cipango.kaleo.location.event.ReginfoDocument.Reginfo.State.FULL);
    Registration reg = reginfo.addNewRegistration();
    reg.setAor(getUri());
    reg.setId("123");
    return new State(RegEventPackage.REGINFO, document);
  }
View Full Code Here

Examples of org.fenixedu.academic.domain.student.Registration

        return (DocumentRequest) super.getDocumentRequest();
    }

    @Override
    protected String getDegreeDescription() {
        final Registration registration = getDocumentRequest().getRegistration();
        final DegreeType degreeType = registration.getDegreeType();
        final CycleType cycleType =
                degreeType.hasExactlyOneCycleType() ? degreeType.getCycleType() : registration.getCycleType(getExecutionYear());
        return registration.getDegreeDescription(getExecutionYear(), cycleType, getLocale());
    }
View Full Code Here

Examples of org.gatein.registration.Registration

   }

   @Override
   protected RegistrationSPI internalRemoveRegistration(String registrationId)
   {
      Registration registration = getRegistration(registrationId);
      remove(registration.getPersistentKey(), RegistrationMapping.class);

      return super.internalRemoveRegistration(registrationId);
   }
View Full Code Here

Examples of org.gatein.registration.Registration

      try
      {
         // if a RegistrationContext is provided, we need to validate the registration information
         RegistrationContext registrationContext = gs.getRegistrationContext();
         Registration registration = null;
         if (registrationContext != null)
         {
            registration = producer.getRegistrationOrFailIfInvalid(registrationContext);
            RegistrationLocal.setRegistration(registration);
         }
View Full Code Here

Examples of org.gatein.registration.Registration

      //TODO: this might be better to place somewhere else and use the RegistrationHandler.register instead of
      // doing basically the same thing below.
      Consumer unregConsumer = getConsumerByIdentity(NON_REGISTERED_CONSUMER);
      if (unregConsumer == null)
      {
         Registration registration = addRegistrationTo(NON_REGISTERED_CONSUMER, new HashMap<QName, Object>(), null, true);
         registration.setStatus(RegistrationStatus.VALID);
         getPersistenceManager().saveChangesTo(registration);
         return registration;
      }
      else
      {
         //The unregistered consumer should only ever have one registration, return that
         final Registration registration = unregConsumer.getRegistrations().iterator().next();

         // but first check that we don't have an improper persisted state due to GTNWSRP-283
         if (registration.getRegistrationHandle() == null || RegistrationStatus.PENDING == registration.getStatus())
         {
            // if we have improper persisted state, correct it
            createAndSetRegistrationHandle((RegistrationSPI)registration);
            registration.setStatus(RegistrationStatus.VALID);
            getPersistenceManager().saveChangesTo(registration);
         }
         return registration;
      }
   }
View Full Code Here

Examples of org.gatein.registration.Registration

      }
   }

   public void removeRegistration(String registrationHandle) throws RegistrationException, NoSuchRegistrationException
   {
      Registration registration = getRegistration(registrationHandle);
      if (registration == null)
      {
         throw new NoSuchRegistrationException("There is no Registration with handle '" + registrationHandle + "'");
      }
      removeRegistration(registration);
View Full Code Here

Examples of org.gatein.registration.Registration

   private Object getConsumerOrRegistration(String registrationHandle, boolean getConsumer) throws RegistrationException
   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationHandle, "registration handle", null);

      Registration registration = persistenceManager.getRegistration(registrationHandle);
      if (registration == null)
      {
         return null;
      }
      else
      {
         return getConsumer ? registration.getConsumer() : registration;
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.