/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this {@code EndpointPermission}. * * @param obj The object to test for equality. * @return true If obj is a {@code EndpointPermission}, and has the same * name, actions and endpoint as this {@code EndpointPermission} * object; {@code false} otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint.equals(ep.endpoint))); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals(other.getFrameworkUUID()); }
private boolean alreadyImported(EndpointDescription endpoint, Set<ImportRegistration> importRegistrations) { for (ImportRegistration ir : importRegistrations) { if (endpoint.equals(ir.getImportReference().getImportedEndpoint())) { return true; } } return false; }
/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this {@code EndpointPermission}. * * @param obj The object to test for equality. * @return true If obj is a {@code EndpointPermission}, and has the same * name, actions and endpoint as this {@code EndpointPermission} * object; {@code false} otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint.equals(ep.endpoint))); }
/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this {@code EndpointPermission}. * * @param obj The object to test for equality. * @return true If obj is a {@code EndpointPermission}, and has the same * name, actions and endpoint as this {@code EndpointPermission} * object; {@code false} otherwise. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint.equals(ep.endpoint))); }
/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this {@code EndpointPermission}. * * @param obj The object to test for equality. * @return true If obj is a {@code EndpointPermission}, and has the same * name, actions and endpoint as this {@code EndpointPermission} * object; {@code false} otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint.equals(ep.endpoint))); }
/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this {@code EndpointPermission}. * * @param obj The object to test for equality. * @return true If obj is a {@code EndpointPermission}, and has the same * name, actions and endpoint as this {@code EndpointPermission} * object; {@code false} otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint.equals(ep.endpoint))); }
/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this {@code EndpointPermission}. * * @param obj The object to test for equality. * @return true If obj is a {@code EndpointPermission}, and has the same * name, actions and endpoint as this {@code EndpointPermission} * object; {@code false} otherwise. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint.equals(ep.endpoint))); }
/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this <code>EndpointPermission</code>. * * @param obj The object to test for equality. * @return true If obj is a <code>EndpointPermission</code>, and has the * same name, actions and endpoint as this * <code>EndpointPermission</code> object; <code>false</code> * otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint .equals(ep.endpoint))); }
/** * Determines the equality of two EndpointPermission objects. * * Checks that specified object has the same name, actions and endpoint as * this {@code EndpointPermission}. * * @param obj The object to test for equality. * @return true If obj is a {@code EndpointPermission}, and has the * same name, actions and endpoint as this * {@code EndpointPermission} object; {@code false} * otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EndpointPermission)) { return false; } EndpointPermission ep = (EndpointPermission) obj; return (action_mask == ep.action_mask) && getName().equals(ep.getName()) && ((endpoint == ep.endpoint) || ((endpoint != null) && (ep.endpoint != null) && endpoint .equals(ep.endpoint))); }
@Override public boolean update(EndpointDescription endpoint) { if (m_closed.get()) { throw new IllegalStateException("Updating closed Import Registration not supported"); } if (m_exception != null) { throw new IllegalStateException("Updating invalid Import Registration not allowed"); } if (!endpoint.equals(m_endpoint)) { throw new IllegalArgumentException( "Updating Import Registation with different service instance not allowed"); } List<String> configurationTypes = endpoint.getConfigurationTypes(); if (!configurationTypes.contains(CONFIGURATION_TYPE)) { // TODO setexception return false; } String updateHash = computeHash(endpoint); if (!updateHash.equals(m_endpointHash)) { m_endpoint = endpoint; m_endpointHash = updateHash; Dictionary<String, Object> serviceProperties = createImportedServiceProperties(m_endpoint); m_clientRegistration.setProperties(serviceProperties); m_admin.importedEndpointUpdated(this); } return true; }
@Override public EndpointDescription update(Map<String, ?> properties) { if (m_closed.get()) { throw new IllegalStateException("Updating closed Export Registration not supported"); } if (m_exception != null) { throw new IllegalStateException("Updating invalid Export Registration not allowed"); } if (properties != null) { m_properties = properties; } EndpointDescription updateDescription = m_admin.createEndpointDescription(m_endpoint.getId(), m_reference, m_properties); if (updateDescription == null) { // TODO set exception? return null; } String updateHash = computeHash(updateDescription); if (!updateDescription.equals(m_endpointHash)) { m_endpoint = updateDescription; m_endpointHash = updateHash; // TODO m_endpoint#update() m_admin.exportedEndpointUpdated(this); } return m_endpoint; }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals(other.getFrameworkUUID()); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals(other.getFrameworkUUID()); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals(other.getFrameworkUUID()); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals(other.getFrameworkUUID()); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals( other.getFrameworkUUID()); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals( other.getFrameworkUUID()); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals(other.getFrameworkUUID()); }
/** * Answers if this Endpoint Description refers to the same service instance * as the given Endpoint Description. * * Two Endpoint Descriptions point to the same service if they have the same * id or their framework UUIDs and remote service ids are equal. * * @param other The Endpoint Description to look at * @return True if this endpoint description points to the same service as * the other */ public boolean isSameService(EndpointDescription other) { if (this.equals(other)) { return true; } if (this.getFrameworkUUID() == null) { return false; } return (this.getServiceId() == other.getServiceId()) && this.getFrameworkUUID().equals( other.getFrameworkUUID()); }